@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | /** |
34 | 34 | * Construct new ApcCache instance |
35 | 35 | */ |
36 | - public function __construct() { |
|
36 | + public function __construct() { |
|
37 | 37 | parent::__construct(); |
38 | 38 | if (!$this->isSupported()) { |
39 | 39 | show_error('The cache for APC[u] driver is not available. Check if APC[u] extension is loaded and enabled.'); |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | public function set($key, $data, $ttl = 0) { |
80 | 80 | $expire = time() + $ttl; |
81 | 81 | $this->logger->debug('Setting cache data for key [' . $key . '], time to live [' . $ttl . '], ' |
82 | - . 'expire at [' . date('Y-m-d H:i:s', $expire) . ']'); |
|
82 | + . 'expire at [' . date('Y-m-d H:i:s', $expire) . ']'); |
|
83 | 83 | $result = apc_store($key, $data, $ttl); |
84 | 84 | if ($result === false) { |
85 | 85 | $this->logger->error('Can not save cache data for the key [' . $key . '], return false'); |
@@ -58,8 +58,8 @@ discard block |
||
58 | 58 | */ |
59 | 59 | public function add($name) { |
60 | 60 | if (in_array($name, $this->list)) { |
61 | - $this->logger->info('The module [' .$name. '] already added skipping.'); |
|
62 | - return $this; |
|
61 | + $this->logger->info('The module [' .$name. '] already added skipping.'); |
|
62 | + return $this; |
|
63 | 63 | } |
64 | 64 | $this->list[] = $name; |
65 | 65 | return $this; |
@@ -90,10 +90,10 @@ discard block |
||
90 | 90 | $this->list = array(); |
91 | 91 | } |
92 | 92 | |
93 | - /** |
|
94 | - * Get the list of module loaded |
|
95 | - * @return array the module list |
|
96 | - */ |
|
93 | + /** |
|
94 | + * Get the list of module loaded |
|
95 | + * @return array the module list |
|
96 | + */ |
|
97 | 97 | public function getModuleList() { |
98 | 98 | return $this->list; |
99 | 99 | } |
@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | $this->logger->debug('Check if the application contains the modules ...'); |
233 | 233 | $dirList = glob(MODULE_PATH . '*', GLOB_ONLYDIR); |
234 | 234 | if ($dirList !== false) { |
235 | - $this->list = array_map('basename', $dirList); |
|
235 | + $this->list = array_map('basename', $dirList); |
|
236 | 236 | } |
237 | 237 | if (!empty($this->list)) { |
238 | 238 | $this->logger->info('The application contains the module below [' . implode(', ', $this->list) . ']'); |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | $moduleInfo = $this->getModuleInfoForView($view); |
182 | 182 | $module = $moduleInfo['module']; |
183 | 183 | $view = $moduleInfo['view']; |
184 | - if ($module) { |
|
184 | + if ($module) { |
|
185 | 185 | $moduleViewPath = get_instance()->module->findViewFullPath($view, $module); |
186 | 186 | if ($moduleViewPath) { |
187 | 187 | $path = $moduleViewPath; |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | $this->logger->info('Cannot find view [' . $view . '] in module [' . $module . '] using the default location'); |
191 | 191 | } |
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 . ']'); |
@@ -290,12 +290,12 @@ discard block |
||
290 | 290 | return $this->finalPageContent; |
291 | 291 | } |
292 | 292 | |
293 | - /** |
|
294 | - * Set the final page to be rendered |
|
295 | - * @param string $finalPage the content of the final page |
|
296 | - * |
|
297 | - * @return object |
|
298 | - */ |
|
293 | + /** |
|
294 | + * Set the final page to be rendered |
|
295 | + * @param string $finalPage the content of the final page |
|
296 | + * |
|
297 | + * @return object |
|
298 | + */ |
|
299 | 299 | public function setFinalPageContent($finalPage) { |
300 | 300 | $this->finalPageContent = $finalPage; |
301 | 301 | return $this; |
@@ -372,12 +372,12 @@ discard block |
||
372 | 372 | } |
373 | 373 | |
374 | 374 | |
375 | - /** |
|
376 | - * Return the default full file path for view |
|
377 | - * @param string $file the filename |
|
378 | - * |
|
379 | - * @return string|null the full file path |
|
380 | - */ |
|
375 | + /** |
|
376 | + * Return the default full file path for view |
|
377 | + * @param string $file the filename |
|
378 | + * |
|
379 | + * @return string|null the full file path |
|
380 | + */ |
|
381 | 381 | protected function getDefaultFilePathForView($file){ |
382 | 382 | $searchDir = array(APPS_VIEWS_PATH, CORE_VIEWS_PATH); |
383 | 383 | $fullFilePath = null; |
@@ -410,7 +410,7 @@ discard block |
||
410 | 410 | $headerModifiedSince = $globals->server('HTTP_IF_MODIFIED_SINCE'); |
411 | 411 | if (!empty($headerModifiedSince) && $lastModified <= strtotime($headerModifiedSince)) { |
412 | 412 | $this->logger->info('The cache page content is not yet expire for the ' |
413 | - . 'URL [' . $this->currentUrl . '] send 304 header to browser'); |
|
413 | + . 'URL [' . $this->currentUrl . '] send 304 header to browser'); |
|
414 | 414 | $this->sendHeaders(304); |
415 | 415 | return true; |
416 | 416 | } |
@@ -425,8 +425,8 @@ discard block |
||
425 | 425 | */ |
426 | 426 | protected function sendCachePageContentToBrowser(&$cache) { |
427 | 427 | $this->logger->info('The cache page content is expired or the browser does ' |
428 | - . 'not send the HTTP_IF_MODIFIED_SINCE header for the URL [' . $this->currentUrl . '] ' |
|
429 | - . 'send cache headers to tell the browser'); |
|
428 | + . 'not send the HTTP_IF_MODIFIED_SINCE header for the URL [' . $this->currentUrl . '] ' |
|
429 | + . 'send cache headers to tell the browser'); |
|
430 | 430 | $this->sendHeaders(200); |
431 | 431 | //current page cache key |
432 | 432 | $pageCacheKey = $this->currentUrlCacheKey; |
@@ -517,7 +517,7 @@ discard block |
||
517 | 517 | $obj = & get_instance(); |
518 | 518 | if (!is_object($obj)) { |
519 | 519 | //May be super instance not yet loaded |
520 | - return array( |
|
520 | + return array( |
|
521 | 521 | 'view' => $view, |
522 | 522 | 'module' => $module, |
523 | 523 | 'viewFile' => $viewFile |
@@ -574,18 +574,18 @@ discard block |
||
574 | 574 | } |
575 | 575 | } |
576 | 576 | |
577 | - /** |
|
578 | - * Set the mandory headers, like security, etc. |
|
579 | - */ |
|
577 | + /** |
|
578 | + * Set the mandory headers, like security, etc. |
|
579 | + */ |
|
580 | 580 | protected function setRequiredHeaders() { |
581 | 581 | $requiredHeaders = array( |
582 | 582 | 'X-XSS-Protection' => '1; mode=block', |
583 | 583 | 'X-Frame-Options' => 'SAMEORIGIN' |
584 | 584 | ); |
585 | 585 | foreach ($requiredHeaders as $key => $value) { |
586 | - if (!isset($this->headers[$key])) { |
|
586 | + if (!isset($this->headers[$key])) { |
|
587 | 587 | $this->headers[$key] = $value; |
588 | - } |
|
588 | + } |
|
589 | 589 | } |
590 | 590 | } |
591 | 591 | } |
@@ -140,8 +140,8 @@ |
||
140 | 140 | //NOTE: here can not use show_error() because during the application |
141 | 141 | //bootstrap some dependencies are not yet loaded |
142 | 142 | echo('Invalid config log level [' . $configLogLevel . '], ' |
143 | - . 'the value must be one of the following: ' |
|
144 | - . implode(', ', array_map('strtoupper', self::$validConfigLevel))); |
|
143 | + . 'the value must be one of the following: ' |
|
144 | + . implode(', ', array_map('strtoupper', self::$validConfigLevel))); |
|
145 | 145 | return; |
146 | 146 | } |
147 | 147 |
@@ -823,7 +823,7 @@ discard block |
||
823 | 823 | * |
824 | 824 | * @return string|boolean |
825 | 825 | */ |
826 | - protected function getReturnType(){ |
|
826 | + protected function getReturnType() { |
|
827 | 827 | $type = false; |
828 | 828 | if ($this->temporaryReturnRecordType == 'array') { |
829 | 829 | $type = 'array'; |
@@ -835,7 +835,7 @@ discard block |
||
835 | 835 | * Check if soft delete is enable setting the condition |
836 | 836 | * @return object the current instance |
837 | 837 | */ |
838 | - protected function checkForSoftDelete(){ |
|
838 | + protected function checkForSoftDelete() { |
|
839 | 839 | if ($this->softDeleteStatus && $this->returnRecordWithDeleted !== true) { |
840 | 840 | $this->getQueryBuilder()->where( |
841 | 841 | $this->softDeleteTableColumn, |
@@ -855,11 +855,11 @@ discard block |
||
855 | 855 | * |
856 | 856 | * @return array|object the final row values |
857 | 857 | */ |
858 | - protected function relateOneToManyAndManyToOne($relationship, $options, $row, $type){ |
|
858 | + protected function relateOneToManyAndManyToOne($relationship, $options, $row, $type) { |
|
859 | 859 | if (in_array($relationship, $this->withs)) { |
860 | 860 | get_instance()->loader->model($options['model'], $relationship . '_model'); |
861 | 861 | $model = get_instance()->{$relationship . '_model'}; |
862 | - if($type == 'manyToOne'){ |
|
862 | + if ($type == 'manyToOne') { |
|
863 | 863 | if (is_object($row)) { |
864 | 864 | $row->{$relationship} = $model->getSingleRecord($row->{$options['primary_key']}); |
865 | 865 | } else { |
@@ -969,7 +969,7 @@ discard block |
||
969 | 969 | } else { |
970 | 970 | if (is_int($field)) { |
971 | 971 | //Condition like xxxx->getListRecordCond(array('id')); |
972 | - $this->getQueryBuilder()->where($value); // WHERE id = '' |
|
972 | + $this->getQueryBuilder()->where($value); // WHERE id = '' |
|
973 | 973 | } else { |
974 | 974 | //Condition like xxxx->getListRecordCond(array('status' => 0)); |
975 | 975 | $this->getQueryBuilder()->where($field, $value); // WHERE status = 0 |