@@ -262,24 +262,24 @@ |
||
| 262 | 262 | return $this; |
| 263 | 263 | } |
| 264 | 264 | |
| 265 | - /** |
|
| 266 | - * Return the instance of session. |
|
| 267 | - * @return object the session instance |
|
| 268 | - */ |
|
| 265 | + /** |
|
| 266 | + * Return the instance of session. |
|
| 267 | + * @return object the session instance |
|
| 268 | + */ |
|
| 269 | 269 | public function getSession() { |
| 270 | 270 | return $this->session; |
| 271 | 271 | } |
| 272 | 272 | |
| 273 | - /** |
|
| 274 | - * Set the value for $_GET, $_POST, $_SERVER etc. if the key is an array will |
|
| 275 | - * set the current super variable value by this. |
|
| 276 | - * @param string $type the type can be "post", "get", etc. |
|
| 277 | - * @param string|array $key the item key to be set or array if need set the current global variable |
|
| 278 | - * by this value |
|
| 279 | - * @param mixed $value the value to set if $key is not an array |
|
| 280 | - * |
|
| 281 | - * @return object the current instance |
|
| 282 | - */ |
|
| 273 | + /** |
|
| 274 | + * Set the value for $_GET, $_POST, $_SERVER etc. if the key is an array will |
|
| 275 | + * set the current super variable value by this. |
|
| 276 | + * @param string $type the type can be "post", "get", etc. |
|
| 277 | + * @param string|array $key the item key to be set or array if need set the current global variable |
|
| 278 | + * by this value |
|
| 279 | + * @param mixed $value the value to set if $key is not an array |
|
| 280 | + * |
|
| 281 | + * @return object the current instance |
|
| 282 | + */ |
|
| 283 | 283 | protected function setVars($type, $key, $value = null) { |
| 284 | 284 | if (is_array($key)) { |
| 285 | 285 | //set all |
@@ -185,7 +185,7 @@ discard block |
||
| 185 | 185 | } else { |
| 186 | 186 | $logger->info('Cannot find view [' . $view . '] in module [' . $module . '] using the default location'); |
| 187 | 187 | } |
| 188 | - if (!$path) { |
|
| 188 | + if (!$path) { |
|
| 189 | 189 | $path = $this->getDefaultFilePathForView($viewFile); |
| 190 | 190 | } |
| 191 | 191 | $logger->info('The view file path to be loaded is [' . $path . ']'); |
@@ -340,12 +340,12 @@ discard block |
||
| 340 | 340 | ob_end_flush(); |
| 341 | 341 | } |
| 342 | 342 | |
| 343 | - /** |
|
| 344 | - * Return the default full file path for view |
|
| 345 | - * @param string $file the filename |
|
| 346 | - * |
|
| 347 | - * @return string|null the full file path |
|
| 348 | - */ |
|
| 343 | + /** |
|
| 344 | + * Return the default full file path for view |
|
| 345 | + * @param string $file the filename |
|
| 346 | + * |
|
| 347 | + * @return string|null the full file path |
|
| 348 | + */ |
|
| 349 | 349 | protected static function getDefaultFilePathForView($file){ |
| 350 | 350 | $searchDir = array(APPS_VIEWS_PATH, CORE_VIEWS_PATH); |
| 351 | 351 | $fullFilePath = null; |
@@ -535,18 +535,18 @@ discard block |
||
| 535 | 535 | } |
| 536 | 536 | } |
| 537 | 537 | |
| 538 | - /** |
|
| 539 | - * Set the mandory headers, like security, etc. |
|
| 540 | - */ |
|
| 538 | + /** |
|
| 539 | + * Set the mandory headers, like security, etc. |
|
| 540 | + */ |
|
| 541 | 541 | protected static function setRequiredHeaders() { |
| 542 | 542 | $requiredHeaders = array( |
| 543 | 543 | 'X-XSS-Protection' => '1; mode=block', |
| 544 | 544 | 'X-Frame-Options' => 'SAMEORIGIN' |
| 545 | 545 | ); |
| 546 | 546 | foreach ($requiredHeaders as $key => $value) { |
| 547 | - if (!isset(self::$headers[$key])) { |
|
| 547 | + if (!isset(self::$headers[$key])) { |
|
| 548 | 548 | self::$headers[$key] = $value; |
| 549 | - } |
|
| 549 | + } |
|
| 550 | 550 | } |
| 551 | 551 | } |
| 552 | 552 | } |
@@ -346,7 +346,7 @@ discard block |
||
| 346 | 346 | * |
| 347 | 347 | * @return string|null the full file path |
| 348 | 348 | */ |
| 349 | - protected static function getDefaultFilePathForView($file){ |
|
| 349 | + protected static function getDefaultFilePathForView($file) { |
|
| 350 | 350 | $searchDir = array(APPS_VIEWS_PATH, CORE_VIEWS_PATH); |
| 351 | 351 | $fullFilePath = null; |
| 352 | 352 | foreach ($searchDir as $dir) { |
@@ -465,7 +465,7 @@ discard block |
||
| 465 | 465 | // Parse out the elapsed time and memory usage, |
| 466 | 466 | // then swap the pseudo-variables with the data |
| 467 | 467 | $elapsedTime = $benchmark->elapsedTime('APP_EXECUTION_START', 'APP_EXECUTION_END'); |
| 468 | - $memoryUsage = round($benchmark->memoryUsage('APP_EXECUTION_START', 'APP_EXECUTION_END') / 1024 / 1024, 6) . 'MB'; |
|
| 468 | + $memoryUsage = round($benchmark->memoryUsage('APP_EXECUTION_START', 'APP_EXECUTION_END') / 1024 / 1024, 6) . 'MB'; |
|
| 469 | 469 | return str_replace(array('{elapsed_time}', '{memory_usage}'), array($elapsedTime, $memoryUsage), $content); |
| 470 | 470 | } |
| 471 | 471 | |