@@ -34,10 +34,10 @@ |
||
| 34 | 34 | public function optionVersion() |
| 35 | 35 | { |
| 36 | 36 | if (property_exists($this, 'version')) { |
| 37 | - if ( ! empty($this->version)) { |
|
| 37 | + if (!empty($this->version)) { |
|
| 38 | 38 | output()->write( |
| 39 | 39 | (new Format()) |
| 40 | - ->setString($this->name . ' v' . $this->version . ' Copyright (c) 2011 - ' . date('Y') . ' Steeve Andrian Salim') |
|
| 40 | + ->setString($this->name.' v'.$this->version.' Copyright (c) 2011 - '.date('Y').' Steeve Andrian Salim') |
|
| 41 | 41 | ->setNewLinesAfter(1) |
| 42 | 42 | ); |
| 43 | 43 | |
@@ -50,12 +50,12 @@ discard block |
||
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | if (strpos($this->optionPath, 'Libraries') === false) { |
| 53 | - $filePath = $this->optionPath . 'Libraries' . DIRECTORY_SEPARATOR . $this->optionFilename; |
|
| 53 | + $filePath = $this->optionPath.'Libraries'.DIRECTORY_SEPARATOR.$this->optionFilename; |
|
| 54 | 54 | } else { |
| 55 | - $filePath = $this->optionPath . $this->optionFilename; |
|
| 55 | + $filePath = $this->optionPath.$this->optionFilename; |
|
| 56 | 56 | } |
| 57 | 57 | |
| 58 | - if ( ! is_dir(dirname($filePath))) { |
|
| 58 | + if (!is_dir(dirname($filePath))) { |
|
| 59 | 59 | mkdir(dirname($filePath), 0777, true); |
| 60 | 60 | } |
| 61 | 61 | |
@@ -75,19 +75,19 @@ discard block |
||
| 75 | 75 | |
| 76 | 76 | $classNamespace = loader()->getDirNamespace( |
| 77 | 77 | $namespaceDirectory |
| 78 | - ) . 'Libraries' . (empty($subNamespace) |
|
| 78 | + ).'Libraries'.(empty($subNamespace) |
|
| 79 | 79 | ? null |
| 80 | 80 | : str_replace( |
| 81 | 81 | '/', |
| 82 | 82 | '\\', |
| 83 | 83 | $subNamespace |
| 84 | - )) . '\\'; |
|
| 84 | + )).'\\'; |
|
| 85 | 85 | |
| 86 | - $vars[ 'CREATE_DATETIME' ] = date('d/m/Y H:m'); |
|
| 87 | - $vars[ 'NAMESPACE' ] = trim($classNamespace, '\\'); |
|
| 88 | - $vars[ 'PACKAGE' ] = '\\' . trim($classNamespace, '\\'); |
|
| 89 | - $vars[ 'CLASS' ] = $className; |
|
| 90 | - $vars[ 'FILEPATH' ] = $filePath; |
|
| 86 | + $vars['CREATE_DATETIME'] = date('d/m/Y H:m'); |
|
| 87 | + $vars['NAMESPACE'] = trim($classNamespace, '\\'); |
|
| 88 | + $vars['PACKAGE'] = '\\'.trim($classNamespace, '\\'); |
|
| 89 | + $vars['CLASS'] = $className; |
|
| 90 | + $vars['FILEPATH'] = $filePath; |
|
| 91 | 91 | |
| 92 | 92 | $phpTemplate = <<<PHPTEMPLATE |
| 93 | 93 | <?php |
@@ -50,12 +50,12 @@ discard block |
||
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | if (strpos($this->optionPath, 'Config') === false) { |
| 53 | - $filePath = $this->optionPath . 'Config' . DIRECTORY_SEPARATOR . $this->optionFilename; |
|
| 53 | + $filePath = $this->optionPath.'Config'.DIRECTORY_SEPARATOR.$this->optionFilename; |
|
| 54 | 54 | } else { |
| 55 | - $filePath = $this->optionPath . $this->optionFilename; |
|
| 55 | + $filePath = $this->optionPath.$this->optionFilename; |
|
| 56 | 56 | } |
| 57 | 57 | |
| 58 | - if ( ! is_dir(dirname($filePath))) { |
|
| 58 | + if (!is_dir(dirname($filePath))) { |
|
| 59 | 59 | mkdir(dirname($filePath), 777, true); |
| 60 | 60 | } |
| 61 | 61 | |
@@ -70,9 +70,9 @@ discard block |
||
| 70 | 70 | exit(EXIT_ERROR); |
| 71 | 71 | } |
| 72 | 72 | |
| 73 | - $vars[ 'CREATE_DATETIME' ] = date('d/m/Y H:m'); |
|
| 74 | - $vars[ 'CONFIG' ] = '$' . camelcase(pathinfo($filePath, PATHINFO_FILENAME)); |
|
| 75 | - $vars[ 'FILEPATH' ] = $filePath; |
|
| 73 | + $vars['CREATE_DATETIME'] = date('d/m/Y H:m'); |
|
| 74 | + $vars['CONFIG'] = '$'.camelcase(pathinfo($filePath, PATHINFO_FILENAME)); |
|
| 75 | + $vars['FILEPATH'] = $filePath; |
|
| 76 | 76 | |
| 77 | 77 | $phpTemplate = <<<PHPTEMPLATE |
| 78 | 78 | <?php |
@@ -50,12 +50,12 @@ discard block |
||
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | if (strpos($this->optionPath, 'Helpers') === false) { |
| 53 | - $filePath = $this->optionPath . 'Helpers' . DIRECTORY_SEPARATOR . $this->optionFilename; |
|
| 53 | + $filePath = $this->optionPath.'Helpers'.DIRECTORY_SEPARATOR.$this->optionFilename; |
|
| 54 | 54 | } else { |
| 55 | - $filePath = $this->optionPath . $this->optionFilename; |
|
| 55 | + $filePath = $this->optionPath.$this->optionFilename; |
|
| 56 | 56 | } |
| 57 | 57 | |
| 58 | - if ( ! is_dir(dirname($filePath))) { |
|
| 58 | + if (!is_dir(dirname($filePath))) { |
|
| 59 | 59 | mkdir(dirname($filePath), 0777, true); |
| 60 | 60 | } |
| 61 | 61 | |
@@ -70,13 +70,13 @@ discard block |
||
| 70 | 70 | exit(EXIT_ERROR); |
| 71 | 71 | } |
| 72 | 72 | |
| 73 | - $vars[ 'CREATE_DATETIME' ] = date('d/m/Y H:m'); |
|
| 74 | - $vars[ 'HELPER' ] = underscore( |
|
| 73 | + $vars['CREATE_DATETIME'] = date('d/m/Y H:m'); |
|
| 74 | + $vars['HELPER'] = underscore( |
|
| 75 | 75 | snakecase( |
| 76 | 76 | pathinfo($filePath, PATHINFO_FILENAME) |
| 77 | 77 | ) |
| 78 | 78 | ); |
| 79 | - $vars[ 'FILEPATH' ] = $filePath; |
|
| 79 | + $vars['FILEPATH'] = $filePath; |
|
| 80 | 80 | |
| 81 | 81 | $phpTemplate = <<<PHPTEMPLATE |
| 82 | 82 | <?php |
@@ -55,12 +55,12 @@ discard block |
||
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | if (strpos($this->optionPath, 'Models') === false) { |
| 58 | - $filePath = $this->optionPath . 'Models' . DIRECTORY_SEPARATOR . $this->optionFilename; |
|
| 58 | + $filePath = $this->optionPath.'Models'.DIRECTORY_SEPARATOR.$this->optionFilename; |
|
| 59 | 59 | } else { |
| 60 | - $filePath = $this->optionPath . $this->optionFilename; |
|
| 60 | + $filePath = $this->optionPath.$this->optionFilename; |
|
| 61 | 61 | } |
| 62 | 62 | |
| 63 | - if ( ! is_dir(dirname($filePath))) { |
|
| 63 | + if (!is_dir(dirname($filePath))) { |
|
| 64 | 64 | mkdir(dirname($filePath), 0777, true); |
| 65 | 65 | } |
| 66 | 66 | |
@@ -80,22 +80,22 @@ discard block |
||
| 80 | 80 | |
| 81 | 81 | $classNamespace = loader()->getDirNamespace( |
| 82 | 82 | $namespaceDirectory |
| 83 | - ) . 'Models' . (empty($subNamespace) |
|
| 83 | + ).'Models'.(empty($subNamespace) |
|
| 84 | 84 | ? null |
| 85 | 85 | : str_replace( |
| 86 | 86 | '/', |
| 87 | 87 | '\\', |
| 88 | 88 | $subNamespace |
| 89 | - )) . '\\'; |
|
| 89 | + )).'\\'; |
|
| 90 | 90 | |
| 91 | 91 | $isUseORM = empty($this->isUseORM) ? false : true; |
| 92 | 92 | |
| 93 | - $vars[ 'CREATE_DATETIME' ] = date('d/m/Y H:m'); |
|
| 94 | - $vars[ 'NAMESPACE' ] = trim($classNamespace, '\\'); |
|
| 95 | - $vars[ 'PACKAGE' ] = '\\' . trim($classNamespace, '\\'); |
|
| 96 | - $vars[ 'CLASS' ] = $className; |
|
| 97 | - $vars[ 'FILEPATH' ] = $filePath; |
|
| 98 | - $vars[ 'EXTEND' ] = $isUseORM |
|
| 93 | + $vars['CREATE_DATETIME'] = date('d/m/Y H:m'); |
|
| 94 | + $vars['NAMESPACE'] = trim($classNamespace, '\\'); |
|
| 95 | + $vars['PACKAGE'] = '\\'.trim($classNamespace, '\\'); |
|
| 96 | + $vars['CLASS'] = $className; |
|
| 97 | + $vars['FILEPATH'] = $filePath; |
|
| 98 | + $vars['EXTEND'] = $isUseORM |
|
| 99 | 99 | ? 'Orm' |
| 100 | 100 | : 'Reactor'; |
| 101 | 101 | |
@@ -50,12 +50,12 @@ discard block |
||
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | if (strpos($this->optionPath, 'Controllers') === false) { |
| 53 | - $filePath = $this->optionPath . 'Controllers' . DIRECTORY_SEPARATOR . $this->optionFilename; |
|
| 53 | + $filePath = $this->optionPath.'Controllers'.DIRECTORY_SEPARATOR.$this->optionFilename; |
|
| 54 | 54 | } else { |
| 55 | - $filePath = $this->optionPath . $this->optionFilename; |
|
| 55 | + $filePath = $this->optionPath.$this->optionFilename; |
|
| 56 | 56 | } |
| 57 | 57 | |
| 58 | - if ( ! is_dir(dirname($filePath))) { |
|
| 58 | + if (!is_dir(dirname($filePath))) { |
|
| 59 | 59 | mkdir(dirname($filePath), 777, true); |
| 60 | 60 | } |
| 61 | 61 | |
@@ -75,19 +75,19 @@ discard block |
||
| 75 | 75 | |
| 76 | 76 | $classNamespace = loader()->getDirNamespace( |
| 77 | 77 | $namespaceDirectory |
| 78 | - ) . 'Controllers' . (empty($subNamespace) |
|
| 78 | + ).'Controllers'.(empty($subNamespace) |
|
| 79 | 79 | ? null |
| 80 | 80 | : str_replace( |
| 81 | 81 | '/', |
| 82 | 82 | '\\', |
| 83 | 83 | $subNamespace |
| 84 | - )) . '\\'; |
|
| 84 | + )).'\\'; |
|
| 85 | 85 | |
| 86 | - $vars[ 'CREATE_DATETIME' ] = date('d/m/Y H:m'); |
|
| 87 | - $vars[ 'NAMESPACE' ] = trim($classNamespace, '\\'); |
|
| 88 | - $vars[ 'PACKAGE' ] = '\\' . trim($classNamespace, '\\'); |
|
| 89 | - $vars[ 'CLASS' ] = $className; |
|
| 90 | - $vars[ 'FILEPATH' ] = $filePath; |
|
| 86 | + $vars['CREATE_DATETIME'] = date('d/m/Y H:m'); |
|
| 87 | + $vars['NAMESPACE'] = trim($classNamespace, '\\'); |
|
| 88 | + $vars['PACKAGE'] = '\\'.trim($classNamespace, '\\'); |
|
| 89 | + $vars['CLASS'] = $className; |
|
| 90 | + $vars['FILEPATH'] = $filePath; |
|
| 91 | 91 | |
| 92 | 92 | $phpTemplate = <<<PHPTEMPLATE |
| 93 | 93 | <?php |
@@ -142,11 +142,11 @@ |
||
| 142 | 142 | if (in_array($type, ['modules', 'languages'])) { |
| 143 | 143 | switch ($type) { |
| 144 | 144 | case 'modules': |
| 145 | - $line = PHP_EOL . print_r(modules()->getRegistry(), true); |
|
| 145 | + $line = PHP_EOL.print_r(modules()->getRegistry(), true); |
|
| 146 | 146 | break; |
| 147 | 147 | |
| 148 | 148 | case 'languages': |
| 149 | - $line = PHP_EOL . print_r(language()->getRegistry(), true); |
|
| 149 | + $line = PHP_EOL.print_r(language()->getRegistry(), true); |
|
| 150 | 150 | break; |
| 151 | 151 | } |
| 152 | 152 | |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | |
| 134 | 134 | public function optionLifetime($lifetime) |
| 135 | 135 | { |
| 136 | - $this->optionLifetime = (int)$lifetime; |
|
| 136 | + $this->optionLifetime = (int) $lifetime; |
|
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | public function optionTitle($title) |
@@ -151,16 +151,16 @@ discard block |
||
| 151 | 151 | $options = input()->get(); |
| 152 | 152 | |
| 153 | 153 | if (empty($options)) { |
| 154 | - $_GET[ 'switch' ] = 'ON'; |
|
| 155 | - $_GET[ 'mode' ] = 'default'; |
|
| 156 | - $_GET[ 'lifetime' ] = 300; |
|
| 157 | - $_GET[ 'title' ] = language()->getLine(strtoupper('CLI_MAINTENANCE_TITLE')); |
|
| 158 | - $_GET[ 'message' ] = language()->getLine(strtoupper('CLI_MAINTENANCE_MESSAGE')); |
|
| 154 | + $_GET['switch'] = 'ON'; |
|
| 155 | + $_GET['mode'] = 'default'; |
|
| 156 | + $_GET['lifetime'] = 300; |
|
| 157 | + $_GET['title'] = language()->getLine(strtoupper('CLI_MAINTENANCE_TITLE')); |
|
| 158 | + $_GET['message'] = language()->getLine(strtoupper('CLI_MAINTENANCE_MESSAGE')); |
|
| 159 | 159 | } else { |
| 160 | - $_GET[ 'mode' ] = 'default'; |
|
| 161 | - $_GET[ 'lifetime' ] = 300; |
|
| 162 | - $_GET[ 'title' ] = language()->getLine(strtoupper('CLI_MAINTENANCE_TITLE')); |
|
| 163 | - $_GET[ 'message' ] = language()->getLine(strtoupper('CLI_MAINTENANCE_MESSAGE')); |
|
| 160 | + $_GET['mode'] = 'default'; |
|
| 161 | + $_GET['lifetime'] = 300; |
|
| 162 | + $_GET['title'] = language()->getLine(strtoupper('CLI_MAINTENANCE_TITLE')); |
|
| 163 | + $_GET['message'] = language()->getLine(strtoupper('CLI_MAINTENANCE_MESSAGE')); |
|
| 164 | 164 | } |
| 165 | 165 | |
| 166 | 166 | parent::execute(); |
@@ -173,11 +173,11 @@ discard block |
||
| 173 | 173 | (new Format()) |
| 174 | 174 | ->setContextualClass(Format::DANGER) |
| 175 | 175 | ->setString(language()->getLine('CLI_MAINTENANCE_ALREADY_STARTED', [ |
| 176 | - $maintenanceInfo[ 'mode' ], |
|
| 177 | - $maintenanceInfo[ 'datetime' ], |
|
| 178 | - date('r', strtotime($maintenanceInfo[ 'datetime' ]) + $maintenanceInfo[ 'lifetime' ]), |
|
| 179 | - $maintenanceInfo[ 'title' ], |
|
| 180 | - $maintenanceInfo[ 'message' ], |
|
| 176 | + $maintenanceInfo['mode'], |
|
| 177 | + $maintenanceInfo['datetime'], |
|
| 178 | + date('r', strtotime($maintenanceInfo['datetime']) + $maintenanceInfo['lifetime']), |
|
| 179 | + $maintenanceInfo['title'], |
|
| 180 | + $maintenanceInfo['message'], |
|
| 181 | 181 | ])) |
| 182 | 182 | ->setNewLinesAfter(1) |
| 183 | 183 | ); |
@@ -94,8 +94,8 @@ discard block |
||
| 94 | 94 | $options = input()->get(); |
| 95 | 95 | |
| 96 | 96 | if (empty($options)) { |
| 97 | - $_GET[ 'host' ] = 'localhost'; |
|
| 98 | - $_GET[ 'port' ] = 8000; |
|
| 97 | + $_GET['host'] = 'localhost'; |
|
| 98 | + $_GET['port'] = 8000; |
|
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | parent::execute(); |
@@ -107,12 +107,12 @@ discard block |
||
| 107 | 107 | ->setNewLinesAfter(1) |
| 108 | 108 | ); |
| 109 | 109 | |
| 110 | - $_SERVER[ 'DOCUMENT_ROOT' ] = PATH_PUBLIC; |
|
| 110 | + $_SERVER['DOCUMENT_ROOT'] = PATH_PUBLIC; |
|
| 111 | 111 | |
| 112 | 112 | output()->write( |
| 113 | 113 | (new Format()) |
| 114 | 114 | ->setContextualClass(Format::INFO) |
| 115 | - ->setString(language()->getLine('CLI_SERVE_DOC_ROOT', [$_SERVER[ 'DOCUMENT_ROOT' ]])) |
|
| 115 | + ->setString(language()->getLine('CLI_SERVE_DOC_ROOT', [$_SERVER['DOCUMENT_ROOT']])) |
|
| 116 | 116 | ->setNewLinesAfter(1) |
| 117 | 117 | ); |
| 118 | 118 | |
@@ -128,12 +128,12 @@ discard block |
||
| 128 | 128 | * base path to the public folder, and to use the rewrite file |
| 129 | 129 | * to ensure our environment is set and it simulates basic mod_rewrite. |
| 130 | 130 | */ |
| 131 | - passthru('php -S ' . |
|
| 132 | - $this->optionHost . |
|
| 133 | - ':' . |
|
| 134 | - $this->optionPort . |
|
| 135 | - ' -t ' . |
|
| 136 | - str_replace('\\', DIRECTORY_SEPARATOR, DIR_PUBLIC) . ' ' . PATH_ROOT . 'server.php' |
|
| 131 | + passthru('php -S '. |
|
| 132 | + $this->optionHost. |
|
| 133 | + ':'. |
|
| 134 | + $this->optionPort. |
|
| 135 | + ' -t '. |
|
| 136 | + str_replace('\\', DIRECTORY_SEPARATOR, DIR_PUBLIC).' '.PATH_ROOT.'server.php' |
|
| 137 | 137 | ); |
| 138 | 138 | } |
| 139 | 139 | } |
| 140 | 140 | \ No newline at end of file |