@@ -55,7 +55,7 @@ |
||
| 55 | 55 | protected function sendHTML($message = null) |
| 56 | 56 | { |
| 57 | 57 | header('HTTP/1.1 404 Not Found'); |
| 58 | - return '<!DOCTYPE html><html><head><title>An error has occurred</title></head><body><div style="width:60%; margin: auto; background-color: #fcc;border: 1px solid #faa; padding: 0.5em 1em;"><h1 style="font-size: 120%">Runtime error</h1><p>' . $message . '</p></div></body></html>'; |
|
| 58 | + return '<!DOCTYPE html><html><head><title>An error has occurred</title></head><body><div style="width:60%; margin: auto; background-color: #fcc;border: 1px solid #faa; padding: 0.5em 1em;"><h1 style="font-size: 120%">Runtime error</h1><p>'.$message.'</p></div></body></html>'; |
|
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | /** |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | $hints[] = '<code>LIMIT</code> without <code>ORDER BY</code> causes non-deterministic results, depending on the query execution plan'; |
| 161 | 161 | } |
| 162 | 162 | if (preg_match('/LIKE\\s[\'"](%.*?)[\'"]/i', $query, $matches)) { |
| 163 | - $hints[] = 'An argument has a leading wildcard character: <code>' . $matches[1] . '</code>. |
|
| 163 | + $hints[] = 'An argument has a leading wildcard character: <code>'.$matches[1].'</code>. |
|
| 164 | 164 | The predicate with this argument is not sargable and cannot use an index if one exists.'; |
| 165 | 165 | } |
| 166 | 166 | return implode("<br />", $hints); |
@@ -175,7 +175,7 @@ discard block |
||
| 175 | 175 | foreach ($traces as $trace) { |
| 176 | 176 | if (isset($trace['class']) && isset($trace['file']) && strpos( |
| 177 | 177 | $trace['file'], |
| 178 | - DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR |
|
| 178 | + DIRECTORY_SEPARATOR.'vendor'.DIRECTORY_SEPARATOR |
|
| 179 | 179 | ) === false |
| 180 | 180 | ) { |
| 181 | 181 | if (isset($trace['object']) && is_a($trace['object'], 'Twig_Template')) { |
@@ -187,7 +187,7 @@ discard block |
||
| 187 | 187 | $line = isset($trace['line']) ? $trace['line'] : '?'; |
| 188 | 188 | } |
| 189 | 189 | |
| 190 | - return $this->normalizeFilename($file) . ':' . $line; |
|
| 190 | + return $this->normalizeFilename($file).':'.$line; |
|
| 191 | 191 | } elseif (isset($trace['function']) && $trace['function'] == 'Illuminate\Routing\{closure}') { |
| 192 | 192 | return 'Route binding'; |
| 193 | 193 | } |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | $this->baseDomain = App::$Properties->get('baseDomain'); |
| 93 | 93 | } |
| 94 | 94 | // build script url |
| 95 | - $this->scriptUrl = App::$Request->getScheme() . '://' . $this->baseDomain; |
|
| 95 | + $this->scriptUrl = App::$Request->getScheme().'://'.$this->baseDomain; |
|
| 96 | 96 | if (App::$Properties->get('basePath') !== '/') { |
| 97 | 97 | $this->scriptUrl .= rtrim(App::$Properties->get('basePath'), '/'); |
| 98 | 98 | } |
@@ -104,27 +104,27 @@ discard block |
||
| 104 | 104 | |
| 105 | 105 | $this->baseUrlNoLang = $this->baseUrl; |
| 106 | 106 | if (App::$Request->languageInPath() && App::$Request->getLanguage() !== null) { |
| 107 | - $this->baseUrl .= '/' . App::$Request->getLanguage(); |
|
| 107 | + $this->baseUrl .= '/'.App::$Request->getLanguage(); |
|
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | // add cron initiation from user if enabled |
| 111 | 111 | if ((bool)App::$Properties->get('userCron') && env_name === 'Front') { |
| 112 | - $this->addPlainCode('js', 'if(Math.random() > 0.8) { $.get("' . $this->scriptUrl . '/cron.php?rand=" + Math.random()); }'); |
|
| 112 | + $this->addPlainCode('js', 'if(Math.random() > 0.8) { $.get("'.$this->scriptUrl.'/cron.php?rand=" + Math.random()); }'); |
|
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 | // build vendor libs alias |
| 116 | - $this->vendorNamedLibrary['js']['jquery'] = $this->scriptUrl . '/vendor/bower/jquery/dist/jquery.min.js'; |
|
| 117 | - $this->vendorNamedLibrary['css']['bootstrap'] = $this->scriptUrl . '/vendor/bower/bootstrap/dist/css/bootstrap.min.css'; |
|
| 118 | - $this->vendorNamedLibrary['js']['bootstrap'] = $this->scriptUrl . '/vendor/bower/bootstrap/dist/js/bootstrap.min.js'; |
|
| 119 | - $this->vendorNamedLibrary['css']['fa'] = $this->scriptUrl . '/vendor/bower/components-font-awesome/css/font-awesome.min.css'; |
|
| 120 | - $this->vendorNamedLibrary['js']['jquery-ui'] = $this->scriptUrl . '/vendor/bower/jquery-ui/jquery-ui.min.js'; |
|
| 121 | - $this->vendorNamedLibrary['css']['jquery-ui'] = $this->scriptUrl . '/vendor/bower/jquery-ui/themes/base/jquery-ui.min.css'; |
|
| 116 | + $this->vendorNamedLibrary['js']['jquery'] = $this->scriptUrl.'/vendor/bower/jquery/dist/jquery.min.js'; |
|
| 117 | + $this->vendorNamedLibrary['css']['bootstrap'] = $this->scriptUrl.'/vendor/bower/bootstrap/dist/css/bootstrap.min.css'; |
|
| 118 | + $this->vendorNamedLibrary['js']['bootstrap'] = $this->scriptUrl.'/vendor/bower/bootstrap/dist/js/bootstrap.min.js'; |
|
| 119 | + $this->vendorNamedLibrary['css']['fa'] = $this->scriptUrl.'/vendor/bower/components-font-awesome/css/font-awesome.min.css'; |
|
| 120 | + $this->vendorNamedLibrary['js']['jquery-ui'] = $this->scriptUrl.'/vendor/bower/jquery-ui/jquery-ui.min.js'; |
|
| 121 | + $this->vendorNamedLibrary['css']['jquery-ui'] = $this->scriptUrl.'/vendor/bower/jquery-ui/themes/base/jquery-ui.min.css'; |
|
| 122 | 122 | |
| 123 | 123 | $themeAll = App::$Properties->get('theme'); |
| 124 | 124 | if (!isset($themeAll[env_name]) || Str::length($themeAll[env_name]) < 1) { |
| 125 | 125 | $themeAll[env_name] = 'default'; |
| 126 | 126 | } |
| 127 | - $this->currentViewUrl = $this->scriptUrl . '/Apps/View/' . env_name . '/' . $themeAll[env_name]; |
|
| 127 | + $this->currentViewUrl = $this->scriptUrl.'/Apps/View/'.env_name.'/'.$themeAll[env_name]; |
|
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | /** |
@@ -71,9 +71,9 @@ discard block |
||
| 71 | 71 | } else { |
| 72 | 72 | $this->startMeasure(__METHOD__); |
| 73 | 73 | |
| 74 | - $layoutPath = App::$Alias->currentViewPath . '/layout/' . $this->layout . '.php'; |
|
| 74 | + $layoutPath = App::$Alias->currentViewPath.'/layout/'.$this->layout.'.php'; |
|
| 75 | 75 | if (!File::exist($layoutPath)) { |
| 76 | - throw new NativeException('Layout not founded: ' . $layoutPath); |
|
| 76 | + throw new NativeException('Layout not founded: '.$layoutPath); |
|
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | $body = $this->output; |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | // set custom css library's not included on static call |
| 93 | 93 | $cssIncludeCode = App::$View->showCodeLink('css'); |
| 94 | 94 | if (!Str::likeEmpty($cssIncludeCode)) { |
| 95 | - $content = Str::replace('</head>', $cssIncludeCode . '</head>', $content); |
|
| 95 | + $content = Str::replace('</head>', $cssIncludeCode.'</head>', $content); |
|
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | if (App::$Debug) { |
| 103 | 103 | $content = Str::replace( |
| 104 | 104 | ['</body>', '</head>'], |
| 105 | - [App::$Debug->renderOut() . '</body>', App::$Debug->renderHead() . '</head>'], |
|
| 105 | + [App::$Debug->renderOut().'</body>', App::$Debug->renderHead().'</head>'], |
|
| 106 | 106 | $content |
| 107 | 107 | ); |
| 108 | 108 | } |
@@ -42,9 +42,9 @@ discard block |
||
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | // try to load from file |
| 45 | - $configFile = ucfirst(Str::lowerCase($configName)) . '.php'; |
|
| 46 | - if (File::exist('/Private/Config/' . $configFile)) { |
|
| 47 | - $this->data[$configName] = File::inc('/Private/Config/' . $configFile, true); |
|
| 45 | + $configFile = ucfirst(Str::lowerCase($configName)).'.php'; |
|
| 46 | + if (File::exist('/Private/Config/'.$configFile)) { |
|
| 47 | + $this->data[$configName] = File::inc('/Private/Config/'.$configFile, true); |
|
| 48 | 48 | return true; |
| 49 | 49 | } |
| 50 | 50 | |
@@ -137,12 +137,12 @@ discard block |
||
| 137 | 137 | */ |
| 138 | 138 | public function writeConfig(string $configFile, array $data): bool |
| 139 | 139 | { |
| 140 | - $path = '/Private/Config/' . ucfirst(Str::lowerCase($configFile)) . '.php'; |
|
| 140 | + $path = '/Private/Config/'.ucfirst(Str::lowerCase($configFile)).'.php'; |
|
| 141 | 141 | if (!File::exist($path) || !File::writable($path)) { |
| 142 | 142 | return false; |
| 143 | 143 | } |
| 144 | 144 | |
| 145 | - $saveData = '<?php return ' . Arr::exportVar($data) . ';'; |
|
| 145 | + $saveData = '<?php return '.Arr::exportVar($data).';'; |
|
| 146 | 146 | File::write($path, $saveData); |
| 147 | 147 | // overload config values if changed |
| 148 | 148 | $this->load($configFile, true); |
@@ -22,10 +22,10 @@ |
||
| 22 | 22 | { |
| 23 | 23 | $to = trim($to, '/'); |
| 24 | 24 | if (false === $full && !Str::startsWith(App::$Alias->baseUrl, $to)) { |
| 25 | - $to = App::$Alias->baseUrl . '/' . $to; |
|
| 25 | + $to = App::$Alias->baseUrl.'/'.$to; |
|
| 26 | 26 | } |
| 27 | 27 | $redirect = new FoundationRedirect($to); |
| 28 | 28 | $redirect->send(); |
| 29 | - exit('Redirecting to ' . $to . ' ...'); |
|
| 29 | + exit('Redirecting to '.$to.' ...'); |
|
| 30 | 30 | } |
| 31 | 31 | } |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | public static function to($controller_action, $id = null, $add = null, array $params = null, $encode = true) |
| 26 | 26 | { |
| 27 | 27 | $pathway = self::buildPathway([$controller_action, $id, $add, $params], $encode); |
| 28 | - return App::$Alias->baseUrl . '/' . $pathway; |
|
| 28 | + return App::$Alias->baseUrl.'/'.$pathway; |
|
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | /** |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | $controller = Str::lastIn($controller, '\\', true); |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | - $response = $controller . '/' . $action; |
|
| 64 | + $response = $controller.'/'.$action; |
|
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | // check if controller and action is defined |
@@ -71,17 +71,17 @@ discard block |
||
| 71 | 71 | |
| 72 | 72 | // id is defined? |
| 73 | 73 | if (isset($to[1]) && !Str::likeEmpty($to[1])) { |
| 74 | - $response .= '/' . self::safeUri($to[1], $encode); |
|
| 74 | + $response .= '/'.self::safeUri($to[1], $encode); |
|
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | // add param is defined? |
| 78 | 78 | if (isset($to[2]) && !Str::likeEmpty($to[2])) { |
| 79 | - $response .= '/' . self::safeUri($to[2], $encode); |
|
| 79 | + $response .= '/'.self::safeUri($to[2], $encode); |
|
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | // try to find static alias |
| 83 | - if (isset($routing['Alias'][env_name]) && Arr::in('/' . $response, $routing['Alias'][env_name])) { |
|
| 84 | - $pathAlias = array_search('/' . $response, $routing['Alias'][env_name]); |
|
| 83 | + if (isset($routing['Alias'][env_name]) && Arr::in('/'.$response, $routing['Alias'][env_name])) { |
|
| 84 | + $pathAlias = array_search('/'.$response, $routing['Alias'][env_name]); |
|
| 85 | 85 | if ($pathAlias !== false) { |
| 86 | 86 | $response = Str::lowerCase(trim($pathAlias, '/')); |
| 87 | 87 | } |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | } |
| 98 | 98 | $queryString = http_build_query($to[3]); |
| 99 | 99 | if (Str::length($queryString) > 0) { |
| 100 | - $response .= '?' . http_build_query($to[3]); |
|
| 100 | + $response .= '?'.http_build_query($to[3]); |
|
| 101 | 101 | } |
| 102 | 102 | if ($anchor !== false) { |
| 103 | 103 | $response .= $anchor; |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | public static function buildPathwayFromRequest() |
| 120 | 120 | { |
| 121 | 121 | return self::buildPathway([ |
| 122 | - Str::lowerCase(App::$Request->getController()) . '/' . Str::lowerCase(App::$Request->getAction()), |
|
| 122 | + Str::lowerCase(App::$Request->getController()).'/'.Str::lowerCase(App::$Request->getAction()), |
|
| 123 | 123 | App::$Request->getID(), |
| 124 | 124 | App::$Request->getAdd(), |
| 125 | 125 | App::$Request->query->all() |
@@ -141,9 +141,9 @@ discard block |
||
| 141 | 141 | } |
| 142 | 142 | |
| 143 | 143 | // call Url::to(args) |
| 144 | - $callbackTo = call_user_func_array([__NAMESPACE__ . '\Url', 'to'], $to); |
|
| 144 | + $callbackTo = call_user_func_array([__NAMESPACE__.'\Url', 'to'], $to); |
|
| 145 | 145 | |
| 146 | - return '<a href="' . $callbackTo . '"' . $compile_property . '>' . $name . '</a>'; |
|
| 146 | + return '<a href="'.$callbackTo.'"'.$compile_property.'>'.$name.'</a>'; |
|
| 147 | 147 | } |
| 148 | 148 | |
| 149 | 149 | /** |
@@ -156,19 +156,19 @@ discard block |
||
| 156 | 156 | { |
| 157 | 157 | /** @var array $configs */ |
| 158 | 158 | $configs = \App::$Properties->getAll('default'); |
| 159 | - $httpHost = $configs['baseProto'] . '://' . $configs['baseDomain']; |
|
| 159 | + $httpHost = $configs['baseProto'].'://'.$configs['baseDomain']; |
|
| 160 | 160 | if ($configs['basePath'] !== '/') { |
| 161 | - $httpHost .= $configs['basePath'] . '/'; |
|
| 161 | + $httpHost .= $configs['basePath'].'/'; |
|
| 162 | 162 | } |
| 163 | 163 | |
| 164 | 164 | // check if is this is URI not URL |
| 165 | 165 | if (!Str::startsWith($httpHost, $uri)) { |
| 166 | 166 | // check if lang is defined in URI or define it |
| 167 | 167 | if ($lang !== null && $configs['multiLanguage'] && !Str::startsWith($lang, $uri)) { |
| 168 | - $uri = $lang . '/' . ltrim($uri, '/'); |
|
| 168 | + $uri = $lang.'/'.ltrim($uri, '/'); |
|
| 169 | 169 | } |
| 170 | 170 | // add basic httpHost data |
| 171 | - $uri = rtrim($httpHost, '/') . '/' . ltrim($uri, '/'); |
|
| 171 | + $uri = rtrim($httpHost, '/').'/'.ltrim($uri, '/'); |
|
| 172 | 172 | } |
| 173 | 173 | |
| 174 | 174 | return $uri; |
@@ -66,6 +66,6 @@ |
||
| 66 | 66 | return 'error'; |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | - return (int)$load . '%'; |
|
| 69 | + return (int)$load.'%'; |
|
| 70 | 70 | } |
| 71 | 71 | } |
@@ -84,7 +84,7 @@ |
||
| 84 | 84 | } catch (\Exception $e) { |
| 85 | 85 | if (App::$Debug) { |
| 86 | 86 | App::$Debug->addException($e); |
| 87 | - App::$Debug->addMessage('Send mail failed! Info: ' . $e->getMessage(), 'error'); |
|
| 87 | + App::$Debug->addMessage('Send mail failed! Info: '.$e->getMessage(), 'error'); |
|
| 88 | 88 | } |
| 89 | 89 | return false; |
| 90 | 90 | } |