@@ -131,14 +131,12 @@ discard block |
||
| 131 | 131 | |
| 132 | 132 | echo file_get_contents(__DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'src'.DIRECTORY_SEPARATOR.'plugins'.DIRECTORY_SEPARATOR.$sPlugin.DIRECTORY_SEPARATOR.'public'.$_SERVER['REQUEST_URI']); |
| 133 | 133 | exit; |
| 134 | - } |
|
| 135 | - else if (strstr($_SERVER['REQUEST_URI'], '.css') |
|
| 134 | + } else if (strstr($_SERVER['REQUEST_URI'], '.css') |
|
| 136 | 135 | && file_exists(__DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'src'.DIRECTORY_SEPARATOR.'plugins'.DIRECTORY_SEPARATOR.$sPlugin.DIRECTORY_SEPARATOR.'public'.preg_replace('/\.css/', '.less', $_SERVER['REQUEST_URI']))) { |
| 137 | 136 | |
| 138 | 137 | Less::toCss(__DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'src'.DIRECTORY_SEPARATOR.'plugins'.DIRECTORY_SEPARATOR.$sPlugin.DIRECTORY_SEPARATOR.'public'.preg_replace('/\.css/', '.less', $_SERVER['REQUEST_URI'])); |
| 139 | 138 | exit; |
| 140 | - } |
|
| 141 | - else if (strstr($_SERVER['REQUEST_URI'], '.js') |
|
| 139 | + } else if (strstr($_SERVER['REQUEST_URI'], '.js') |
|
| 142 | 140 | && file_exists(__DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'src'.DIRECTORY_SEPARATOR.'plugins'.DIRECTORY_SEPARATOR.$sPlugin.DIRECTORY_SEPARATOR.'public'.preg_replace('/\.js/', '.ts', $_SERVER['REQUEST_URI']))) { |
| 143 | 141 | |
| 144 | 142 | Typescript::toJs(__DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'src'.DIRECTORY_SEPARATOR.'plugins'.DIRECTORY_SEPARATOR.$sPlugin.DIRECTORY_SEPARATOR.'public'.preg_replace('/\.js/', '.ts', $_SERVER['REQUEST_URI'])); |
@@ -167,8 +165,7 @@ discard block |
||
| 167 | 165 | header('Status: 301 Moved Permanently', false, 301); |
| 168 | 166 | header('Location: '.$oHost->location); |
| 169 | 167 | exit; |
| 170 | - } |
|
| 171 | - else if (preg_match('#getCss\?#', $_SERVER['REQUEST_URI'])) { |
|
| 168 | + } else if (preg_match('#getCss\?#', $_SERVER['REQUEST_URI'])) { |
|
| 172 | 169 | |
| 173 | 170 | foreach ($_GET as $sKey => $sValue) { |
| 174 | 171 | |
@@ -179,8 +176,7 @@ discard block |
||
| 179 | 176 | } |
| 180 | 177 | |
| 181 | 178 | exit; |
| 182 | - } |
|
| 183 | - else if (preg_match('#getJs\?#', $_SERVER['REQUEST_URI'])) { |
|
| 179 | + } else if (preg_match('#getJs\?#', $_SERVER['REQUEST_URI'])) { |
|
| 184 | 180 | |
| 185 | 181 | foreach ($_GET as $sKey => $sValue) { |
| 186 | 182 | |
@@ -191,8 +187,7 @@ discard block |
||
| 191 | 187 | } |
| 192 | 188 | |
| 193 | 189 | exit; |
| 194 | - } |
|
| 195 | - else if (isset($oHost->routes)) { |
|
| 190 | + } else if (isset($oHost->routes)) { |
|
| 196 | 191 | |
| 197 | 192 | foreach($oHost->routes as $sKey => $oRoute) { |
| 198 | 193 | |
@@ -201,8 +196,7 @@ discard block |
||
| 201 | 196 | if ($mReturn === 403) { |
| 202 | 197 | |
| 203 | 198 | $this->_getPage403(); |
| 204 | - } |
|
| 205 | - else if ($mReturn === true) { |
|
| 199 | + } else if ($mReturn === true) { |
|
| 206 | 200 | |
| 207 | 201 | if (isset($oRoute->cache)) { $this->_checkCache($oRoute->cache); } |
| 208 | 202 | |
@@ -215,11 +209,9 @@ discard block |
||
| 215 | 209 | } |
| 216 | 210 | } |
| 217 | 211 | } |
| 218 | - } |
|
| 219 | - else if (Request::isCliRequest()) { |
|
| 212 | + } else if (Request::isCliRequest()) { |
|
| 220 | 213 | |
| 221 | - if (isset($_SERVER['argv'])) { $aArguments = $_SERVER['argv']; } |
|
| 222 | - else { $aArguments = $argv; } |
|
| 214 | + if (isset($_SERVER['argv'])) { $aArguments = $_SERVER['argv']; } else { $aArguments = $argv; } |
|
| 223 | 215 | |
| 224 | 216 | define('PORTAL', 'Batch'); |
| 225 | 217 | set_include_path(get_include_path().PATH_SEPARATOR.'src'.PATH_SEPARATOR.PORTAL.PATH_SEPARATOR.'public'); |
@@ -229,8 +221,7 @@ discard block |
||
| 229 | 221 | $sBatchName = "phpunit"; |
| 230 | 222 | $aArguments[0] = "bin/console"; |
| 231 | 223 | $aArguments[1] = "phpunit"; |
| 232 | - } |
|
| 233 | - else { |
|
| 224 | + } else { |
|
| 234 | 225 | $sBatchName = $aArguments[1]; |
| 235 | 226 | } |
| 236 | 227 | |
@@ -279,8 +270,7 @@ discard block |
||
| 279 | 270 | if (isset($oBatch->controller) && isset($oBatch->action)) { |
| 280 | 271 | |
| 281 | 272 | echo $this->_loadController($oBatch->controller, $oBatch->action, array($aOptions)); |
| 282 | - } |
|
| 283 | - else { |
|
| 273 | + } else { |
|
| 284 | 274 | |
| 285 | 275 | if (Request::isCliRequest()) { |
| 286 | 276 | |
@@ -323,8 +313,7 @@ discard block |
||
| 323 | 313 | } |
| 324 | 314 | } |
| 325 | 315 | } |
| 326 | - } |
|
| 327 | - else if (defined('STDIN')) { |
|
| 316 | + } else if (defined('STDIN')) { |
|
| 328 | 317 | |
| 329 | 318 | $oBatch = Config::get('Route')->batch->script->{$sRoute}; |
| 330 | 319 | echo $this->_loadController($oBatch->controller, $oBatch->action, $aParams); |
@@ -386,8 +375,7 @@ discard block |
||
| 386 | 375 | }, |
| 387 | 376 | $sRoute |
| 388 | 377 | ); |
| 389 | - } |
|
| 390 | - else { |
|
| 378 | + } else { |
|
| 391 | 379 | |
| 392 | 380 | $sFinalRoute = '.*'; |
| 393 | 381 | } |
@@ -437,8 +425,7 @@ discard block |
||
| 437 | 425 | |
| 438 | 426 | $oMobileDetect = new \Mobile_Detect; |
| 439 | 427 | |
| 440 | - if ($oMobileDetect->isMobile()) { $sCacheExt = '.mobi'; } |
|
| 441 | - else { $sCacheExt = ''; } |
|
| 428 | + if ($oMobileDetect->isMobile()) { $sCacheExt = '.mobi'; } else { $sCacheExt = ''; } |
|
| 442 | 429 | |
| 443 | 430 | $mCacheReturn = Cache::get($RequestUri.$sCacheExt, $oRoute->cache->max_age); |
| 444 | 431 | |
@@ -461,17 +448,14 @@ discard block |
||
| 461 | 448 | if ($oRoute->content_type == 'json') { |
| 462 | 449 | |
| 463 | 450 | header('Content-type: application/json; charset='.$sCharset.''); |
| 464 | - } |
|
| 465 | - else if ($oRoute->content_type == 'html') { |
|
| 451 | + } else if ($oRoute->content_type == 'html') { |
|
| 466 | 452 | |
| 467 | 453 | header('Content-type: text/html; charset='.$sCharset.''); |
| 468 | - } |
|
| 469 | - else if ($oRoute->content_type == 'jpeg') { |
|
| 454 | + } else if ($oRoute->content_type == 'jpeg') { |
|
| 470 | 455 | |
| 471 | 456 | header('Content-type: image/jpeg'); |
| 472 | 457 | } |
| 473 | - } |
|
| 474 | - else { |
|
| 458 | + } else { |
|
| 475 | 459 | |
| 476 | 460 | header('Content-type: text/html; charset='.$sCharset.''); |
| 477 | 461 | } |
@@ -492,21 +476,17 @@ discard block |
||
| 492 | 476 | if (isset($_GET[$sName]) && $_GET[$sName] != '') { |
| 493 | 477 | |
| 494 | 478 | $aEntries[] = $_GET[$sName]; |
| 495 | - } |
|
| 496 | - else if (isset($oRoute->defaults_constraints) && is_object($oRoute->defaults_constraints) |
|
| 479 | + } else if (isset($oRoute->defaults_constraints) && is_object($oRoute->defaults_constraints) |
|
| 497 | 480 | && isset($oRoute->defaults_constraints->{$sName})) { |
| 498 | 481 | |
| 499 | 482 | $aEntries[] = $oRoute->defaults_constraints->{$sName}; |
| 500 | - } |
|
| 501 | - else if (isset($_GET[$sName])) { |
|
| 483 | + } else if (isset($_GET[$sName])) { |
|
| 502 | 484 | |
| 503 | 485 | $aEntries[] = $_GET[$sName]; |
| 504 | - } |
|
| 505 | - else if (preg_match('/'.$sType.'/', '')) { |
|
| 486 | + } else if (preg_match('/'.$sType.'/', '')) { |
|
| 506 | 487 | |
| 507 | 488 | $aEntries[] = ''; |
| 508 | - } |
|
| 509 | - else { |
|
| 489 | + } else { |
|
| 510 | 490 | |
| 511 | 491 | $this->_oLogger->warning('Error: Parameter '.$sName.' not exists!'); |
| 512 | 492 | break; |
@@ -518,8 +498,7 @@ discard block |
||
| 518 | 498 | $mReturn = $this->_loadController($oController, $sActionName, $aEntries); |
| 519 | 499 | |
| 520 | 500 | } |
| 521 | - } |
|
| 522 | - else { |
|
| 501 | + } else { |
|
| 523 | 502 | |
| 524 | 503 | $mReturn = $this->_loadController($oController, $sActionName, $aEntries); |
| 525 | 504 | } |
@@ -531,8 +510,7 @@ discard block |
||
| 531 | 510 | $mReturn = json_encode($mReturn, JSON_PRETTY_PRINT); |
| 532 | 511 | } |
| 533 | 512 | } |
| 534 | - } |
|
| 535 | - else if (isset($oRoute->template) && isset($oRoute->layout) && $oRoute->layout === true) { |
|
| 513 | + } else if (isset($oRoute->template) && isset($oRoute->layout) && $oRoute->layout === true) { |
|
| 536 | 514 | |
| 537 | 515 | define('PORTAL', preg_replace('/^\\\\Venus\\\\src\\\\([a-zA-Z0-9_]+)\\\\.+$/', '$1', $oRoute->template)); |
| 538 | 516 | set_include_path(get_include_path().PATH_SEPARATOR.'src'.PATH_SEPARATOR.PORTAL.PATH_SEPARATOR.'public'); |
@@ -549,8 +527,7 @@ discard block |
||
| 549 | 527 | |
| 550 | 528 | $mReturn = $oLayout->assign('model', DIRECTORY_SEPARATOR.'src'.DIRECTORY_SEPARATOR.PORTAL.DIRECTORY_SEPARATOR.'View'.DIRECTORY_SEPARATOR.$oRoute->template.'.tpl') |
| 551 | 529 | ->fetch(); |
| 552 | - } |
|
| 553 | - else if (isset($oRoute->template)) { |
|
| 530 | + } else if (isset($oRoute->template)) { |
|
| 554 | 531 | |
| 555 | 532 | define('PORTAL', preg_replace('/^\\\\Venus\\\\src\\\\([a-zA-Z0-9_]+)\\\\.+$/', '$1', $oRoute->template)); |
| 556 | 533 | set_include_path(get_include_path().PATH_SEPARATOR.'src'.PATH_SEPARATOR.PORTAL.PATH_SEPARATOR.'public'); |
@@ -574,8 +551,7 @@ discard block |
||
| 574 | 551 | |
| 575 | 552 | $oMobileDetect = new \Mobile_Detect; |
| 576 | 553 | |
| 577 | - if ($oMobileDetect->isMobile()) { $sCacheExt = '.mobi'; } |
|
| 578 | - else { $sCacheExt = ''; } |
|
| 554 | + if ($oMobileDetect->isMobile()) { $sCacheExt = '.mobi'; } else { $sCacheExt = ''; } |
|
| 579 | 555 | |
| 580 | 556 | if (defined('COMPRESS_HTML') && COMPRESS_HTML) { |
| 581 | 557 | |
@@ -629,8 +605,7 @@ discard block |
||
| 629 | 605 | |
| 630 | 606 | $oMobileDetect = new \Mobile_Detect; |
| 631 | 607 | |
| 632 | - if ($oMobileDetect->isMobile()) { $sCacheExt = '.mobi'; } |
|
| 633 | - else { $sCacheExt = ''; } |
|
| 608 | + if ($oMobileDetect->isMobile()) { $sCacheExt = '.mobi'; } else { $sCacheExt = ''; } |
|
| 634 | 609 | |
| 635 | 610 | $mCacheReturn = Cache::get($sActionName.$sCacheExt, $aPhpDoc['Cache']['maxage']); |
| 636 | 611 | |
@@ -671,8 +646,7 @@ discard block |
||
| 671 | 646 | |
| 672 | 647 | $oMobileDetect = new \Mobile_Detect; |
| 673 | 648 | |
| 674 | - if ($oMobileDetect->isMobile()) { $sCacheExt = '.mobi'; } |
|
| 675 | - else { $sCacheExt = ''; } |
|
| 649 | + if ($oMobileDetect->isMobile()) { $sCacheExt = '.mobi'; } else { $sCacheExt = ''; } |
|
| 676 | 650 | |
| 677 | 651 | if (defined('COMPRESS_HTML') && COMPRESS_HTML) { |
| 678 | 652 | |
@@ -85,8 +85,7 @@ discard block |
||
| 85 | 85 | if (file_exists($this->_sFolder.$this->_getSubDirectory($sName).md5($sName).'.fil.cac')) { |
| 86 | 86 | |
| 87 | 87 | return unserialize(file_get_contents($this->_sFolder.$this->_getSubDirectory($sName).md5($sName).'.fil.cac')); |
| 88 | - } |
|
| 89 | - else { |
|
| 88 | + } else { |
|
| 90 | 89 | |
| 91 | 90 | return false; |
| 92 | 91 | } |
@@ -146,8 +145,7 @@ discard block |
||
| 146 | 145 | |
| 147 | 146 | while (($sFile = readdir($rDirectory)) !== false) { |
| 148 | 147 | |
| 149 | - if ($sFile > '0' && filetype($sName.$sFile) == "file") { unlink($sName.$sFile); } |
|
| 150 | - elseif ($sFile > '0' && filetype($sName.$sFile) == "dir") { remove_dir($sName.$sFile."\\"); } |
|
| 148 | + if ($sFile > '0' && filetype($sName.$sFile) == "file") { unlink($sName.$sFile); } elseif ($sFile > '0' && filetype($sName.$sFile) == "dir") { remove_dir($sName.$sFile."\\"); } |
|
| 151 | 149 | } |
| 152 | 150 | |
| 153 | 151 | closedir($rDirectory); |
@@ -19,8 +19,7 @@ |
||
| 19 | 19 | { |
| 20 | 20 | if (isset($_FILES[$name]) && $_FILES[$name] != '') { |
| 21 | 21 | return $_FILES[$name]; |
| 22 | - } |
|
| 23 | - else if ($default !== null) { |
|
| 22 | + } else if ($default !== null) { |
|
| 24 | 23 | return $default; |
| 25 | 24 | } |
| 26 | 25 | } |
@@ -19,8 +19,7 @@ |
||
| 19 | 19 | { |
| 20 | 20 | if (isset($_SERVER[$name]) && $_SERVER[$name] != '') { |
| 21 | 21 | return $_SERVER[$name]; |
| 22 | - } |
|
| 23 | - else if ($default !== null) { |
|
| 22 | + } else if ($default !== null) { |
|
| 24 | 23 | return $default; |
| 25 | 24 | } |
| 26 | 25 | } |
@@ -19,8 +19,7 @@ |
||
| 19 | 19 | { |
| 20 | 20 | if (isset($_POST[$name]) && $_POST[$name] != '') { |
| 21 | 21 | return $_POST[$name]; |
| 22 | - } |
|
| 23 | - else if ($default !== null) { |
|
| 22 | + } else if ($default !== null) { |
|
| 24 | 23 | return $default; |
| 25 | 24 | } |
| 26 | 25 | } |
@@ -19,8 +19,7 @@ |
||
| 19 | 19 | { |
| 20 | 20 | if (isset($_GET[$name]) && $_GET[$name] != '') { |
| 21 | 21 | return $_GET[$name]; |
| 22 | - } |
|
| 23 | - else if ($default !== null) { |
|
| 22 | + } else if ($default !== null) { |
|
| 24 | 23 | return $default; |
| 25 | 24 | } |
| 26 | 25 | } |
@@ -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 | } |
@@ -19,8 +19,7 @@ discard block |
||
| 19 | 19 | { |
| 20 | 20 | if (isset(apache_request_headers()[$name]) && apache_request_headers()[$name] != '') { |
| 21 | 21 | return apache_request_headers()[$name]; |
| 22 | - } |
|
| 23 | - else if ($default !== null) { |
|
| 22 | + } else if ($default !== null) { |
|
| 24 | 23 | return $default; |
| 25 | 24 | } |
| 26 | 25 | } |
@@ -35,8 +34,7 @@ discard block |
||
| 35 | 34 | { |
| 36 | 35 | if ($value !== null) { |
| 37 | 36 | header($name . ': ' . $value); |
| 38 | - } |
|
| 39 | - else { |
|
| 37 | + } else { |
|
| 40 | 38 | header($name); |
| 41 | 39 | } |
| 42 | 40 | |