@@ -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 | } |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | * SOFTWARE. |
29 | 29 | */ |
30 | 30 | |
31 | - class Email extends BaseClass{ |
|
31 | + class Email extends BaseClass { |
|
32 | 32 | /** |
33 | 33 | * @var int $wrap |
34 | 34 | */ |
@@ -845,7 +845,7 @@ discard block |
||
845 | 845 | $message = $this->getWrapMessage(); |
846 | 846 | if ($this->hasAttachments()) { |
847 | 847 | $this->setAttachmentHeaders(); |
848 | - $message = $this->assembleAttachmentBody(); |
|
848 | + $message = $this->assembleAttachmentBody(); |
|
849 | 849 | } |
850 | 850 | return $message; |
851 | 851 | } |
@@ -925,7 +925,7 @@ discard block |
||
925 | 925 | $this->getSmtpConfig('connection_timeout', 30) |
926 | 926 | ); |
927 | 927 | |
928 | - if (! is_resource($this->smtpSocket)) { |
|
928 | + if (!is_resource($this->smtpSocket)) { |
|
929 | 929 | $this->error = $errorNumber . ': ' . $errorMessage; |
930 | 930 | return false; |
931 | 931 | } |
@@ -974,7 +974,7 @@ discard block |
||
974 | 974 | */ |
975 | 975 | if (is_resource($this->smtpSocket)) { |
976 | 976 | $method = STREAM_CRYPTO_METHOD_TLS_CLIENT; |
977 | - if(version_compare(PHP_VERSION, '5.6', '>=')) { |
|
977 | + if (version_compare(PHP_VERSION, '5.6', '>=')) { |
|
978 | 978 | $method = STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT | STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT | STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT; |
979 | 979 | } |
980 | 980 | stream_socket_enable_crypto($this->smtpSocket, true, $method); |
@@ -1041,7 +1041,7 @@ discard block |
||
1041 | 1041 | 'To' => $to |
1042 | 1042 | ); |
1043 | 1043 | foreach ($additionalHeaders as $key => $value) { |
1044 | - if (! isset($this->headers[$key])) { |
|
1044 | + if (!isset($this->headers[$key])) { |
|
1045 | 1045 | $this->headers[$key] = $value; |
1046 | 1046 | } |
1047 | 1047 | } |
@@ -443,10 +443,10 @@ discard block |
||
443 | 443 | * @return object the current instance |
444 | 444 | */ |
445 | 445 | protected function filterValidationData() { |
446 | - foreach ($this->data as $key => $value ) { |
|
446 | + foreach ($this->data as $key => $value) { |
|
447 | 447 | if (is_string($value)) { |
448 | 448 | $this->data[$key] = trim($value); |
449 | - } else if(is_array($value)) { |
|
449 | + } else if (is_array($value)) { |
|
450 | 450 | $this->data[$key] = array_map('trim', $value); |
451 | 451 | } |
452 | 452 | } |
@@ -1161,7 +1161,7 @@ discard block |
||
1161 | 1161 | $rule, |
1162 | 1162 | $paramValue |
1163 | 1163 | ); |
1164 | - } else{ |
|
1164 | + } else { |
|
1165 | 1165 | $this->forceError = true; |
1166 | 1166 | show_error('The callback validation function/method "' . $paramValue . '" does not exist'); |
1167 | 1167 | } |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | * Reset all properties |
145 | 145 | */ |
146 | 146 | public function reset() { |
147 | - $this->agent = get_instance()->globalvar->server('HTTP_USER_AGENT'); |
|
147 | + $this->agent = get_instance()->globalvar->server('HTTP_USER_AGENT'); |
|
148 | 148 | $this->browserName = 'unknown'; |
149 | 149 | $this->version = 'unknown'; |
150 | 150 | $this->platform = 'unknown'; |
@@ -250,7 +250,7 @@ discard block |
||
250 | 250 | */ |
251 | 251 | protected function checkPlatform() { |
252 | 252 | foreach ($this->platforms as $regex => $value) { |
253 | - if (preg_match($regex, $this->agent) ) { |
|
253 | + if (preg_match($regex, $this->agent)) { |
|
254 | 254 | $this->platform = $value; |
255 | 255 | break; |
256 | 256 | } |
@@ -262,7 +262,7 @@ discard block |
||
262 | 262 | */ |
263 | 263 | protected function checkBrowser() { |
264 | 264 | foreach ($this->browsers as $regex => $value) { |
265 | - if (preg_match($regex, $this->agent ) ) { |
|
265 | + if (preg_match($regex, $this->agent)) { |
|
266 | 266 | $this->browserName = $value; |
267 | 267 | break; |
268 | 268 | } |
@@ -272,10 +272,10 @@ discard block |
||
272 | 272 | /** |
273 | 273 | * Routine to determine the browser version |
274 | 274 | */ |
275 | - protected function checkBrowserVersion(){ |
|
275 | + protected function checkBrowserVersion() { |
|
276 | 276 | $detected = $this->getBrowser(); |
277 | 277 | $detect = array_search($detected, $this->browsers); |
278 | - $browser = str_replace(array('/i','/'), '', $detect); |
|
278 | + $browser = str_replace(array('/i', '/'), '', $detect); |
|
279 | 279 | $regex = "/(?<browser>version|{$browser})[\/]+(?<version>[0-9.|a-zA-Z.]*)/i"; |
280 | 280 | if (preg_match_all($regex, $this->agent, $matches)) { |
281 | 281 | $found = array_search($browser, $matches['browser']); |
@@ -288,7 +288,7 @@ discard block |
||
288 | 288 | */ |
289 | 289 | protected function checkMobile() { |
290 | 290 | if (preg_match('/(android|avantgo|blackberry|bolt|boost|cricket' |
291 | - . '|docomo|fone|hiptop|mini|mobi|palm|phone|pie|tablet|up\.browser|up\.link|webos|wos)/i', $this->agent) ) { |
|
291 | + . '|docomo|fone|hiptop|mini|mobi|palm|phone|pie|tablet|up\.browser|up\.link|webos|wos)/i', $this->agent)) { |
|
292 | 292 | $this->isMobile = true; |
293 | 293 | } |
294 | 294 | } |
@@ -297,7 +297,7 @@ discard block |
||
297 | 297 | * Determine if the browser is Tablet or not |
298 | 298 | */ |
299 | 299 | protected function checkTablet() { |
300 | - if (preg_match('/tablet|ipad/i', $this->agent) ) { |
|
300 | + if (preg_match('/tablet|ipad/i', $this->agent)) { |
|
301 | 301 | $this->isTablet = true; |
302 | 302 | } |
303 | 303 | } |
@@ -306,7 +306,7 @@ discard block |
||
306 | 306 | * Determine if the browser is Robot or not |
307 | 307 | */ |
308 | 308 | protected function checkBot() { |
309 | - if (preg_match('/bot/i', $this->agent) ) { |
|
309 | + if (preg_match('/bot/i', $this->agent)) { |
|
310 | 310 | $this->isRobot = true; |
311 | 311 | } |
312 | 312 | } |
@@ -318,7 +318,7 @@ discard block |
||
318 | 318 | if (stristr($this->agent, 'FacebookExternalHit')) { |
319 | 319 | $this->isRobot = true; |
320 | 320 | $this->isFacebook = true; |
321 | - } else if (stristr($this->agent, 'FBIOS')) { |
|
321 | + } else if (stristr($this->agent, 'FBIOS')) { |
|
322 | 322 | $this->isFacebook = true; |
323 | 323 | } |
324 | 324 | } |
@@ -335,7 +335,7 @@ discard block |
||
335 | 335 | * @param string $appLang the application language, only if type = "language" |
336 | 336 | * @return string|null the full file path |
337 | 337 | */ |
338 | - protected function getDefaultFilePathForFunctionLanguage($file, $type, $appLang = null){ |
|
338 | + protected function getDefaultFilePathForFunctionLanguage($file, $type, $appLang = null) { |
|
339 | 339 | //Default to "function" |
340 | 340 | $searchDir = array(FUNCTIONS_PATH, CORE_FUNCTIONS_PATH); |
341 | 341 | if ($type == 'language') { |
@@ -359,7 +359,7 @@ discard block |
||
359 | 359 | * @param string|null $module the module if is not null will return it |
360 | 360 | * @return string|null |
361 | 361 | */ |
362 | - protected function getModuleFromSuperController($module){ |
|
362 | + protected function getModuleFromSuperController($module) { |
|
363 | 363 | $obj = & get_instance(); |
364 | 364 | if (!$module && !empty($obj->moduleName)) { |
365 | 365 | $module = $obj->moduleName; |
@@ -318,7 +318,7 @@ |
||
318 | 318 | * Get some parameters need like ip address, hostname, browser info, etc. |
319 | 319 | * @return array |
320 | 320 | */ |
321 | - protected function getSessionDataParams(){ |
|
321 | + protected function getSessionDataParams() { |
|
322 | 322 | $this->OBJ->loader->functions('user_agent'); |
323 | 323 | $this->OBJ->loader->library('Browser'); |
324 | 324 |
@@ -450,7 +450,7 @@ discard block |
||
450 | 450 | * Remove the DOCUMENT_ROOT and front controller from segments if exists |
451 | 451 | * @return void |
452 | 452 | */ |
453 | - protected function removeDocumentRootFrontControllerFromSegments(){ |
|
453 | + protected function removeDocumentRootFrontControllerFromSegments() { |
|
454 | 454 | $segment = $this->segments; |
455 | 455 | $globals = & class_loader('GlobalVar', 'classes'); |
456 | 456 | $rootFolder = substr($globals->server('SCRIPT_NAME'), 0, strpos( |
@@ -581,7 +581,7 @@ discard block |
||
581 | 581 | break; |
582 | 582 | } |
583 | 583 | } |
584 | - if($findIndex !== -1){ |
|
584 | + if ($findIndex !== -1) { |
|
585 | 585 | /* |
586 | 586 | * $args[0] => full string captured by preg_match |
587 | 587 | * $args[1], $args[2], $args[n] => contains the value of |
@@ -608,7 +608,7 @@ discard block |
||
608 | 608 | * Find file path of the current controller using the current module |
609 | 609 | * @return boolean true if the file path is found otherwise false. |
610 | 610 | */ |
611 | - protected function findControllerFullPathUsingCurrentModule(){ |
|
611 | + protected function findControllerFullPathUsingCurrentModule() { |
|
612 | 612 | $path = $this->moduleInstance->findControllerFullPath(ucfirst($this->controller), $this->module); |
613 | 613 | if (!$path) { |
614 | 614 | $this->logger->info('The controller [' . $this->controller . '] not ' |
@@ -625,7 +625,7 @@ discard block |
||
625 | 625 | * or the current request does not use module |
626 | 626 | * @return void |
627 | 627 | */ |
628 | - protected function setRouteParamsIfNoModuleOrNotFound(){ |
|
628 | + protected function setRouteParamsIfNoModuleOrNotFound() { |
|
629 | 629 | $segment = $this->segments; |
630 | 630 | //controller |
631 | 631 | if (isset($segment[0])) { |
@@ -646,7 +646,7 @@ discard block |
||
646 | 646 | * or the current request use module |
647 | 647 | * @return void |
648 | 648 | */ |
649 | - protected function setRouteParamsIfAppHasModuleOrFound(){ |
|
649 | + protected function setRouteParamsIfAppHasModuleOrFound() { |
|
650 | 650 | //get the module list |
651 | 651 | $modules = $this->moduleInstance->getModuleList(); |
652 | 652 | $segment = $this->segments; |
@@ -658,7 +658,7 @@ discard block |
||
658 | 658 | if (isset($segment[0])) { |
659 | 659 | $this->controller = $segment[0]; |
660 | 660 | //check if the request use the same module name and controller |
661 | - if($this->findControllerFullPathUsingCurrentModule()){ |
|
661 | + if ($this->findControllerFullPathUsingCurrentModule()) { |
|
662 | 662 | array_shift($segment); |
663 | 663 | } |
664 | 664 | } |