@@ -97,14 +97,14 @@ discard block |
||
| 97 | 97 | public function optionPath($path) |
| 98 | 98 | { |
| 99 | 99 | $path = str_replace(['\\', '/'], DIRECTORY_SEPARATOR, $path); |
| 100 | - $path = PATH_ROOT . str_replace(PATH_ROOT, '', $path); |
|
| 100 | + $path = PATH_ROOT.str_replace(PATH_ROOT, '', $path); |
|
| 101 | 101 | |
| 102 | 102 | if (pathinfo($path, PATHINFO_EXTENSION)) { |
| 103 | 103 | $this->optionFilename(pathinfo($path, PATHINFO_FILENAME)); |
| 104 | 104 | $path = dirname($path); |
| 105 | 105 | } |
| 106 | 106 | |
| 107 | - $this->optionPath = rtrim($path, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR; |
|
| 107 | + $this->optionPath = rtrim($path, DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR; |
|
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | // ------------------------------------------------------------------------ |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | public function optionFilename($name) |
| 118 | 118 | { |
| 119 | 119 | $name = str_replace('.php', '', $name); |
| 120 | - $this->optionFilename = prepare_filename($name) . '.php'; |
|
| 120 | + $this->optionFilename = prepare_filename($name).'.php'; |
|
| 121 | 121 | |
| 122 | 122 | $this->optionPath = empty($this->optionPath) ? modules()->current()->getRealPath() : $this->optionPath; |
| 123 | 123 | } |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | public function getPhpTemplateFile($filename) |
| 157 | 157 | { |
| 158 | 158 | $directories = [ |
| 159 | - PATH_REACTOR . 'Config' . DIRECTORY_SEPARATOR . 'PhpTemplateFiles', |
|
| 159 | + PATH_REACTOR.'Config'.DIRECTORY_SEPARATOR.'PhpTemplateFiles', |
|
| 160 | 160 | ]; |
| 161 | 161 | |
| 162 | 162 | } |
@@ -152,7 +152,7 @@ discard block |
||
| 152 | 152 | */ |
| 153 | 153 | public function optionLifetime($lifetime) |
| 154 | 154 | { |
| 155 | - $this->optionLifetime = (int)$lifetime; |
|
| 155 | + $this->optionLifetime = (int) $lifetime; |
|
| 156 | 156 | } |
| 157 | 157 | |
| 158 | 158 | // ------------------------------------------------------------------------ |
@@ -191,16 +191,16 @@ discard block |
||
| 191 | 191 | $options = input()->get(); |
| 192 | 192 | |
| 193 | 193 | if (empty($options)) { |
| 194 | - $_GET[ 'switch' ] = 'ON'; |
|
| 195 | - $_GET[ 'mode' ] = 'default'; |
|
| 196 | - $_GET[ 'lifetime' ] = 300; |
|
| 197 | - $_GET[ 'title' ] = language()->getLine(strtoupper('CLI_MAINTENANCE_TITLE')); |
|
| 198 | - $_GET[ 'message' ] = language()->getLine(strtoupper('CLI_MAINTENANCE_MESSAGE')); |
|
| 194 | + $_GET['switch'] = 'ON'; |
|
| 195 | + $_GET['mode'] = 'default'; |
|
| 196 | + $_GET['lifetime'] = 300; |
|
| 197 | + $_GET['title'] = language()->getLine(strtoupper('CLI_MAINTENANCE_TITLE')); |
|
| 198 | + $_GET['message'] = language()->getLine(strtoupper('CLI_MAINTENANCE_MESSAGE')); |
|
| 199 | 199 | } else { |
| 200 | - $_GET[ 'mode' ] = 'default'; |
|
| 201 | - $_GET[ 'lifetime' ] = 300; |
|
| 202 | - $_GET[ 'title' ] = language()->getLine(strtoupper('CLI_MAINTENANCE_TITLE')); |
|
| 203 | - $_GET[ 'message' ] = language()->getLine(strtoupper('CLI_MAINTENANCE_MESSAGE')); |
|
| 200 | + $_GET['mode'] = 'default'; |
|
| 201 | + $_GET['lifetime'] = 300; |
|
| 202 | + $_GET['title'] = language()->getLine(strtoupper('CLI_MAINTENANCE_TITLE')); |
|
| 203 | + $_GET['message'] = language()->getLine(strtoupper('CLI_MAINTENANCE_MESSAGE')); |
|
| 204 | 204 | } |
| 205 | 205 | |
| 206 | 206 | $this->__callOptions(); |
@@ -213,11 +213,11 @@ discard block |
||
| 213 | 213 | (new Format()) |
| 214 | 214 | ->setContextualClass(Format::DANGER) |
| 215 | 215 | ->setString(language()->getLine('CLI_MAINTENANCE_ALREADY_STARTED', [ |
| 216 | - $maintenanceInfo[ 'mode' ], |
|
| 217 | - $maintenanceInfo[ 'datetime' ], |
|
| 218 | - date('r', strtotime($maintenanceInfo[ 'datetime' ]) + $maintenanceInfo[ 'lifetime' ]), |
|
| 219 | - $maintenanceInfo[ 'title' ], |
|
| 220 | - $maintenanceInfo[ 'message' ], |
|
| 216 | + $maintenanceInfo['mode'], |
|
| 217 | + $maintenanceInfo['datetime'], |
|
| 218 | + date('r', strtotime($maintenanceInfo['datetime']) + $maintenanceInfo['lifetime']), |
|
| 219 | + $maintenanceInfo['title'], |
|
| 220 | + $maintenanceInfo['message'], |
|
| 221 | 221 | ])) |
| 222 | 222 | ->setNewLinesAfter(1) |
| 223 | 223 | ); |
@@ -115,8 +115,8 @@ discard block |
||
| 115 | 115 | $options = input()->get(); |
| 116 | 116 | |
| 117 | 117 | if (empty($options)) { |
| 118 | - $_GET[ 'host' ] = 'localhost'; |
|
| 119 | - $_GET[ 'port' ] = 2107; |
|
| 118 | + $_GET['host'] = 'localhost'; |
|
| 119 | + $_GET['port'] = 2107; |
|
| 120 | 120 | } |
| 121 | 121 | |
| 122 | 122 | $this->__callOptions(); |
@@ -128,12 +128,12 @@ discard block |
||
| 128 | 128 | ->setNewLinesAfter(1) |
| 129 | 129 | ); |
| 130 | 130 | |
| 131 | - $_SERVER[ 'DOCUMENT_ROOT' ] = PATH_PUBLIC; |
|
| 131 | + $_SERVER['DOCUMENT_ROOT'] = PATH_PUBLIC; |
|
| 132 | 132 | |
| 133 | 133 | output()->write( |
| 134 | 134 | (new Format()) |
| 135 | 135 | ->setContextualClass(Format::INFO) |
| 136 | - ->setString(language()->getLine('CLI_SERVE_DOC_ROOT', [$_SERVER[ 'DOCUMENT_ROOT' ]])) |
|
| 136 | + ->setString(language()->getLine('CLI_SERVE_DOC_ROOT', [$_SERVER['DOCUMENT_ROOT']])) |
|
| 137 | 137 | ->setNewLinesAfter(1) |
| 138 | 138 | ); |
| 139 | 139 | |
@@ -149,12 +149,12 @@ discard block |
||
| 149 | 149 | * base path to the public folder, and to use the rewrite file |
| 150 | 150 | * to ensure our environment is set and it simulates basic mod_rewrite. |
| 151 | 151 | */ |
| 152 | - passthru('php -S ' . |
|
| 153 | - $this->optionHost . |
|
| 154 | - ':' . |
|
| 155 | - $this->optionPort . |
|
| 156 | - ' -t ' . |
|
| 157 | - str_replace('\\', DIRECTORY_SEPARATOR, DIR_PUBLIC) . ' ' . PATH_ROOT . 'server.php' |
|
| 152 | + passthru('php -S '. |
|
| 153 | + $this->optionHost. |
|
| 154 | + ':'. |
|
| 155 | + $this->optionPort. |
|
| 156 | + ' -t '. |
|
| 157 | + str_replace('\\', DIRECTORY_SEPARATOR, DIR_PUBLIC).' '.PATH_ROOT.'server.php' |
|
| 158 | 158 | ); |
| 159 | 159 | } |
| 160 | 160 | } |
| 161 | 161 | \ No newline at end of file |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | */ |
| 90 | 90 | public function optionFilename($filename) |
| 91 | 91 | { |
| 92 | - $this->optionFilename = str_replace('.phar', '', $filename) . '.phar'; |
|
| 92 | + $this->optionFilename = str_replace('.phar', '', $filename).'.phar'; |
|
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | // ------------------------------------------------------------------------ |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | |
| 118 | 118 | $filename = empty($this->optionFilename) ? 'app.phar' : $this->optionFilename; |
| 119 | 119 | $filename = str_replace('.phar', '', $filename); |
| 120 | - $filePath = PATH_ROOT . 'build' . DIRECTORY_SEPARATOR . $filename; |
|
| 120 | + $filePath = PATH_ROOT.'build'.DIRECTORY_SEPARATOR.$filename; |
|
| 121 | 121 | |
| 122 | 122 | if (ini_get('phar.readonly') == 1 and $this->optionForce === false) { |
| 123 | 123 | output()->write( |
@@ -137,16 +137,16 @@ discard block |
||
| 137 | 137 | ); |
| 138 | 138 | |
| 139 | 139 | // Remove build directory |
| 140 | - $fileDirectory = dirname($filePath) . DIRECTORY_SEPARATOR; |
|
| 140 | + $fileDirectory = dirname($filePath).DIRECTORY_SEPARATOR; |
|
| 141 | 141 | if (is_dir($fileDirectory)) { |
| 142 | 142 | $directoryHandle = opendir($fileDirectory); |
| 143 | - if ( ! $directoryHandle) { |
|
| 143 | + if (!$directoryHandle) { |
|
| 144 | 144 | return false; |
| 145 | 145 | } |
| 146 | 146 | while ($file = readdir($directoryHandle)) { |
| 147 | 147 | if ($file != '.' && $file != '..') { |
| 148 | - if (is_file($fileDirectory . $file)) { |
|
| 149 | - unlink($fileDirectory . $file); |
|
| 148 | + if (is_file($fileDirectory.$file)) { |
|
| 149 | + unlink($fileDirectory.$file); |
|
| 150 | 150 | } |
| 151 | 151 | } |
| 152 | 152 | } |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | rmdir($fileDirectory); |
| 155 | 155 | } |
| 156 | 156 | |
| 157 | - if ( ! is_writable(dirname($filePath))) { |
|
| 157 | + if (!is_writable(dirname($filePath))) { |
|
| 158 | 158 | @mkdir(dirname($filePath), 0777, true); |
| 159 | 159 | |
| 160 | 160 | output()->verbose( |
@@ -166,14 +166,14 @@ discard block |
||
| 166 | 166 | } |
| 167 | 167 | |
| 168 | 168 | try { |
| 169 | - $pharData = new \PharData($filePath . '.tar'); |
|
| 169 | + $pharData = new \PharData($filePath.'.tar'); |
|
| 170 | 170 | $phar = $pharData->convertToExecutable(\Phar::PHAR); |
| 171 | 171 | |
| 172 | 172 | // Build from PATH_ROOT using Recursive Directory Iterator |
| 173 | 173 | $phar->buildFromIterator(new \RecursiveIteratorIterator(new \RecursiveCallbackFilterIterator( |
| 174 | 174 | new \RecursiveDirectoryIterator(PATH_ROOT, |
| 175 | 175 | \FilesystemIterator::SKIP_DOTS | \FilesystemIterator::FOLLOW_SYMLINKS), |
| 176 | - function ($current, $key, $iterator) { |
|
| 176 | + function($current, $key, $iterator) { |
|
| 177 | 177 | if ($current->isDir()) { |
| 178 | 178 | // exclude build directory |
| 179 | 179 | if ($current->getFilename() === 'build') { |
@@ -188,7 +188,7 @@ discard block |
||
| 188 | 188 | $main = 'public/index.php'; |
| 189 | 189 | if (empty($this->optionMain)) { |
| 190 | 190 | // Default Carbon Boilerplate Detection |
| 191 | - if (is_file(PATH_APP . 'console')) { |
|
| 191 | + if (is_file(PATH_APP.'console')) { |
|
| 192 | 192 | $main = 'app/console'; |
| 193 | 193 | |
| 194 | 194 | output()->verbose( |