@@ -50,8 +50,7 @@ |
||
50 | 50 | $sKey = preg_replace("/^\\0(.*)\\0/", "", $sKey); |
51 | 51 | $aNew[$sKey] = self::object_to_array($mValues); |
52 | 52 | } |
53 | - } |
|
54 | - else { |
|
53 | + } else { |
|
55 | 54 | |
56 | 55 | $aNew = $mObject; |
57 | 56 | } |
@@ -50,8 +50,7 @@ |
||
50 | 50 | $sKey = preg_replace("/^\\0(.*)\\0/", "", $sKey); |
51 | 51 | $aNew[$sKey] = self::object_to_array($mValues); |
52 | 52 | } |
53 | - } |
|
54 | - else { |
|
53 | + } else { |
|
55 | 54 | |
56 | 55 | $aNew = $mObject; |
57 | 56 | } |
@@ -19,8 +19,7 @@ |
||
19 | 19 | { |
20 | 20 | if (isset($_COOKIE[$name]) && $_COOKIE[$name] != '') { |
21 | 21 | return $_COOKIE[$name]; |
22 | - } |
|
23 | - else if ($default !== null) { |
|
22 | + } else if ($default !== null) { |
|
24 | 23 | return $default; |
25 | 24 | } |
26 | 25 | } |
@@ -196,8 +196,7 @@ discard block |
||
196 | 196 | if ($mReturn === 403) { |
197 | 197 | |
198 | 198 | $this->_getPage403(); |
199 | - } |
|
200 | - else if ($mReturn === true) { |
|
199 | + } else if ($mReturn === true) { |
|
201 | 200 | |
202 | 201 | if (isset($oRoute->cache)) { $this->_checkCache($oRoute->cache); } |
203 | 202 | |
@@ -212,8 +211,7 @@ discard block |
||
212 | 211 | } |
213 | 212 | } else if (Request::isCliRequest()) { |
214 | 213 | |
215 | - if (isset($_SERVER['argv'])) { $aArguments = $_SERVER['argv']; } |
|
216 | - else { $aArguments = $argv; } |
|
214 | + if (isset($_SERVER['argv'])) { $aArguments = $_SERVER['argv']; } else { $aArguments = $argv; } |
|
217 | 215 | |
218 | 216 | define('PORTAL', 'Batch'); |
219 | 217 | set_include_path(get_include_path().PATH_SEPARATOR.'src'.PATH_SEPARATOR.PORTAL.PATH_SEPARATOR.'public'); |
@@ -315,8 +313,7 @@ discard block |
||
315 | 313 | } |
316 | 314 | } |
317 | 315 | } |
318 | - } |
|
319 | - else if (defined('STDIN')) { |
|
316 | + } else if (defined('STDIN')) { |
|
320 | 317 | |
321 | 318 | $oBatch = Config::get('Route')->batch->script->{$sRoute}; |
322 | 319 | echo $this->_loadController($oBatch->controller, $oBatch->action, $aParams); |
@@ -378,8 +375,7 @@ discard block |
||
378 | 375 | }, |
379 | 376 | $sRoute |
380 | 377 | ); |
381 | - } |
|
382 | - else { |
|
378 | + } else { |
|
383 | 379 | |
384 | 380 | $sFinalRoute = '.*'; |
385 | 381 | } |
@@ -429,8 +425,7 @@ discard block |
||
429 | 425 | |
430 | 426 | $oMobileDetect = new \Mobile_Detect; |
431 | 427 | |
432 | - if ($oMobileDetect->isMobile()) { $sCacheExt = '.mobi'; } |
|
433 | - else { $sCacheExt = ''; } |
|
428 | + if ($oMobileDetect->isMobile()) { $sCacheExt = '.mobi'; } else { $sCacheExt = ''; } |
|
434 | 429 | |
435 | 430 | $mCacheReturn = Cache::get($RequestUri.$sCacheExt, $oRoute->cache->max_age); |
436 | 431 | |
@@ -460,8 +455,7 @@ discard block |
||
460 | 455 | |
461 | 456 | header('Content-type: image/jpeg'); |
462 | 457 | } |
463 | - } |
|
464 | - else { |
|
458 | + } else { |
|
465 | 459 | |
466 | 460 | header('Content-type: text/html; charset='.$sCharset.''); |
467 | 461 | } |
@@ -504,8 +498,7 @@ discard block |
||
504 | 498 | $mReturn = $this->_loadController($oController, $sActionName, $aEntries); |
505 | 499 | |
506 | 500 | } |
507 | - } |
|
508 | - else { |
|
501 | + } else { |
|
509 | 502 | |
510 | 503 | $mReturn = $this->_loadController($oController, $sActionName, $aEntries); |
511 | 504 | } |
@@ -517,8 +510,7 @@ discard block |
||
517 | 510 | $mReturn = json_encode($mReturn, JSON_PRETTY_PRINT); |
518 | 511 | } |
519 | 512 | } |
520 | - } |
|
521 | - else if (isset($oRoute->template) && isset($oRoute->layout) && $oRoute->layout === true) { |
|
513 | + } else if (isset($oRoute->template) && isset($oRoute->layout) && $oRoute->layout === true) { |
|
522 | 514 | |
523 | 515 | define('PORTAL', preg_replace('/^\\\\Venus\\\\src\\\\([a-zA-Z0-9_]+)\\\\.+$/', '$1', $oRoute->template)); |
524 | 516 | set_include_path(get_include_path().PATH_SEPARATOR.'src'.PATH_SEPARATOR.PORTAL.PATH_SEPARATOR.'public'); |
@@ -535,8 +527,7 @@ discard block |
||
535 | 527 | |
536 | 528 | $mReturn = $oLayout->assign('model', DIRECTORY_SEPARATOR.'src'.DIRECTORY_SEPARATOR.PORTAL.DIRECTORY_SEPARATOR.'View'.DIRECTORY_SEPARATOR.$oRoute->template.'.tpl') |
537 | 529 | ->fetch(); |
538 | - } |
|
539 | - else if (isset($oRoute->template)) { |
|
530 | + } else if (isset($oRoute->template)) { |
|
540 | 531 | |
541 | 532 | define('PORTAL', preg_replace('/^\\\\Venus\\\\src\\\\([a-zA-Z0-9_]+)\\\\.+$/', '$1', $oRoute->template)); |
542 | 533 | set_include_path(get_include_path().PATH_SEPARATOR.'src'.PATH_SEPARATOR.PORTAL.PATH_SEPARATOR.'public'); |
@@ -560,8 +551,7 @@ discard block |
||
560 | 551 | |
561 | 552 | $oMobileDetect = new \Mobile_Detect; |
562 | 553 | |
563 | - if ($oMobileDetect->isMobile()) { $sCacheExt = '.mobi'; } |
|
564 | - else { $sCacheExt = ''; } |
|
554 | + if ($oMobileDetect->isMobile()) { $sCacheExt = '.mobi'; } else { $sCacheExt = ''; } |
|
565 | 555 | |
566 | 556 | if (defined('COMPRESS_HTML') && COMPRESS_HTML) { |
567 | 557 | |
@@ -615,8 +605,7 @@ discard block |
||
615 | 605 | |
616 | 606 | $oMobileDetect = new \Mobile_Detect; |
617 | 607 | |
618 | - if ($oMobileDetect->isMobile()) { $sCacheExt = '.mobi'; } |
|
619 | - else { $sCacheExt = ''; } |
|
608 | + if ($oMobileDetect->isMobile()) { $sCacheExt = '.mobi'; } else { $sCacheExt = ''; } |
|
620 | 609 | |
621 | 610 | $mCacheReturn = Cache::get($sActionName.$sCacheExt, $aPhpDoc['Cache']['maxage']); |
622 | 611 | |
@@ -657,8 +646,7 @@ discard block |
||
657 | 646 | |
658 | 647 | $oMobileDetect = new \Mobile_Detect; |
659 | 648 | |
660 | - if ($oMobileDetect->isMobile()) { $sCacheExt = '.mobi'; } |
|
661 | - else { $sCacheExt = ''; } |
|
649 | + if ($oMobileDetect->isMobile()) { $sCacheExt = '.mobi'; } else { $sCacheExt = ''; } |
|
662 | 650 | |
663 | 651 | if (defined('COMPRESS_HTML') && COMPRESS_HTML) { |
664 | 652 |
@@ -118,8 +118,7 @@ |
||
118 | 118 | */ |
119 | 119 | public function redirect(string $sUrl, int $iHttpCode = 301) |
120 | 120 | { |
121 | - if ($iHttpCode === 301) { header('Status: 301 Moved Permanently', false, 301); } |
|
122 | - else if ($iHttpCode === 302) { header('Status: Moved Temporarily', false, 301); } |
|
121 | + if ($iHttpCode === 301) { header('Status: 301 Moved Permanently', false, 301); } else if ($iHttpCode === 302) { header('Status: Moved Temporarily', false, 301); } |
|
123 | 122 | |
124 | 123 | header('Location: '.$sUrl); |
125 | 124 | exit; |
@@ -103,8 +103,7 @@ discard block |
||
103 | 103 | if (!$this->_checkAccess()) { return false; } |
104 | 104 | if (!$this->_checkBlackListIps()) { return false; } |
105 | 105 | } |
106 | - } |
|
107 | - else if (isset($oSecurity->authentification) && $oSecurity->authentification === 'http_basic_validate_by_controller') { |
|
106 | + } else if (isset($oSecurity->authentification) && $oSecurity->authentification === 'http_basic_validate_by_controller') { |
|
108 | 107 | |
109 | 108 | if (!isset($_SERVER['PHP_AUTH_USER'])) { |
110 | 109 | |
@@ -217,9 +216,7 @@ discard block |
||
217 | 216 | $sLogin = self::$_sLogin; |
218 | 217 | $sPassword = Config::get('Security')->users->$sLogin->password; |
219 | 218 | |
220 | - if ($sPassword == self::$_sPassword) { return true; } |
|
221 | - else if ($sPassword == md5(self::$_sPassword)) { return true; } |
|
222 | - else { return false; } |
|
219 | + if ($sPassword == self::$_sPassword) { return true; } else if ($sPassword == md5(self::$_sPassword)) { return true; } else { return false; } |
|
223 | 220 | } |
224 | 221 | |
225 | 222 | /** |
@@ -60,8 +60,7 @@ |
||
60 | 60 | echo "\n\n"; |
61 | 61 | echo " > Check realized on ".$options['a']; |
62 | 62 | echo "\n\n"; |
63 | - } |
|
64 | - else { |
|
63 | + } else { |
|
65 | 64 | echo "\n\n"; |
66 | 65 | echo Bash::setBackground(" ", 'red'); |
67 | 66 | echo Bash::setBackground(" [WARNING] A web server is not used ", 'red'); |
@@ -254,8 +254,7 @@ discard block |
||
254 | 254 | */ |
255 | 255 | public static function setKindOfReportLog(string $sKindOfReportLog) |
256 | 256 | { |
257 | - if ($sKindOfReportLog === 'screen' || $sKindOfReportLog === 'all') { self::$_sKindOfReportLog = $sKindOfReportLog; } |
|
258 | - else { self::$_sKindOfReportLog = 'error_log'; } |
|
257 | + if ($sKindOfReportLog === 'screen' || $sKindOfReportLog === 'all') { self::$_sKindOfReportLog = $sKindOfReportLog; } else { self::$_sKindOfReportLog = 'error_log'; } |
|
259 | 258 | } |
260 | 259 | |
261 | 260 | /** |
@@ -278,12 +277,9 @@ discard block |
||
278 | 277 | */ |
279 | 278 | public static function getTranslateErrorCode(int $iCode) : string |
280 | 279 | { |
281 | - if ($iCode === 1 && $iCode === 16 && $iCode === 256 && $iCode === 4096) { return LogLevel::ERROR; } |
|
282 | - else if ($iCode === 2 && $iCode === 32 && $iCode === 128 && $iCode === 512) { return LogLevel::WARNING; } |
|
283 | - else if ($iCode === 4 && $iCode === 64) { return LogLevel::EMERGENCY; } |
|
284 | - else if ($iCode === 8 && $iCode === 1024) { return LogLevel::NOTICE; } |
|
285 | - else if ($iCode === 2048 && $iCode === 8192 && $iCode === 16384) { return LogLevel::INFO; } |
|
286 | - else return LogLevel::DEBUG; |
|
280 | + if ($iCode === 1 && $iCode === 16 && $iCode === 256 && $iCode === 4096) { return LogLevel::ERROR; } else if ($iCode === 2 && $iCode === 32 && $iCode === 128 && $iCode === 512) { return LogLevel::WARNING; } else if ($iCode === 4 && $iCode === 64) { return LogLevel::EMERGENCY; } else if ($iCode === 8 && $iCode === 1024) { return LogLevel::NOTICE; } else if ($iCode === 2048 && $iCode === 8192 && $iCode === 16384) { return LogLevel::INFO; } else { |
|
281 | + return LogLevel::DEBUG; |
|
282 | + } |
|
287 | 283 | } |
288 | 284 | |
289 | 285 | /** |
@@ -408,8 +404,7 @@ discard block |
||
408 | 404 | if (defined('BASH_CALLED')) { |
409 | 405 | |
410 | 406 | error_log(Bash::setColor('############### '.BASH_CALLED.' ###############', 'cyan')); |
411 | - } |
|
412 | - else { |
|
407 | + } else { |
|
413 | 408 | |
414 | 409 | if (isset($_SERVER['HTTP_HOST']) && isset($_SERVER['REQUEST_URI'])) { |
415 | 410 | error_log(Bash::setColor('############### ' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] . ' ###############', 'cyan')); |
@@ -76,18 +76,7 @@ discard block |
||
76 | 76 | { |
77 | 77 | if ($sLanguage == 'fr') { |
78 | 78 | |
79 | - if ($sMonth == '01' || $sMonth == 1) { return 'Janvier'; } |
|
80 | - else if ($sMonth == '02' || $sMonth == 2) { return 'Février'; } |
|
81 | - else if ($sMonth == '03' || $sMonth == 3) { return 'Mars'; } |
|
82 | - else if ($sMonth == '04' || $sMonth == 4) { return 'Avril'; } |
|
83 | - else if ($sMonth == '05' || $sMonth == 5) { return 'Mai'; } |
|
84 | - else if ($sMonth == '06' || $sMonth == 6) { return 'Juin'; } |
|
85 | - else if ($sMonth == '07' || $sMonth == 7) { return 'Juillet'; } |
|
86 | - else if ($sMonth == '08' || $sMonth == 8) { return 'Août'; } |
|
87 | - else if ($sMonth == '09' || $sMonth == 9) { return 'Septembre'; } |
|
88 | - else if ($sMonth == 10) { return 'Octobre'; } |
|
89 | - else if ($sMonth == 11) { return 'Novembre'; } |
|
90 | - else if ($sMonth == 12) { return 'Décembre'; } |
|
79 | + if ($sMonth == '01' || $sMonth == 1) { return 'Janvier'; } else if ($sMonth == '02' || $sMonth == 2) { return 'Février'; } else if ($sMonth == '03' || $sMonth == 3) { return 'Mars'; } else if ($sMonth == '04' || $sMonth == 4) { return 'Avril'; } else if ($sMonth == '05' || $sMonth == 5) { return 'Mai'; } else if ($sMonth == '06' || $sMonth == 6) { return 'Juin'; } else if ($sMonth == '07' || $sMonth == 7) { return 'Juillet'; } else if ($sMonth == '08' || $sMonth == 8) { return 'Août'; } else if ($sMonth == '09' || $sMonth == 9) { return 'Septembre'; } else if ($sMonth == 10) { return 'Octobre'; } else if ($sMonth == 11) { return 'Novembre'; } else if ($sMonth == 12) { return 'Décembre'; } |
|
91 | 80 | } |
92 | 81 | } |
93 | 82 | |
@@ -103,13 +92,7 @@ discard block |
||
103 | 92 | { |
104 | 93 | if ($sLanguage == 'fr') { |
105 | 94 | |
106 | - if ($sDay == 0) { return 'dimanche'; } |
|
107 | - else if ($sDay == 1) { return 'lundi'; } |
|
108 | - else if ($sDay == 2) { return 'mardi'; } |
|
109 | - else if ($sDay == 3) { return 'mercredi'; } |
|
110 | - else if ($sDay == 4) { return 'jeudi'; } |
|
111 | - else if ($sDay == 5) { return 'vendredi'; } |
|
112 | - else if ($sDay == 6) { return 'samedi'; } |
|
95 | + if ($sDay == 0) { return 'dimanche'; } else if ($sDay == 1) { return 'lundi'; } else if ($sDay == 2) { return 'mardi'; } else if ($sDay == 3) { return 'mercredi'; } else if ($sDay == 4) { return 'jeudi'; } else if ($sDay == 5) { return 'vendredi'; } else if ($sDay == 6) { return 'samedi'; } |
|
113 | 96 | } |
114 | 97 | } |
115 | 98 | |
@@ -136,8 +119,7 @@ discard block |
||
136 | 119 | if ($iMonth == $aToday['mois']) { |
137 | 120 | |
138 | 121 | if ($iDay > $aToday['jour']) { $iYears--; } |
139 | - } |
|
140 | - else { |
|
122 | + } else { |
|
141 | 123 | |
142 | 124 | $iYears--; |
143 | 125 | } |
@@ -158,18 +140,15 @@ discard block |
||
158 | 140 | { |
159 | 141 | $iFirstDayInYear = date("N",mktime(0, 0, 0, 1, 1, $iYear)); |
160 | 142 | |
161 | - if ($iFirstDayInYear < 5) { $iShift = -($iFirstDayInYear - 1) * 86400; } |
|
162 | - else { $iShift = (8 - $iFirstDayInYear) * 86400; } |
|
143 | + if ($iFirstDayInYear < 5) { $iShift = -($iFirstDayInYear - 1) * 86400; } else { $iShift = (8 - $iFirstDayInYear) * 86400; } |
|
163 | 144 | |
164 | - if ($iWeek > 1) { $iWeekInSeconds = ($iWeek-1) * 604800; } |
|
165 | - else { $iWeekInSeconds = 0; } |
|
145 | + if ($iWeek > 1) { $iWeekInSeconds = ($iWeek-1) * 604800; } else { $iWeekInSeconds = 0; } |
|
166 | 146 | |
167 | 147 | if (date('N') > 2) { |
168 | 148 | |
169 | 149 | $iTimestamp = mktime(0, 0, 0, 1, 1, $iYear) + $iWeekInSeconds + $iShift + 172800; |
170 | 150 | $iTimestampLastDay = $iTimestamp + 604800; |
171 | - } |
|
172 | - else { |
|
151 | + } else { |
|
173 | 152 | |
174 | 153 | $iTimestamp = mktime(0, 0, 0, 1, 1, $iYear) + $iWeekInSeconds + $iShift - 432000; |
175 | 154 | $iTimestampLastDay = $iTimestamp + 604800; |
@@ -224,7 +203,6 @@ discard block |
||
224 | 203 | if ($iTimeStamp < 3600) { return $sStartReturn.' '.(int)($iTimeStamp/60).' '.$sMinutes.$sEndReturn; } |
225 | 204 | if ($iTimeStamp < 86400) { return $sStartReturn.' '.(int)($iTimeStamp/3600).' '.$sHours.$sEndReturn; } |
226 | 205 | if ($iTimeStamp < 2592000) { return $sStartReturn.' '.(int)($iTimeStamp/86400).' '.$sDays.$sEndReturn; } |
227 | - if ($iTimeStamp < 31536000) { return $sStartReturn.' '.(int)($iTimeStamp/2592000).' '.$sMonths.$sEndReturn; } |
|
228 | - else { return $sStartReturn.' '.(int)($iTimeStamp/31536000).' '.$sYears.$sEndReturn; } |
|
206 | + if ($iTimeStamp < 31536000) { return $sStartReturn.' '.(int)($iTimeStamp/2592000).' '.$sMonths.$sEndReturn; } else { return $sStartReturn.' '.(int)($iTimeStamp/31536000).' '.$sYears.$sEndReturn; } |
|
229 | 207 | } |
230 | 208 | } |