@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | */ |
| 112 | 112 | public function __construct(DatabaseConnection $connection = null) { |
| 113 | 113 | parent::__construct(); |
| 114 | - if ($connection !== null) { |
|
| 114 | + if ($connection !== null) { |
|
| 115 | 115 | $this->connection = $connection; |
| 116 | 116 | } |
| 117 | 117 | } |
@@ -385,9 +385,9 @@ discard block |
||
| 385 | 385 | $this->queryCount++; |
| 386 | 386 | |
| 387 | 387 | $queryResult = $this->queryRunner->setQuery($query) |
| 388 | - ->setReturnType($returnAsList) |
|
| 389 | - ->setReturnAsArray($returnAsArray) |
|
| 390 | - ->execute(); |
|
| 388 | + ->setReturnType($returnAsList) |
|
| 389 | + ->setReturnAsArray($returnAsArray) |
|
| 390 | + ->execute(); |
|
| 391 | 391 | |
| 392 | 392 | if (is_object($queryResult)) { |
| 393 | 393 | $this->result = $queryResult->getResult(); |
@@ -190,7 +190,7 @@ discard block |
||
| 190 | 190 | $this->logger->info('Cannot find view [' . $view . '] in module [' . $module . '] ' |
| 191 | 191 | . 'using the default location'); |
| 192 | 192 | } |
| 193 | - if (!$path) { |
|
| 193 | + if (!$path) { |
|
| 194 | 194 | $path = $this->getDefaultFilePathForView($viewFile); |
| 195 | 195 | } |
| 196 | 196 | $this->logger->info('The view file path to be loaded is [' . $path . ']'); |
@@ -266,12 +266,12 @@ discard block |
||
| 266 | 266 | return $this->finalPageContent; |
| 267 | 267 | } |
| 268 | 268 | |
| 269 | - /** |
|
| 270 | - * Set the final page to be rendered |
|
| 271 | - * @param string $finalPage the content of the final page |
|
| 272 | - * |
|
| 273 | - * @return object |
|
| 274 | - */ |
|
| 269 | + /** |
|
| 270 | + * Set the final page to be rendered |
|
| 271 | + * @param string $finalPage the content of the final page |
|
| 272 | + * |
|
| 273 | + * @return object |
|
| 274 | + */ |
|
| 275 | 275 | public function setFinalPageContent($finalPage) { |
| 276 | 276 | $this->finalPageContent = $finalPage; |
| 277 | 277 | return $this; |
@@ -345,11 +345,11 @@ discard block |
||
| 345 | 345 | } |
| 346 | 346 | |
| 347 | 347 | /** |
| 348 | - * Dispatch the FINAL_VIEW_READY event |
|
| 349 | - * |
|
| 350 | - * @return string|null the final view content after processing by each listener |
|
| 351 | - * if they exists otherwise the same content will be returned |
|
| 352 | - */ |
|
| 348 | + * Dispatch the FINAL_VIEW_READY event |
|
| 349 | + * |
|
| 350 | + * @return string|null the final view content after processing by each listener |
|
| 351 | + * if they exists otherwise the same content will be returned |
|
| 352 | + */ |
|
| 353 | 353 | protected function dispatchFinalViewEvent() { |
| 354 | 354 | //dispatch |
| 355 | 355 | $event = get_instance()->eventdispatcher->dispatch( |
@@ -383,12 +383,12 @@ discard block |
||
| 383 | 383 | } |
| 384 | 384 | |
| 385 | 385 | |
| 386 | - /** |
|
| 387 | - * Return the default full file path for view |
|
| 388 | - * @param string $file the filename |
|
| 389 | - * |
|
| 390 | - * @return string|null the full file path |
|
| 391 | - */ |
|
| 386 | + /** |
|
| 387 | + * Return the default full file path for view |
|
| 388 | + * @param string $file the filename |
|
| 389 | + * |
|
| 390 | + * @return string|null the full file path |
|
| 391 | + */ |
|
| 392 | 392 | protected function getDefaultFilePathForView($file){ |
| 393 | 393 | $searchDir = array(APPS_VIEWS_PATH, CORE_VIEWS_PATH); |
| 394 | 394 | $fullFilePath = null; |
@@ -421,7 +421,7 @@ discard block |
||
| 421 | 421 | $headerModifiedSince = $globals->server('HTTP_IF_MODIFIED_SINCE'); |
| 422 | 422 | if (!empty($headerModifiedSince) && $lastModified <= strtotime($headerModifiedSince)) { |
| 423 | 423 | $this->logger->info('The cache page content is not yet expire for the ' |
| 424 | - . 'URL [' . $this->currentUrl . '] send 304 header to browser'); |
|
| 424 | + . 'URL [' . $this->currentUrl . '] send 304 header to browser'); |
|
| 425 | 425 | $this->sendHeaders(304); |
| 426 | 426 | return true; |
| 427 | 427 | } |
@@ -436,8 +436,8 @@ discard block |
||
| 436 | 436 | */ |
| 437 | 437 | protected function sendCachePageContentToBrowser(&$cache) { |
| 438 | 438 | $this->logger->info('The cache page content is expired or the browser does ' |
| 439 | - . 'not send the HTTP_IF_MODIFIED_SINCE header for the URL [' . $this->currentUrl . '] ' |
|
| 440 | - . 'send cache headers to tell the browser'); |
|
| 439 | + . 'not send the HTTP_IF_MODIFIED_SINCE header for the URL [' . $this->currentUrl . '] ' |
|
| 440 | + . 'send cache headers to tell the browser'); |
|
| 441 | 441 | $this->sendHeaders(200); |
| 442 | 442 | //current page cache key |
| 443 | 443 | $pageCacheKey = $this->currentUrlCacheKey; |
@@ -576,18 +576,18 @@ discard block |
||
| 576 | 576 | } |
| 577 | 577 | } |
| 578 | 578 | |
| 579 | - /** |
|
| 580 | - * Set the mandory headers, like security, etc. |
|
| 581 | - */ |
|
| 579 | + /** |
|
| 580 | + * Set the mandory headers, like security, etc. |
|
| 581 | + */ |
|
| 582 | 582 | protected function setRequiredHeaders() { |
| 583 | 583 | $requiredHeaders = array( |
| 584 | 584 | 'X-XSS-Protection' => '1; mode=block', |
| 585 | 585 | 'X-Frame-Options' => 'SAMEORIGIN' |
| 586 | 586 | ); |
| 587 | 587 | foreach ($requiredHeaders as $key => $value) { |
| 588 | - if (!isset($this->headers[$key])) { |
|
| 588 | + if (!isset($this->headers[$key])) { |
|
| 589 | 589 | $this->headers[$key] = $value; |
| 590 | - } |
|
| 590 | + } |
|
| 591 | 591 | } |
| 592 | 592 | } |
| 593 | 593 | } |
@@ -249,7 +249,7 @@ discard block |
||
| 249 | 249 | $cacheInfo = $cache->getInfo($pageCacheKey); |
| 250 | 250 | if ($cacheInfo) { |
| 251 | 251 | $status = $this->sendCacheNotYetExpireInfoToBrowser($cacheInfo); |
| 252 | - if($status === false) { |
|
| 252 | + if ($status === false) { |
|
| 253 | 253 | return $this->sendCachePageContentToBrowser($cache); |
| 254 | 254 | } |
| 255 | 255 | return true; |
@@ -323,7 +323,7 @@ discard block |
||
| 323 | 323 | */ |
| 324 | 324 | public function sendError(array $data = array()) { |
| 325 | 325 | $path = CORE_VIEWS_PATH . 'errors.php'; |
| 326 | - if(file_exists($path)){ |
|
| 326 | + if (file_exists($path)) { |
|
| 327 | 327 | //compress the output if is available |
| 328 | 328 | $compressOutputHandler = $this->getCompressOutputHandler(); |
| 329 | 329 | ob_start($compressOutputHandler); |
@@ -335,7 +335,7 @@ discard block |
||
| 335 | 335 | echo $content; |
| 336 | 336 | } |
| 337 | 337 | //@codeCoverageIgnoreStart |
| 338 | - else{ |
|
| 338 | + else { |
|
| 339 | 339 | //can't use show_error() at this time because |
| 340 | 340 | //some dependencies not yet loaded |
| 341 | 341 | set_http_status_header(503); |
@@ -389,7 +389,7 @@ discard block |
||
| 389 | 389 | * |
| 390 | 390 | * @return string|null the full file path |
| 391 | 391 | */ |
| 392 | - protected function getDefaultFilePathForView($file){ |
|
| 392 | + protected function getDefaultFilePathForView($file) { |
|
| 393 | 393 | $searchDir = array(APPS_VIEWS_PATH, CORE_VIEWS_PATH); |
| 394 | 394 | $fullFilePath = null; |
| 395 | 395 | foreach ($searchDir as $dir) { |