@@ -11,9 +11,9 @@ discard block |
||
| 11 | 11 | class Installer |
| 12 | 12 | { |
| 13 | 13 | private $silent = false; |
| 14 | - private $app_dir = 'application'; // -a DIRECTORY |
|
| 15 | - private $pub_dir = 'public'; // -p DIRECTORY |
|
| 16 | - private $test_dir = null; // -t DIRECTORY |
|
| 14 | + private $app_dir = 'application'; // -a DIRECTORY |
|
| 15 | + private $pub_dir = 'public'; // -p DIRECTORY |
|
| 16 | + private $test_dir = null; // -t DIRECTORY |
|
| 17 | 17 | |
| 18 | 18 | public function __construct($argv) |
| 19 | 19 | { |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | for ($i = 1; $i <= $argc; $i++) { |
| 32 | - if (! isset($argv[$i])) { |
|
| 32 | + if ( ! isset($argv[$i])) { |
|
| 33 | 33 | break; |
| 34 | 34 | } |
| 35 | 35 | |
@@ -41,29 +41,29 @@ discard block |
||
| 41 | 41 | |
| 42 | 42 | // php install.php -a application |
| 43 | 43 | case '-a': |
| 44 | - if (is_dir($argv[$i+1])) { |
|
| 45 | - $this->app_dir = $argv[$i+1]; |
|
| 44 | + if (is_dir($argv[$i + 1])) { |
|
| 45 | + $this->app_dir = $argv[$i + 1]; |
|
| 46 | 46 | } else { |
| 47 | - throw new Exception('No such application directory: '.$argv[$i+1]); |
|
| 47 | + throw new Exception('No such application directory: '.$argv[$i + 1]); |
|
| 48 | 48 | } |
| 49 | 49 | $i++; |
| 50 | 50 | break; |
| 51 | 51 | |
| 52 | 52 | // php install.php -p public |
| 53 | 53 | case '-p': |
| 54 | - if (is_dir($argv[$i+1])) { |
|
| 55 | - $this->pub_dir = $argv[$i+1]; |
|
| 54 | + if (is_dir($argv[$i + 1])) { |
|
| 55 | + $this->pub_dir = $argv[$i + 1]; |
|
| 56 | 56 | } else { |
| 57 | - throw new Exception('No such public directory: '.$argv[$i+1]); |
|
| 57 | + throw new Exception('No such public directory: '.$argv[$i + 1]); |
|
| 58 | 58 | } |
| 59 | 59 | $i++; |
| 60 | 60 | break; |
| 61 | 61 | // php install.php -t application/tests |
| 62 | 62 | case '-t': |
| 63 | - if (is_dir($argv[$i+1])) { |
|
| 64 | - $this->test_dir = $argv[$i+1]; |
|
| 63 | + if (is_dir($argv[$i + 1])) { |
|
| 64 | + $this->test_dir = $argv[$i + 1]; |
|
| 65 | 65 | } else { |
| 66 | - throw new Exception('No such test directory: '.$argv[$i+1]); |
|
| 66 | + throw new Exception('No such test directory: '.$argv[$i + 1]); |
|
| 67 | 67 | } |
| 68 | 68 | $i++; |
| 69 | 69 | break; |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | $file = $this->test_dir.'/Bootstrap.php'; |
| 95 | 95 | $contents = file_get_contents($file); |
| 96 | 96 | |
| 97 | - if (! file_exists('system')) { |
|
| 97 | + if ( ! file_exists('system')) { |
|
| 98 | 98 | if (file_exists('vendor/codeigniter/framework/system')) { |
| 99 | 99 | $contents = str_replace( |
| 100 | 100 | '$system_path = \'../../system\';', |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | } |
| 107 | 107 | } |
| 108 | 108 | |
| 109 | - if (! file_exists('index.php')) { |
|
| 109 | + if ( ! file_exists('index.php')) { |
|
| 110 | 110 | if (file_exists($this->pub_dir.'/index.php')) { |
| 111 | 111 | // CodeIgniter 3.0.6 and after |
| 112 | 112 | $contents = str_replace( |
@@ -179,7 +179,7 @@ discard block |
||
| 179 | 179 | } else { |
| 180 | 180 | $success = copy($file, $dst.'/'.$iterator->getSubPathName()); |
| 181 | 181 | if ($success) { |
| 182 | - if (! $this->silent) { |
|
| 182 | + if ( ! $this->silent) { |
|
| 183 | 183 | echo 'copied: '.$dst.'/'.$iterator->getSubPathName().PHP_EOL; |
| 184 | 184 | } |
| 185 | 185 | } |