@@ -170,6 +170,7 @@ |
||
170 | 170 | |
171 | 171 | /** |
172 | 172 | * Permet de convertir un style définie en anglais pour le shell |
173 | + * @param string $style |
|
173 | 174 | */ |
174 | 175 | function styleForShell($style) |
175 | 176 | { |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | */ |
44 | 44 | function displayMsg($msg, $colorTxt = null, $colorBg = null, $style = 'normal') |
45 | 45 | { |
46 | - if($colorTxt == null) |
|
46 | + if ($colorTxt == null) |
|
47 | 47 | { |
48 | 48 | echo $msg."\n"; |
49 | 49 | return; |
@@ -55,26 +55,26 @@ discard block |
||
55 | 55 | $colorEnd = ''; |
56 | 56 | |
57 | 57 | $styleNum = styleForShell($style); |
58 | - if($styleNum === false) |
|
58 | + if ($styleNum === false) |
|
59 | 59 | { |
60 | 60 | $styleNum = styleForShell('normal'); |
61 | 61 | } |
62 | 62 | |
63 | 63 | $colorTxtNum = colorForShell('white', 'txt'); |
64 | - if($colorTxt !== null) |
|
64 | + if ($colorTxt !== null) |
|
65 | 65 | { |
66 | 66 | $colorTxtNumArg = colorForShell($colorTxt, 'txt'); |
67 | - if($colorTxtNumArg !== false) |
|
67 | + if ($colorTxtNumArg !== false) |
|
68 | 68 | { |
69 | 69 | $colorTxtNum = $colorTxtNumArg; |
70 | 70 | } |
71 | 71 | } |
72 | 72 | |
73 | 73 | $colorBgNum = colorForShell('black', 'bg'); |
74 | - if($colorBg !== null) |
|
74 | + if ($colorBg !== null) |
|
75 | 75 | { |
76 | 76 | $colorBgNumArg = colorForShell($colorBg, 'bg'); |
77 | - if($colorBgNumArg !== false) |
|
77 | + if ($colorBgNumArg !== false) |
|
78 | 78 | { |
79 | 79 | $colorBgNum = $colorBgNumArg; |
80 | 80 | } |
@@ -94,72 +94,72 @@ discard block |
||
94 | 94 | function colorForShell($color, $type) |
95 | 95 | { |
96 | 96 | //Possibilité d'améliorer la compléxité du script via des boucles etc... |
97 | - if($type == 'txt') |
|
97 | + if ($type == 'txt') |
|
98 | 98 | { |
99 | - if($color == 'black') |
|
99 | + if ($color == 'black') |
|
100 | 100 | { |
101 | 101 | return 30; |
102 | 102 | } |
103 | - elseif($color == 'red') |
|
103 | + elseif ($color == 'red') |
|
104 | 104 | { |
105 | 105 | return 31; |
106 | 106 | } |
107 | - elseif($color == 'green') |
|
107 | + elseif ($color == 'green') |
|
108 | 108 | { |
109 | 109 | return 32; |
110 | 110 | } |
111 | - elseif($color == 'yellow') |
|
111 | + elseif ($color == 'yellow') |
|
112 | 112 | { |
113 | 113 | return 33; |
114 | 114 | } |
115 | - elseif($color == 'blue') |
|
115 | + elseif ($color == 'blue') |
|
116 | 116 | { |
117 | 117 | return 34; |
118 | 118 | } |
119 | - elseif($color == 'magenta') |
|
119 | + elseif ($color == 'magenta') |
|
120 | 120 | { |
121 | 121 | return 35; |
122 | 122 | } |
123 | - elseif($color == 'cyan') |
|
123 | + elseif ($color == 'cyan') |
|
124 | 124 | { |
125 | 125 | return 36; |
126 | 126 | } |
127 | - elseif($color == 'white') |
|
127 | + elseif ($color == 'white') |
|
128 | 128 | { |
129 | 129 | return 37; |
130 | 130 | } |
131 | 131 | } |
132 | - elseif($type == 'bg') |
|
132 | + elseif ($type == 'bg') |
|
133 | 133 | { |
134 | - if($color == 'black') |
|
134 | + if ($color == 'black') |
|
135 | 135 | { |
136 | 136 | return 40; |
137 | 137 | } |
138 | - elseif($color == 'red') |
|
138 | + elseif ($color == 'red') |
|
139 | 139 | { |
140 | 140 | return 41; |
141 | 141 | } |
142 | - elseif($color == 'green') |
|
142 | + elseif ($color == 'green') |
|
143 | 143 | { |
144 | 144 | return 42; |
145 | 145 | } |
146 | - elseif($color == 'yellow') |
|
146 | + elseif ($color == 'yellow') |
|
147 | 147 | { |
148 | 148 | return 43; |
149 | 149 | } |
150 | - elseif($color == 'blue') |
|
150 | + elseif ($color == 'blue') |
|
151 | 151 | { |
152 | 152 | return 44; |
153 | 153 | } |
154 | - elseif($color == 'magenta') |
|
154 | + elseif ($color == 'magenta') |
|
155 | 155 | { |
156 | 156 | return 45; |
157 | 157 | } |
158 | - elseif($color == 'cyan') |
|
158 | + elseif ($color == 'cyan') |
|
159 | 159 | { |
160 | 160 | return 46; |
161 | 161 | } |
162 | - elseif($color == 'white') |
|
162 | + elseif ($color == 'white') |
|
163 | 163 | { |
164 | 164 | return 47; |
165 | 165 | } |
@@ -173,39 +173,39 @@ discard block |
||
173 | 173 | */ |
174 | 174 | function styleForShell($style) |
175 | 175 | { |
176 | - if($style == 'normal') |
|
176 | + if ($style == 'normal') |
|
177 | 177 | { |
178 | 178 | return 0; |
179 | 179 | } |
180 | - elseif($style == 'bold') |
|
180 | + elseif ($style == 'bold') |
|
181 | 181 | { |
182 | 182 | return 1; |
183 | 183 | } |
184 | - elseif($style == 'not-bold') |
|
184 | + elseif ($style == 'not-bold') |
|
185 | 185 | { |
186 | 186 | return 21; |
187 | 187 | } |
188 | - elseif($style == 'underline') |
|
188 | + elseif ($style == 'underline') |
|
189 | 189 | { |
190 | 190 | return 4; |
191 | 191 | } |
192 | - elseif($style == 'not-underline') |
|
192 | + elseif ($style == 'not-underline') |
|
193 | 193 | { |
194 | 194 | return 24; |
195 | 195 | } |
196 | - elseif($style == 'blink') |
|
196 | + elseif ($style == 'blink') |
|
197 | 197 | { |
198 | 198 | return 5; |
199 | 199 | } |
200 | - elseif($style == 'not-blink') |
|
200 | + elseif ($style == 'not-blink') |
|
201 | 201 | { |
202 | 202 | return 25; |
203 | 203 | } |
204 | - elseif($style == 'reverse') |
|
204 | + elseif ($style == 'reverse') |
|
205 | 205 | { |
206 | 206 | return 7; |
207 | 207 | } |
208 | - elseif($style == 'not-reverse') |
|
208 | + elseif ($style == 'not-reverse') |
|
209 | 209 | { |
210 | 210 | return 27; |
211 | 211 | } |
@@ -99,67 +99,52 @@ discard block |
||
99 | 99 | if($color == 'black') |
100 | 100 | { |
101 | 101 | return 30; |
102 | - } |
|
103 | - elseif($color == 'red') |
|
102 | + } elseif($color == 'red') |
|
104 | 103 | { |
105 | 104 | return 31; |
106 | - } |
|
107 | - elseif($color == 'green') |
|
105 | + } elseif($color == 'green') |
|
108 | 106 | { |
109 | 107 | return 32; |
110 | - } |
|
111 | - elseif($color == 'yellow') |
|
108 | + } elseif($color == 'yellow') |
|
112 | 109 | { |
113 | 110 | return 33; |
114 | - } |
|
115 | - elseif($color == 'blue') |
|
111 | + } elseif($color == 'blue') |
|
116 | 112 | { |
117 | 113 | return 34; |
118 | - } |
|
119 | - elseif($color == 'magenta') |
|
114 | + } elseif($color == 'magenta') |
|
120 | 115 | { |
121 | 116 | return 35; |
122 | - } |
|
123 | - elseif($color == 'cyan') |
|
117 | + } elseif($color == 'cyan') |
|
124 | 118 | { |
125 | 119 | return 36; |
126 | - } |
|
127 | - elseif($color == 'white') |
|
120 | + } elseif($color == 'white') |
|
128 | 121 | { |
129 | 122 | return 37; |
130 | 123 | } |
131 | - } |
|
132 | - elseif($type == 'bg') |
|
124 | + } elseif($type == 'bg') |
|
133 | 125 | { |
134 | 126 | if($color == 'black') |
135 | 127 | { |
136 | 128 | return 40; |
137 | - } |
|
138 | - elseif($color == 'red') |
|
129 | + } elseif($color == 'red') |
|
139 | 130 | { |
140 | 131 | return 41; |
141 | - } |
|
142 | - elseif($color == 'green') |
|
132 | + } elseif($color == 'green') |
|
143 | 133 | { |
144 | 134 | return 42; |
145 | - } |
|
146 | - elseif($color == 'yellow') |
|
135 | + } elseif($color == 'yellow') |
|
147 | 136 | { |
148 | 137 | return 43; |
149 | - } |
|
150 | - elseif($color == 'blue') |
|
138 | + } elseif($color == 'blue') |
|
151 | 139 | { |
152 | 140 | return 44; |
153 | - } |
|
154 | - elseif($color == 'magenta') |
|
141 | + } elseif($color == 'magenta') |
|
155 | 142 | { |
156 | 143 | return 45; |
157 | - } |
|
158 | - elseif($color == 'cyan') |
|
144 | + } elseif($color == 'cyan') |
|
159 | 145 | { |
160 | 146 | return 46; |
161 | - } |
|
162 | - elseif($color == 'white') |
|
147 | + } elseif($color == 'white') |
|
163 | 148 | { |
164 | 149 | return 47; |
165 | 150 | } |
@@ -176,36 +161,28 @@ discard block |
||
176 | 161 | if($style == 'normal') |
177 | 162 | { |
178 | 163 | return 0; |
179 | - } |
|
180 | - elseif($style == 'bold') |
|
164 | + } elseif($style == 'bold') |
|
181 | 165 | { |
182 | 166 | return 1; |
183 | - } |
|
184 | - elseif($style == 'not-bold') |
|
167 | + } elseif($style == 'not-bold') |
|
185 | 168 | { |
186 | 169 | return 21; |
187 | - } |
|
188 | - elseif($style == 'underline') |
|
170 | + } elseif($style == 'underline') |
|
189 | 171 | { |
190 | 172 | return 4; |
191 | - } |
|
192 | - elseif($style == 'not-underline') |
|
173 | + } elseif($style == 'not-underline') |
|
193 | 174 | { |
194 | 175 | return 24; |
195 | - } |
|
196 | - elseif($style == 'blink') |
|
176 | + } elseif($style == 'blink') |
|
197 | 177 | { |
198 | 178 | return 5; |
199 | - } |
|
200 | - elseif($style == 'not-blink') |
|
179 | + } elseif($style == 'not-blink') |
|
201 | 180 | { |
202 | 181 | return 25; |
203 | - } |
|
204 | - elseif($style == 'reverse') |
|
182 | + } elseif($style == 'reverse') |
|
205 | 183 | { |
206 | 184 | return 7; |
207 | - } |
|
208 | - elseif($style == 'not-reverse') |
|
185 | + } elseif($style == 'not-reverse') |
|
209 | 186 | { |
210 | 187 | return 27; |
211 | 188 | } |
@@ -31,6 +31,7 @@ |
||
31 | 31 | * - require (string, array) : Si le module doit avoir d'autre module de chargé avant. |
32 | 32 | * |
33 | 33 | * @throws \Exception Erreur sur la déclaration des options |
34 | + * @return void |
|
34 | 35 | */ |
35 | 36 | public function newMod($name, $params=array()); |
36 | 37 |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | * |
33 | 33 | * @throws \Exception Erreur sur la déclaration des options |
34 | 34 | */ |
35 | - public function newMod($name, $params=array()); |
|
35 | + public function newMod($name, $params = array()); |
|
36 | 36 | |
37 | 37 | /** |
38 | 38 | * Permet de vérifier si un module existe |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | * |
82 | 82 | * @return array Liste des modules non chargé |
83 | 83 | */ |
84 | - public function listNotLoad($regen=false); |
|
84 | + public function listNotLoad($regen = false); |
|
85 | 85 | |
86 | 86 | /** |
87 | 87 | * Permet de savoir si des modules n'ont pas pu être chargé |
@@ -7,17 +7,17 @@ |
||
7 | 7 | |
8 | 8 | $opt = getCliParams('vhp', array('version::', 'help::', 'parameters::')); |
9 | 9 | |
10 | -if(isset($opt['v']) || isset($opt['version'])) |
|
10 | +if (isset($opt['v']) || isset($opt['version'])) |
|
11 | 11 | { |
12 | 12 | displayMsg('v0.2'); |
13 | 13 | } |
14 | 14 | |
15 | -if(isset($opt['p']) || isset($opt['paramters'])) |
|
15 | +if (isset($opt['p']) || isset($opt['paramters'])) |
|
16 | 16 | { |
17 | 17 | displayMsg(print_r($opt, true)); |
18 | 18 | } |
19 | 19 | |
20 | -if(isset($opt['h']) || isset($opt['help'])) |
|
20 | +if (isset($opt['h']) || isset($opt['help'])) |
|
21 | 21 | { |
22 | 22 | displayMsg(''); |
23 | 23 | displayMsg('Helping Informations : Parameters script'); |
@@ -6,15 +6,15 @@ |
||
6 | 6 | */ |
7 | 7 | |
8 | 8 | //*** Config BFW *** |
9 | -$DebugMode = true; //True pour du dev (affiche toutes les erreurs), false pour de la prod (n'affiche rien) |
|
9 | +$DebugMode = true; //True pour du dev (affiche toutes les erreurs), false pour de la prod (n'affiche rien) |
|
10 | 10 | $errorRender = 'displayPHPError'; //Fonction d'erreur PHP personnalisé du framework. false pour désactiver |
11 | 11 | $myVendorName = 'vendor'; //Le nom du dossier où sont les libs de composer (default: "vendor") |
12 | 12 | //*** Config BFW *** |
13 | 13 | |
14 | 14 | //*** Memcache *** |
15 | -$memcache_enabled = false; //Permet d'activer ou non memcached |
|
15 | +$memcache_enabled = false; //Permet d'activer ou non memcached |
|
16 | 16 | $memcache_host = 'localhost'; //L'hote de connexion à memcached |
17 | -$memcache_port = 11211; //Le port de connexion à memcached |
|
17 | +$memcache_port = 11211; //Le port de connexion à memcached |
|
18 | 18 | //*** Memcache *** |
19 | 19 | |
20 | 20 | //*** Base De Données *** |
@@ -12,7 +12,7 @@ |
||
12 | 12 | define('cliMode', true); |
13 | 13 | //--- Config pour le kernel BFW --- |
14 | 14 | |
15 | -if(PHP_SAPI != 'cli') |
|
15 | +if (PHP_SAPI != 'cli') |
|
16 | 16 | { |
17 | 17 | echo 'Fichier utilisable en mode CLI uniquement.'; |
18 | 18 | exit; |
@@ -53,13 +53,13 @@ discard block |
||
53 | 53 | $this->_kernel = getKernel(); |
54 | 54 | |
55 | 55 | //Vérification si l'extension memcache est bien loadé |
56 | - if(!extension_loaded('memcache')) |
|
56 | + if (!extension_loaded('memcache')) |
|
57 | 57 | { |
58 | 58 | throw new Exception('Memcache php extension is not loaded.'); |
59 | 59 | } |
60 | 60 | |
61 | 61 | //Vérifie que les infos sont bien au bon typage |
62 | - if(!(is_string($host) && is_integer($port))) |
|
62 | + if (!(is_string($host) && is_integer($port))) |
|
63 | 63 | { |
64 | 64 | throw new Exception('Memcache connexion informations format is not correct.'); |
65 | 65 | } |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | $this->Server = new \Memcache; |
68 | 68 | |
69 | 69 | //Se connexion ... exception si fail |
70 | - if($this->Server->connect($host, $port) === false) |
|
70 | + if ($this->Server->connect($host, $port) === false) |
|
71 | 71 | { |
72 | 72 | throw new Exception('Memcache connect fail.'); |
73 | 73 | } |
@@ -86,20 +86,20 @@ discard block |
||
86 | 86 | * |
87 | 87 | * @return bool |
88 | 88 | */ |
89 | - public function setVal($key, $data, $expire=0) |
|
89 | + public function setVal($key, $data, $expire = 0) |
|
90 | 90 | { |
91 | 91 | $verifParams = verifTypeData(array( |
92 | 92 | array('type' => 'string', 'data' => $key), |
93 | - array('type' => 'int', 'data' => $expire) |
|
93 | + array('type' => 'int', 'data' => $expire) |
|
94 | 94 | )); |
95 | 95 | |
96 | - if(!$verifParams || gettype($data) == 'resource') |
|
96 | + if (!$verifParams || gettype($data) == 'resource') |
|
97 | 97 | { |
98 | 98 | throw new \Exception('Erreur dans les paramètres de Ram->setVal()'); |
99 | 99 | } |
100 | 100 | |
101 | 101 | $valDataServer = $this->Server->get($key); |
102 | - if($valDataServer !== false) |
|
102 | + if ($valDataServer !== false) |
|
103 | 103 | { |
104 | 104 | return $this->Server->replace($key, $data, 0, $expire); |
105 | 105 | } |
@@ -121,10 +121,10 @@ discard block |
||
121 | 121 | { |
122 | 122 | $verifParams = verifTypeData(array( |
123 | 123 | array('type' => 'string', 'data' => $key), |
124 | - array('type' => 'int', 'data' => $exp) |
|
124 | + array('type' => 'int', 'data' => $exp) |
|
125 | 125 | )); |
126 | 126 | |
127 | - if(!$verifParams) |
|
127 | + if (!$verifParams) |
|
128 | 128 | { |
129 | 129 | throw new \Exception('Erreur dans les paramètres de Ram->majExpire()'); |
130 | 130 | } |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | |
134 | 134 | //On la "modifie" en remettant la même valeur mais en changeant le temps |
135 | 135 | //avant expiration si une valeur a été retournée |
136 | - if($ret !== false && $this->Server->replace($key, $ret, 0, $exp)) |
|
136 | + if ($ret !== false && $this->Server->replace($key, $ret, 0, $exp)) |
|
137 | 137 | { |
138 | 138 | return true; |
139 | 139 | } |
@@ -154,14 +154,14 @@ discard block |
||
154 | 154 | { |
155 | 155 | $verifParams = verifTypeData(array(array('type' => 'string', 'data' => $key))); |
156 | 156 | |
157 | - if(!$verifParams) |
|
157 | + if (!$verifParams) |
|
158 | 158 | { |
159 | 159 | throw new \Exception('Erreur dans les paramètres de Ram->ifExists()'); |
160 | 160 | } |
161 | 161 | |
162 | 162 | $ret = $this->Server->get($key); //Récupère la valeur |
163 | 163 | |
164 | - if($ret === false) {return false;} |
|
164 | + if ($ret === false) {return false; } |
|
165 | 165 | return true; |
166 | 166 | } |
167 | 167 | |
@@ -176,12 +176,12 @@ discard block |
||
176 | 176 | { |
177 | 177 | $verifParams = verifTypeData(array(array('type' => 'string', 'data' => $key))); |
178 | 178 | |
179 | - if(!$verifParams) |
|
179 | + if (!$verifParams) |
|
180 | 180 | { |
181 | 181 | throw new \Exception('Erreur dans les paramètres de Ram->delete()'); |
182 | 182 | } |
183 | 183 | |
184 | - if($this->Server->delete($key)) {return true;} |
|
184 | + if ($this->Server->delete($key)) {return true; } |
|
185 | 185 | return false; |
186 | 186 | } |
187 | 187 | |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | { |
199 | 199 | $verifParams = verifTypeData(array(array('type' => 'string', 'data' => $key))); |
200 | 200 | |
201 | - if(!$verifParams) |
|
201 | + if (!$verifParams) |
|
202 | 202 | { |
203 | 203 | throw new \Exception('Erreur dans les paramètres de Ram->getVal()'); |
204 | 204 | } |
@@ -36,11 +36,11 @@ discard block |
||
36 | 36 | */ |
37 | 37 | public function updateWithAction($subject, $action) |
38 | 38 | { |
39 | - if(!is_object($subject)) |
|
39 | + if (!is_object($subject)) |
|
40 | 40 | { |
41 | 41 | throw new Exception('Le paramètre $subject doit être un objet.'); |
42 | 42 | } |
43 | - elseif(is_object($subject) && get_class($subject) != '\SplSubject') |
|
43 | + elseif (is_object($subject) && get_class($subject) != '\SplSubject') |
|
44 | 44 | { |
45 | 45 | throw new Exception('Le paramètre $subject doit être un objet de type \SplSubject.'); |
46 | 46 | } |
@@ -61,13 +61,13 @@ discard block |
||
61 | 61 | $regex = '([0-9a-zA-Z.,_-]+)'; |
62 | 62 | $regex2 = '([0-9a-zA-Z.,_-]*)'; |
63 | 63 | |
64 | - if(strpos($action, '::') !== false) |
|
64 | + if (strpos($action, '::') !== false) |
|
65 | 65 | { |
66 | 66 | $preg_match = preg_match('^'.$regex.'::'.$regex.'\('.$regex2.'\);$', $action, $match); |
67 | 67 | $class = $match[1]; |
68 | 68 | $args = $match[3]; |
69 | 69 | } |
70 | - elseif(strpos($action, '->') !== false) |
|
70 | + elseif (strpos($action, '->') !== false) |
|
71 | 71 | { |
72 | 72 | $preg_match = preg_match('^'.$regex.'::'.$regex.'\('.$regex2.'\);$', $action, $match); |
73 | 73 | $class = $match[1]; |
@@ -79,16 +79,16 @@ discard block |
||
79 | 79 | $args = $match[2]; |
80 | 80 | } |
81 | 81 | |
82 | - if(!is_null($class)) |
|
82 | + if (!is_null($class)) |
|
83 | 83 | { |
84 | 84 | $class = str_replace('$', '', $class); |
85 | 85 | global ${$class}; |
86 | 86 | } |
87 | 87 | |
88 | - if(!is_null($args)) |
|
88 | + if (!is_null($args)) |
|
89 | 89 | { |
90 | 90 | $args = explode(',', $args); |
91 | - foreach($args as $arg) |
|
91 | + foreach ($args as $arg) |
|
92 | 92 | { |
93 | 93 | $arg = str_replace('$', '', $arg); |
94 | 94 | global ${$arg}; |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | { |
100 | 100 | eval($action); |
101 | 101 | } |
102 | - catch(\Exception $e) |
|
102 | + catch (\Exception $e) |
|
103 | 103 | { |
104 | 104 | echo $e->getMessage(); |
105 | 105 | } |
@@ -39,8 +39,7 @@ discard block |
||
39 | 39 | if(!is_object($subject)) |
40 | 40 | { |
41 | 41 | throw new Exception('Le paramètre $subject doit être un objet.'); |
42 | - } |
|
43 | - elseif(is_object($subject) && get_class($subject) != '\SplSubject') |
|
42 | + } elseif(is_object($subject) && get_class($subject) != '\SplSubject') |
|
44 | 43 | { |
45 | 44 | throw new Exception('Le paramètre $subject doit être un objet de type \SplSubject.'); |
46 | 45 | } |
@@ -66,14 +65,12 @@ discard block |
||
66 | 65 | $preg_match = preg_match('^'.$regex.'::'.$regex.'\('.$regex2.'\);$', $action, $match); |
67 | 66 | $class = $match[1]; |
68 | 67 | $args = $match[3]; |
69 | - } |
|
70 | - elseif(strpos($action, '->') !== false) |
|
68 | + } elseif(strpos($action, '->') !== false) |
|
71 | 69 | { |
72 | 70 | $preg_match = preg_match('^'.$regex.'::'.$regex.'\('.$regex2.'\);$', $action, $match); |
73 | 71 | $class = $match[1]; |
74 | 72 | $args = $match[3]; |
75 | - } |
|
76 | - else |
|
73 | + } else |
|
77 | 74 | { |
78 | 75 | $preg_match = preg_match('^'.$regex.'\('.$regex2.'\);$', $action, $match); |
79 | 76 | $args = $match[2]; |
@@ -98,8 +95,7 @@ discard block |
||
98 | 95 | try |
99 | 96 | { |
100 | 97 | eval($action); |
101 | - } |
|
102 | - catch(\Exception $e) |
|
98 | + } catch(\Exception $e) |
|
103 | 99 | { |
104 | 100 | echo $e->getMessage(); |
105 | 101 | } |
@@ -49,7 +49,7 @@ |
||
49 | 49 | */ |
50 | 50 | protected function _indent() |
51 | 51 | { |
52 | - for($i = 0, $j = count($this->stack); $i < $j; $i++) |
|
52 | + for ($i = 0, $j = count($this->stack); $i < $j; $i++) |
|
53 | 53 | { |
54 | 54 | $this->xml .= $this->indent; |
55 | 55 | } |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | $this->_kernel = getKernel(); |
199 | 199 | |
200 | 200 | $this->recup_infos(); |
201 | - if(isset($_SESSION['idSess'])) |
|
201 | + if (isset($_SESSION['idSess'])) |
|
202 | 202 | { |
203 | 203 | $this->idSession = $_SESSION['idSess']; |
204 | 204 | } |
@@ -249,9 +249,9 @@ discard block |
||
249 | 249 | 'HTTP_CLIENT_IP' |
250 | 250 | ); |
251 | 251 | |
252 | - foreach($array as $key) |
|
252 | + foreach ($array as $key) |
|
253 | 253 | { |
254 | - if(isset($_SERVER[$key]) && !empty($_SERVER[$key])) |
|
254 | + if (isset($_SERVER[$key]) && !empty($_SERVER[$key])) |
|
255 | 255 | { |
256 | 256 | $this->proxy = $_SERVER[$key]; |
257 | 257 | return $this->proxy; |
@@ -269,7 +269,7 @@ discard block |
||
269 | 269 | { |
270 | 270 | $this->proxyIp = ''; |
271 | 271 | |
272 | - if($this->proxy != NULL) |
|
272 | + if ($this->proxy != NULL) |
|
273 | 273 | { |
274 | 274 | $this->proxyIp = $_SERVER['REMOTE_ADDR']; |
275 | 275 | } |
@@ -295,11 +295,11 @@ discard block |
||
295 | 295 | { |
296 | 296 | $this->ip = 'Unknown'; |
297 | 297 | |
298 | - if($this->proxy != NULL) |
|
298 | + if ($this->proxy != NULL) |
|
299 | 299 | { |
300 | 300 | $this->ip = $this->proxy; |
301 | 301 | } |
302 | - elseif(isset($_SERVER['REMOTE_ADDR'])) |
|
302 | + elseif (isset($_SERVER['REMOTE_ADDR'])) |
|
303 | 303 | { |
304 | 304 | $this->ip = $_SERVER['REMOTE_ADDR']; |
305 | 305 | } |
@@ -323,8 +323,7 @@ discard block |
||
323 | 323 | */ |
324 | 324 | protected function systemDetect() |
325 | 325 | { |
326 | - $array = array |
|
327 | - ( |
|
326 | + $array = array( |
|
328 | 327 | '(win|windows) ?(9x ?4\.90|Me)' => 'Windows ME', |
329 | 328 | '(win|windows) ?(95)' => 'Windows 95', |
330 | 329 | '(win|windows) ?(98)' => 'Windows 98', |
@@ -360,10 +359,10 @@ discard block |
||
360 | 359 | 'os/2' => 'OS/2' |
361 | 360 | ); |
362 | 361 | |
363 | - foreach($array as $reg => $system) |
|
362 | + foreach ($array as $reg => $system) |
|
364 | 363 | { |
365 | 364 | //Mozilla/5.0 (Windows; U; Windows NT 6.0; fr; rv:1.8.1.20) Gecko/20081217 Firefox/2.0.0.20 |
366 | - if(isset($_SERVER['HTTP_USER_AGENT']) && preg_match('#'.$reg.'#i', $_SERVER['HTTP_USER_AGENT'])) |
|
365 | + if (isset($_SERVER['HTTP_USER_AGENT']) && preg_match('#'.$reg.'#i', $_SERVER['HTTP_USER_AGENT'])) |
|
367 | 366 | { |
368 | 367 | $this->os = $system; |
369 | 368 | return; |
@@ -378,8 +377,7 @@ discard block |
||
378 | 377 | */ |
379 | 378 | protected function browserDetect() |
380 | 379 | { |
381 | - $array=array |
|
382 | - ( |
|
380 | + $array = array( |
|
383 | 381 | '(MSIE)' => 'Internet Explorer', |
384 | 382 | '(Chrome)' => 'Chrome', |
385 | 383 | '(Opera)' => 'Opera', |
@@ -400,15 +398,15 @@ discard block |
||
400 | 398 | '(Mozilla)' => 'Mozilla' |
401 | 399 | ); |
402 | 400 | |
403 | - if(isset($_SERVER['HTTP_USER_AGENT'])) |
|
401 | + if (isset($_SERVER['HTTP_USER_AGENT'])) |
|
404 | 402 | { |
405 | - foreach($array as $reg => $browser) |
|
403 | + foreach ($array as $reg => $browser) |
|
406 | 404 | { |
407 | 405 | $match = array(); |
408 | - if(preg_match('#'.$reg.'#i', $_SERVER['HTTP_USER_AGENT'], $match)) |
|
406 | + if (preg_match('#'.$reg.'#i', $_SERVER['HTTP_USER_AGENT'], $match)) |
|
409 | 407 | { |
410 | 408 | $this->nav = $browser; |
411 | - if($browser == 'Search engine') |
|
409 | + if ($browser == 'Search engine') |
|
412 | 410 | { |
413 | 411 | $this->bot = $match[1]; |
414 | 412 | } |
@@ -437,7 +435,7 @@ discard block |
||
437 | 435 | */ |
438 | 436 | |
439 | 437 | $lang = 'Unknown'; |
440 | - if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) |
|
438 | + if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) |
|
441 | 439 | { |
442 | 440 | $language = $_SERVER['HTTP_ACCEPT_LANGUAGE']; |
443 | 441 | $ex = explode(',', $language); |
@@ -445,7 +443,7 @@ discard block |
||
445 | 443 | $ex2 = explode(';', $ex[0]); |
446 | 444 | $lang = strtolower($ex2[0]); |
447 | 445 | |
448 | - if(strpos($lang, '-') !== false) |
|
446 | + if (strpos($lang, '-') !== false) |
|
449 | 447 | { |
450 | 448 | $ex3 = explode('-', $lang); |
451 | 449 | $lang = $ex3[0]; |
@@ -462,7 +460,7 @@ discard block |
||
462 | 460 | * |
463 | 461 | * @return string La langue choisie. "Inconnue" si elle n'a pas été trouvée. |
464 | 462 | */ |
465 | - protected function languageConvert($lang='') |
|
463 | + protected function languageConvert($lang = '') |
|
466 | 464 | { |
467 | 465 | $array = array( |
468 | 466 | 'AF' => 'Afrikaans', |
@@ -533,7 +531,7 @@ discard block |
||
533 | 531 | ); |
534 | 532 | |
535 | 533 | $lang = strtoupper($lang); |
536 | - if(array_key_exists($lang, $array)) |
|
534 | + if (array_key_exists($lang, $array)) |
|
537 | 535 | { |
538 | 536 | return $array[$lang]; |
539 | 537 | } |
@@ -547,7 +545,7 @@ discard block |
||
547 | 545 | protected function refererDetect() |
548 | 546 | { |
549 | 547 | $this->proviens = 'Inconnu'; |
550 | - if(!empty($_SERVER['HTTP_REFERER'])) |
|
548 | + if (!empty($_SERVER['HTTP_REFERER'])) |
|
551 | 549 | { |
552 | 550 | $this->proviens = $_SERVER['HTTP_REFERER']; |
553 | 551 | } |
@@ -559,7 +557,7 @@ discard block |
||
559 | 557 | protected function uriDetect() |
560 | 558 | { |
561 | 559 | $this->url = 'Inconnu'; |
562 | - if(!empty($_SERVER['REQUEST_URI'])) |
|
560 | + if (!empty($_SERVER['REQUEST_URI'])) |
|
563 | 561 | { |
564 | 562 | $this->url = 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; |
565 | 563 | } |
@@ -298,8 +298,7 @@ |
||
298 | 298 | if($this->proxy != NULL) |
299 | 299 | { |
300 | 300 | $this->ip = $this->proxy; |
301 | - } |
|
302 | - elseif(isset($_SERVER['REMOTE_ADDR'])) |
|
301 | + } elseif(isset($_SERVER['REMOTE_ADDR'])) |
|
303 | 302 | { |
304 | 303 | $this->ip = $_SERVER['REMOTE_ADDR']; |
305 | 304 | } |