@@ -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) { |
@@ -283,7 +283,7 @@ discard block |
||
283 | 283 | * |
284 | 284 | * @return object the current instance |
285 | 285 | */ |
286 | - public function setUploadedFileData(array $fileData){ |
|
286 | + public function setUploadedFileData(array $fileData) { |
|
287 | 287 | $this->uploadedFileData = $fileData; |
288 | 288 | return $this; |
289 | 289 | } |
@@ -526,7 +526,7 @@ discard block |
||
526 | 526 | * @return boolean |
527 | 527 | */ |
528 | 528 | public function isAllowOverwriting() { |
529 | - return $this->overwriteFile ; |
|
529 | + return $this->overwriteFile; |
|
530 | 530 | } |
531 | 531 | |
532 | 532 | /** |
@@ -565,7 +565,7 @@ discard block |
||
565 | 565 | * @return string |
566 | 566 | */ |
567 | 567 | public function getDestinationDirectory() { |
568 | - return $this->destinationDirectory ; |
|
568 | + return $this->destinationDirectory; |
|
569 | 569 | } |
570 | 570 | |
571 | 571 | /** |
@@ -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 |
@@ -125,7 +125,7 @@ |
||
125 | 125 | PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_OBJ |
126 | 126 | ); |
127 | 127 | $this->pdo = new PDO($this->getDsnValue(), $this->getUsername(), $this->getPassword(), $options); |
128 | - if($this->getDriver() == 'mysql') { |
|
128 | + if ($this->getDriver() == 'mysql') { |
|
129 | 129 | $this->pdo->exec("SET NAMES '" . $this->getCharset() . "' COLLATE '" . $this->getCollation() . "'"); |
130 | 130 | $this->pdo->exec("SET CHARACTER SET '" . $this->getCharset() . "'"); |
131 | 131 | } |
@@ -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) { |
@@ -414,7 +414,7 @@ discard block |
||
414 | 414 | $keysList = array(); |
415 | 415 | foreach ($keys as $k => $v) { |
416 | 416 | $v = $this->checkForNullValue($v); |
417 | - if (! is_numeric($v)) { |
|
417 | + if (!is_numeric($v)) { |
|
418 | 418 | $v = $this->connection->escape($v, $escape); |
419 | 419 | } |
420 | 420 | $keysList[] = $v; |
@@ -727,7 +727,7 @@ discard block |
||
727 | 727 | * |
728 | 728 | * @return string|null |
729 | 729 | */ |
730 | - protected function buildQueryPart($property, $command = ''){ |
|
730 | + protected function buildQueryPart($property, $command = '') { |
|
731 | 731 | if (!empty($this->{$property})) { |
732 | 732 | return $command . $this->{$property}; |
733 | 733 | } |
@@ -742,7 +742,7 @@ discard block |
||
742 | 742 | * @param string $clause the clause type "IS NULL", "IS NOT NULLs" |
743 | 743 | * @return object the current DatabaseQueryBuilder instance |
744 | 744 | */ |
745 | - protected function whereIsNullAndNotNull($field, $andOr = 'AND', $clause = 'IS NULL'){ |
|
745 | + protected function whereIsNullAndNotNull($field, $andOr = 'AND', $clause = 'IS NULL') { |
|
746 | 746 | if (is_array($field)) { |
747 | 747 | foreach ($field as $f) { |
748 | 748 | $this->whereIsNullAndNotNull($f, $andOr, $clause); |
@@ -760,7 +760,7 @@ discard block |
||
760 | 760 | * |
761 | 761 | * @return object the current instance |
762 | 762 | */ |
763 | - protected function setSelectStr($newSelect){ |
|
763 | + protected function setSelectStr($newSelect) { |
|
764 | 764 | $this->select = (($this->select == '*' || empty($this->select)) |
765 | 765 | ? $newSelect |
766 | 766 | : $this->select . ', ' . $newSelect); |
@@ -774,8 +774,8 @@ discard block |
||
774 | 774 | * @return string the empty string if the value is null |
775 | 775 | * otherwise the same value will be returned |
776 | 776 | */ |
777 | - protected function checkForNullValue($value){ |
|
778 | - if(is_null($value)){ |
|
777 | + protected function checkForNullValue($value) { |
|
778 | + if (is_null($value)) { |
|
779 | 779 | return ''; |
780 | 780 | } |
781 | 781 | return $value; |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | static $cfg; |
148 | 148 | if (empty($cfg)) { |
149 | 149 | $cfg[0] = & load_configurations(); |
150 | - if(! is_array($cfg[0])){ |
|
150 | + if (!is_array($cfg[0])) { |
|
151 | 151 | $cfg[0] = array(); |
152 | 152 | } |
153 | 153 | } |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | set_http_status_header(500); |
198 | 198 | } |
199 | 199 | $errorType = 'Error'; |
200 | - $errorsType = array ( |
|
200 | + $errorsType = array( |
|
201 | 201 | E_ERROR => 'Error', |
202 | 202 | E_WARNING => 'Warning', |
203 | 203 | E_PARSE => 'Parsing Error', |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | public function getCacheContent() { |
158 | 158 | //set some attributes values |
159 | 159 | $this->setPropertiesValues(); |
160 | - if (! $this->canUseCache()) { |
|
160 | + if (!$this->canUseCache()) { |
|
161 | 161 | $this->logger->info('The cache is not enabled for this query or is not a SELECT query'); |
162 | 162 | return null; |
163 | 163 | } |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | public function saveCacheContent($result) { |
179 | 179 | //set some attributes values |
180 | 180 | $this->setPropertiesValues(); |
181 | - if (! $this->canUseCache()) { |
|
181 | + if (!$this->canUseCache()) { |
|
182 | 182 | $this->logger->info('The cache is not enabled for this query or is not a SELECT query'); |
183 | 183 | return null; |
184 | 184 | } |