Revision 077e4de7
Prise en compte conventions de codage
Change-Id: I74d6ea904e099519e7d2b08f0586696470514280
Reviewed-on: https://vigilo-dev.si.c-s.fr/review/2367
Tested-by: Build system <qa@vigilo-dev.si.c-s.fr>
Reviewed-by: Francois POIROTTE <francois.poirotte@c-s.fr>
src/inc/menu.class.php | ||
---|---|---|
1 | 1 |
<?php |
2 | 2 |
|
3 |
if (!defined('GLPI_ROOT')) { |
|
4 |
die("Sorry. You can't access directly to this file"); |
|
5 |
} |
|
6 |
|
|
7 |
|
|
8 | 3 |
class PluginVigiloMenu extends CommonGLPI |
9 | 4 |
{ |
10 | 5 |
const TIMEOUT = 30; |
... | ... | |
14 | 9 |
* |
15 | 10 |
* @param $nb integer number of item in the type (default 0) |
16 | 11 |
**/ |
17 |
static function getTypeName($nb=0) { |
|
12 |
public static function getTypeName($nb = 0) |
|
13 |
{ |
|
18 | 14 |
return 'Vigilo'; |
19 | 15 |
} |
20 | 16 |
|
21 |
static function canView() { |
|
17 |
public static function canView() |
|
18 |
{ |
|
22 | 19 |
return true; |
23 | 20 |
} |
24 | 21 |
|
25 |
static function canCreate() { |
|
22 |
public static function canCreate() |
|
23 |
{ |
|
26 | 24 |
return false; |
27 | 25 |
} |
28 | 26 |
|
29 |
static function getMenuName() { |
|
27 |
public static function getMenuName() |
|
28 |
{ |
|
30 | 29 |
return self::getTypeName(); |
31 | 30 |
} |
32 | 31 |
|
33 |
static function getAdditionalMenuOptions() { |
|
32 |
public static function getAdditionalMenuOptions() |
|
33 |
{ |
|
34 | 34 |
return array(); |
35 | 35 |
} |
36 | 36 |
|
37 |
static function getAdditionalMenuContent() { |
|
37 |
public static function getAdditionalMenuContent() |
|
38 |
{ |
|
38 | 39 |
return array(); |
39 | 40 |
} |
40 | 41 |
|
41 |
static function displayMenu($res, $pipes) { |
|
42 |
public static function displayMenu($res, $pipes) |
|
43 |
{ |
|
42 | 44 |
echo '<h1>Vigilo</h1><form method="post" action="?itemtype=vigilo">'; |
43 | 45 |
|
44 | 46 |
if (is_resource($res)) { |
... | ... | |
54 | 56 |
$nb = stream_select($read, $write, $exc, static::TIMEOUT, 0); |
55 | 57 |
|
56 | 58 |
// Error |
57 |
if ($nb === FALSE) {
|
|
59 |
if ($nb === false) {
|
|
58 | 60 |
echo "UNKNOWN ERROR\n"; |
59 | 61 |
break; |
60 | 62 |
} |
... | ... | |
69 | 71 |
break; |
70 | 72 |
} |
71 | 73 |
|
72 |
foreach ($read as $stream){ |
|
74 |
foreach ($read as $stream) {
|
|
73 | 75 |
echo htmlspecialchars(fread($stream, 1024), ENT_HTML5 | ENT_QUOTES, "utf-8"); |
74 | 76 |
}; |
75 | 77 |
|
76 | 78 |
flush(); |
77 |
if (feof($pipes[1])){ |
|
78 |
break; |
|
79 |
if (feof($pipes[1])) {
|
|
80 |
break;
|
|
79 | 81 |
} |
80 | 82 |
} while (1); |
81 | 83 |
|
... | ... | |
83 | 85 |
if ($info === false) { |
84 | 86 |
echo "ERROR: could not determine process status\n"; |
85 | 87 |
} else { |
86 |
if ($info["signaled"]) |
|
88 |
if ($info["signaled"]) {
|
|
87 | 89 |
echo "Command terminated by signal ${info['termsig']}\n"; |
88 |
if ($info["stopped"]) |
|
90 |
} |
|
91 |
if ($info["stopped"]) { |
|
89 | 92 |
echo "Command stopped by signal ${info['stopsig']}\n"; |
93 |
} |
|
90 | 94 |
echo "Command exited with return code ${info['exitcode']}\n"; |
91 | 95 |
} |
92 | 96 |
|
Also available in: Unified diff