@@ -152,8 +152,7 @@ discard block |
||
| 152 | 152 | if(! headers_sent()){ |
| 153 | 153 | header('Location: '.$url); |
| 154 | 154 | exit; |
| 155 | - } |
|
| 156 | - else{ |
|
| 155 | + } else{ |
|
| 157 | 156 | echo '<script> |
| 158 | 157 | location.href = "'.$url.'"; |
| 159 | 158 | </script>'; |
@@ -202,12 +201,10 @@ discard block |
||
| 202 | 201 | if($moduleViewPath){ |
| 203 | 202 | $path = $moduleViewPath; |
| 204 | 203 | $logger->info('Found view [' . $view . '] in module [' .$mod. '], the file path is [' .$moduleViewPath. '] we will used it'); |
| 205 | - } |
|
| 206 | - else{ |
|
| 204 | + } else{ |
|
| 207 | 205 | $logger->info('Cannot find view [' . $view . '] in module [' .$mod. '] using the default location'); |
| 208 | 206 | } |
| 209 | - } |
|
| 210 | - else{ |
|
| 207 | + } else{ |
|
| 211 | 208 | $logger->info('The current request does not use module using the default location.'); |
| 212 | 209 | } |
| 213 | 210 | } |
@@ -326,8 +323,7 @@ discard block |
||
| 326 | 323 | $logger->info('The cache page content is not yet expire for the URL [' . $url . '] send 304 header to browser'); |
| 327 | 324 | self::sendHeaders(304); |
| 328 | 325 | return; |
| 329 | - } |
|
| 330 | - else{ |
|
| 326 | + } else{ |
|
| 331 | 327 | $logger->info('The cache page content is expired or the browser don\'t send the HTTP_IF_MODIFIED_SINCE header for the URL [' . $url . '] send cache headers to tell the browser'); |
| 332 | 328 | self::sendHeaders(200); |
| 333 | 329 | //get the cache content |
@@ -347,15 +343,13 @@ discard block |
||
| 347 | 343 | //compress the output if is available |
| 348 | 344 | if (self::$_canCompressOutput){ |
| 349 | 345 | ob_start('ob_gzhandler'); |
| 350 | - } |
|
| 351 | - else{ |
|
| 346 | + } else{ |
|
| 352 | 347 | ob_start(); |
| 353 | 348 | } |
| 354 | 349 | echo $content; |
| 355 | 350 | ob_end_flush(); |
| 356 | 351 | return; |
| 357 | - } |
|
| 358 | - else{ |
|
| 352 | + } else{ |
|
| 359 | 353 | $logger->info('The page cache content for the URL [' . $url . '] is not valid may be already expired'); |
| 360 | 354 | $cache->delete($pageCacheKey); |
| 361 | 355 | } |
@@ -396,16 +390,14 @@ discard block |
||
| 396 | 390 | //compress the output if is available |
| 397 | 391 | if (self::$_canCompressOutput){ |
| 398 | 392 | ob_start('ob_gzhandler'); |
| 399 | - } |
|
| 400 | - else{ |
|
| 393 | + } else{ |
|
| 401 | 394 | ob_start(); |
| 402 | 395 | } |
| 403 | 396 | require_once $path; |
| 404 | 397 | $output = ob_get_clean(); |
| 405 | 398 | self::sendHeaders(404); |
| 406 | 399 | echo $output; |
| 407 | - } |
|
| 408 | - else{ |
|
| 400 | + } else{ |
|
| 409 | 401 | show_error('The 404 view [' .$path. '] does not exist'); |
| 410 | 402 | } |
| 411 | 403 | } |
@@ -420,8 +412,7 @@ discard block |
||
| 420 | 412 | //compress the output if exists |
| 421 | 413 | if (self::$_canCompressOutput){ |
| 422 | 414 | ob_start('ob_gzhandler'); |
| 423 | - } |
|
| 424 | - else{ |
|
| 415 | + } else{ |
|
| 425 | 416 | ob_start(); |
| 426 | 417 | } |
| 427 | 418 | extract($data); |
@@ -429,8 +420,7 @@ discard block |
||
| 429 | 420 | $output = ob_get_clean(); |
| 430 | 421 | self::sendHeaders(503); |
| 431 | 422 | echo $output; |
| 432 | - } |
|
| 433 | - else{ |
|
| 423 | + } else{ |
|
| 434 | 424 | //can't use show_error() at this time because some dependencies not yet loaded and to prevent loop |
| 435 | 425 | set_http_status_header(503); |
| 436 | 426 | echo 'The error view [' . $path . '] does not exist'; |
@@ -61,8 +61,7 @@ discard block |
||
| 61 | 61 | while(($module = readdir($moduleDir)) !== false){ |
| 62 | 62 | if(preg_match('/^([a-z0-9-_]+)$/i', $module) && is_dir(MODULE_PATH . $module)){ |
| 63 | 63 | self::$list[] = $module; |
| 64 | - } |
|
| 65 | - else{ |
|
| 64 | + } else{ |
|
| 66 | 65 | $logger->info('Skipping [' .$module. '], may be this is not a directory or does not exists or is invalid name'); |
| 67 | 66 | } |
| 68 | 67 | } |
@@ -152,8 +151,7 @@ discard block |
||
| 152 | 151 | if(file_exists($filePath)){ |
| 153 | 152 | $logger->info('Found controller [' . $class . '] in module [' .$module. '], the file path is [' .$filePath. ']'); |
| 154 | 153 | return $filePath; |
| 155 | - } |
|
| 156 | - else{ |
|
| 154 | + } else{ |
|
| 157 | 155 | $logger->info('Controller [' . $class . '] does not exist in the module [' .$module. ']'); |
| 158 | 156 | return false; |
| 159 | 157 | } |
@@ -179,8 +177,7 @@ discard block |
||
| 179 | 177 | if(file_exists($filePath)){ |
| 180 | 178 | $logger->info('Found model [' . $class . '] in module [' .$module. '], the file path is [' .$filePath. ']'); |
| 181 | 179 | return $filePath; |
| 182 | - } |
|
| 183 | - else{ |
|
| 180 | + } else{ |
|
| 184 | 181 | $logger->info('Model [' . $class . '] does not exist in the module [' .$module. ']'); |
| 185 | 182 | return false; |
| 186 | 183 | } |
@@ -205,8 +202,7 @@ discard block |
||
| 205 | 202 | if(file_exists($filePath)){ |
| 206 | 203 | $logger->info('Found configuration [' . $configuration . '] in module [' .$module. '], the file path is [' .$filePath. ']'); |
| 207 | 204 | return $filePath; |
| 208 | - } |
|
| 209 | - else{ |
|
| 205 | + } else{ |
|
| 210 | 206 | $logger->info('Configuration [' . $configuration . '] does not exist in the module [' .$module. ']'); |
| 211 | 207 | return false; |
| 212 | 208 | } |
@@ -232,8 +228,7 @@ discard block |
||
| 232 | 228 | if(file_exists($filePath)){ |
| 233 | 229 | $logger->info('Found helper [' . $helper . '] in module [' .$module. '], the file path is [' .$filePath. ']'); |
| 234 | 230 | return $filePath; |
| 235 | - } |
|
| 236 | - else{ |
|
| 231 | + } else{ |
|
| 237 | 232 | $logger->info('Helper [' . $helper . '] does not exist in the module [' .$module. ']'); |
| 238 | 233 | return false; |
| 239 | 234 | } |
@@ -259,8 +254,7 @@ discard block |
||
| 259 | 254 | if(file_exists($filePath)){ |
| 260 | 255 | $logger->info('Found library [' . $class . '] in module [' .$module. '], the file path is [' .$filePath. ']'); |
| 261 | 256 | return $filePath; |
| 262 | - } |
|
| 263 | - else{ |
|
| 257 | + } else{ |
|
| 264 | 258 | $logger->info('Library [' . $class . '] does not exist in the module [' .$module. ']'); |
| 265 | 259 | return false; |
| 266 | 260 | } |
@@ -288,8 +282,7 @@ discard block |
||
| 288 | 282 | if(file_exists($filePath)){ |
| 289 | 283 | $logger->info('Found view [' . $view . '] in module [' .$module. '], the file path is [' .$filePath. ']'); |
| 290 | 284 | return $filePath; |
| 291 | - } |
|
| 292 | - else{ |
|
| 285 | + } else{ |
|
| 293 | 286 | $logger->info('View [' . $view . '] does not exist in the module [' .$module. ']'); |
| 294 | 287 | return false; |
| 295 | 288 | } |
@@ -316,8 +309,7 @@ discard block |
||
| 316 | 309 | if(file_exists($filePath)){ |
| 317 | 310 | $logger->info('Found language [' . $language . '] in module [' .$module. '], the file path is [' .$filePath. ']'); |
| 318 | 311 | return $filePath; |
| 319 | - } |
|
| 320 | - else{ |
|
| 312 | + } else{ |
|
| 321 | 313 | $logger->info('Language [' . $language . '] does not exist in the module [' .$module. ']'); |
| 322 | 314 | return false; |
| 323 | 315 | } |
@@ -477,8 +477,7 @@ discard block |
||
| 477 | 477 | if (mkdir($destination_directory, 0775, true)) { |
| 478 | 478 | $this->destination_directory = $destination_directory; |
| 479 | 479 | chdir($destination_directory); |
| 480 | - } |
|
| 481 | - else{ |
|
| 480 | + } else{ |
|
| 482 | 481 | $this->logger->warning('Can not create the upload directory [' .$destination_directory. ']'); |
| 483 | 482 | } |
| 484 | 483 | } |
@@ -630,8 +629,7 @@ discard block |
||
| 630 | 629 | // set original filename if not have a new name |
| 631 | 630 | if (empty($this->filename)) { |
| 632 | 631 | $this->filename = $this->file_array[$this->input]['name']; |
| 633 | - } |
|
| 634 | - else{ |
|
| 632 | + } else{ |
|
| 635 | 633 | // Replace %s for extension in filename |
| 636 | 634 | // Before: /[\w\d]*(.[\d\w]+)$/i |
| 637 | 635 | // After: /^[\s[:alnum:]\-\_\.]*\.([\d\w]+)$/iu |