@@ -61,7 +61,7 @@ |
||
| 61 | 61 | */ |
| 62 | 62 | public function add($name) { |
| 63 | 63 | if (in_array($name, $this->list)) { |
| 64 | - $this->logger->info('The module [' .$name. '] already added skipping.'); |
|
| 64 | + $this->logger->info('The module [' . $name . '] already added skipping.'); |
|
| 65 | 65 | return $this; |
| 66 | 66 | } |
| 67 | 67 | $this->list[] = $name; |
@@ -443,7 +443,7 @@ discard block |
||
| 443 | 443 | * Remove the DOCUMENT_ROOT and front controller from segments if exists |
| 444 | 444 | * @return void |
| 445 | 445 | */ |
| 446 | - protected function removeDocumentRootFrontControllerFromSegments(){ |
|
| 446 | + protected function removeDocumentRootFrontControllerFromSegments() { |
|
| 447 | 447 | $segment = $this->segments; |
| 448 | 448 | $baseUrl = get_config('base_url'); |
| 449 | 449 | //check if the app is not in DOCUMENT_ROOT |
@@ -561,7 +561,7 @@ discard block |
||
| 561 | 561 | break; |
| 562 | 562 | } |
| 563 | 563 | } |
| 564 | - if($findIndex !== -1){ |
|
| 564 | + if ($findIndex !== -1) { |
|
| 565 | 565 | //$args[0] => full string captured by preg_match |
| 566 | 566 | //$args[1], $args[2], $args[n] => contains the value of |
| 567 | 567 | //(:num), (:alpha), (:alnum), (:any) |
@@ -586,7 +586,7 @@ discard block |
||
| 586 | 586 | * Find file path of the current controller using the current module |
| 587 | 587 | * @return boolean true if the file path is found otherwise false. |
| 588 | 588 | */ |
| 589 | - protected function findControllerFullPathUsingCurrentModule(){ |
|
| 589 | + protected function findControllerFullPathUsingCurrentModule() { |
|
| 590 | 590 | $path = $this->moduleInstance->findControllerFullPath(ucfirst($this->controller), $this->module); |
| 591 | 591 | if (!$path) { |
| 592 | 592 | $this->logger->info('The controller [' . $this->controller . '] not found in the module, may be will use the module [' . $this->module . '] as controller'); |
@@ -602,7 +602,7 @@ discard block |
||
| 602 | 602 | * or the current request does not use module |
| 603 | 603 | * @return void |
| 604 | 604 | */ |
| 605 | - protected function setRouteParamsIfNoModuleOrNotFound(){ |
|
| 605 | + protected function setRouteParamsIfNoModuleOrNotFound() { |
|
| 606 | 606 | $segment = $this->segments; |
| 607 | 607 | //controller |
| 608 | 608 | if (isset($segment[0])) { |
@@ -623,7 +623,7 @@ discard block |
||
| 623 | 623 | * or the current request use module |
| 624 | 624 | * @return void |
| 625 | 625 | */ |
| 626 | - protected function setRouteParamsIfAppHasModuleOrFound(){ |
|
| 626 | + protected function setRouteParamsIfAppHasModuleOrFound() { |
|
| 627 | 627 | //get the module list |
| 628 | 628 | $modules = $this->moduleInstance->getModuleList(); |
| 629 | 629 | $segment = $this->segments; |
@@ -636,7 +636,7 @@ discard block |
||
| 636 | 636 | $this->controller = $segment[0]; |
| 637 | 637 | |
| 638 | 638 | //check if the request use the same module name and controller |
| 639 | - if($this->findControllerFullPathUsingCurrentModule()){ |
|
| 639 | + if ($this->findControllerFullPathUsingCurrentModule()) { |
|
| 640 | 640 | array_shift($segment); |
| 641 | 641 | } |
| 642 | 642 | } |
@@ -369,7 +369,7 @@ |
||
| 369 | 369 | * |
| 370 | 370 | * @return string|null the full file path |
| 371 | 371 | */ |
| 372 | - protected function getDefaultFilePathForView($file){ |
|
| 372 | + protected function getDefaultFilePathForView($file) { |
|
| 373 | 373 | $searchDir = array(APPS_VIEWS_PATH, CORE_VIEWS_PATH); |
| 374 | 374 | $fullFilePath = null; |
| 375 | 375 | foreach ($searchDir as $dir) { |
@@ -32,8 +32,8 @@ |
||
| 32 | 32 | <p>Required PHP version : <b>PHP >= <?php echo TNH_MIN_PHP_VERSION; ?>, PHP < <?php echo TNH_MAX_PHP_VERSION; ?></b></p> |
| 33 | 33 | <p>Release date : <b><?php echo TNH_RELEASE_DATE; ?></b></p> |
| 34 | 34 | <hr /> |
| 35 | - <p>Current controller: <b class = "text-muted label-danger"><?php echo APPS_CONTROLLER_PATH . 'Home.php';?></b> |
|
| 36 | - <p>Current view: <b class = "text-muted label-danger"><?php echo APPS_VIEWS_PATH . 'home.php';?></b> |
|
| 35 | + <p>Current controller: <b class = "text-muted label-danger"><?php echo APPS_CONTROLLER_PATH . 'Home.php'; ?></b> |
|
| 36 | + <p>Current view: <b class = "text-muted label-danger"><?php echo APPS_VIEWS_PATH . 'home.php'; ?></b> |
|
| 37 | 37 | </div> |
| 38 | 38 | </div> |
| 39 | 39 | </div> |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | * SOFTWARE. |
| 29 | 29 | */ |
| 30 | 30 | |
| 31 | - class Url extends BaseClass{ |
|
| 31 | + class Url extends BaseClass { |
|
| 32 | 32 | |
| 33 | 33 | /** |
| 34 | 34 | * Construct new instance |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | * @return string the final path after add suffix if configured |
| 152 | 152 | * otherwise the same value will be returned |
| 153 | 153 | */ |
| 154 | - protected function addSuffixInPath($path){ |
|
| 154 | + protected function addSuffixInPath($path) { |
|
| 155 | 155 | $suffix = get_config('url_suffix'); |
| 156 | 156 | if ($suffix && $path) { |
| 157 | 157 | if (strpos($path, '?') !== false) { |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | public function getCacheContent() { |
| 159 | 159 | //set some attributes values |
| 160 | 160 | $this->setPropertiesValues(); |
| 161 | - if(! $this->isSelectQuery || ! $this->dbCacheStatus){ |
|
| 161 | + if (!$this->isSelectQuery || !$this->dbCacheStatus) { |
|
| 162 | 162 | $this->logger->info('The cache is not enabled for this query or is not a SELECT query'); |
| 163 | 163 | return null; |
| 164 | 164 | } |
@@ -179,7 +179,7 @@ discard block |
||
| 179 | 179 | public function saveCacheContent($result) { |
| 180 | 180 | //set some attributes values |
| 181 | 181 | $this->setPropertiesValues(); |
| 182 | - if(! $this->isSelectQuery || ! $this->dbCacheStatus){ |
|
| 182 | + if (!$this->isSelectQuery || !$this->dbCacheStatus) { |
|
| 183 | 183 | return null; |
| 184 | 184 | } |
| 185 | 185 | $this->setCacheFromSuperInstanceIfNull(); |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | $instance = $db; |
| 185 | 185 | } else { |
| 186 | 186 | $obj = & get_instance(); |
| 187 | - if (isset($obj->database)){ |
|
| 187 | + if (isset($obj->database)) { |
|
| 188 | 188 | /** |
| 189 | 189 | * NOTE: Need use "clone" because some Model need have the personal instance of the database library |
| 190 | 190 | * to prevent duplication |
@@ -838,7 +838,7 @@ discard block |
||
| 838 | 838 | * |
| 839 | 839 | * @return string|boolean |
| 840 | 840 | */ |
| 841 | - protected function getReturnType(){ |
|
| 841 | + protected function getReturnType() { |
|
| 842 | 842 | $type = false; |
| 843 | 843 | if ($this->temporaryReturnRecordType == 'array') { |
| 844 | 844 | $type = 'array'; |
@@ -850,7 +850,7 @@ discard block |
||
| 850 | 850 | * Check if soft delete is enable setting the condition |
| 851 | 851 | * @return object the current instance |
| 852 | 852 | */ |
| 853 | - protected function checkForSoftDelete(){ |
|
| 853 | + protected function checkForSoftDelete() { |
|
| 854 | 854 | if ($this->softDeleteStatus && $this->returnRecordWithDeleted !== true) { |
| 855 | 855 | $this->getQueryBuilder()->where( |
| 856 | 856 | $this->softDeleteTableColumn, |
@@ -870,11 +870,11 @@ discard block |
||
| 870 | 870 | * |
| 871 | 871 | * @return array|object the final row values |
| 872 | 872 | */ |
| 873 | - protected function relateOneToManyAndManyToOne($relationship, $options, $row, $type){ |
|
| 873 | + protected function relateOneToManyAndManyToOne($relationship, $options, $row, $type) { |
|
| 874 | 874 | if (in_array($relationship, $this->withs)) { |
| 875 | 875 | get_instance()->loader->model($options['model'], $relationship . '_model'); |
| 876 | 876 | $model = get_instance()->{$relationship . '_model'}; |
| 877 | - if($type == 'manyToOne'){ |
|
| 877 | + if ($type == 'manyToOne') { |
|
| 878 | 878 | if (is_object($row)) { |
| 879 | 879 | $row->{$relationship} = $model->getSingleRecord($row->{$options['primary_key']}); |
| 880 | 880 | } else { |