Commit bd24a9e87794b37dbdcbe46cbebcf6dcd85a623b
1 parent
de07a276
v0.0.2-stable
Showing
1 changed file
with
8 additions
and
4 deletions
Show diff stats
Initializer.php
| @@ -76,6 +76,7 @@ | @@ -76,6 +76,7 @@ | ||
| 76 | * * --defaultuser - Whether to use default user creation | 76 | * * --defaultuser - Whether to use default user creation |
| 77 | * * --o - Webpage to open after intallaction process | 77 | * * --o - Webpage to open after intallaction process |
| 78 | * * --fun - Run HOLLYWOOD BABY!!! | 78 | * * --fun - Run HOLLYWOOD BABY!!! |
| 79 | + * * --phppath - Path to execute php script | ||
| 79 | * | 80 | * |
| 80 | * @see Initializer::getInstance() | 81 | * @see Initializer::getInstance() |
| 81 | */ | 82 | */ |
| @@ -942,7 +943,8 @@ | @@ -942,7 +943,8 @@ | ||
| 942 | if (empty( $migrationPath )) { | 943 | if (empty( $migrationPath )) { |
| 943 | $migrationPath = 'vendor/artweb/artbox-core/migrations'; | 944 | $migrationPath = 'vendor/artweb/artbox-core/migrations'; |
| 944 | } | 945 | } |
| 945 | - $result = exec("php yii migrate --migrationPath=$migrationPath --interactive=0", $output, $return); | 946 | + $phppath = $this->getParamValue('phppath') ? : 'php'; |
| 947 | + $result = exec("$phppath yii migrate --migrationPath=$migrationPath --interactive=0", $output, $return); | ||
| 946 | if ($return !== 0) { | 948 | if ($return !== 0) { |
| 947 | $this->printError("Migration cannot be applied. Run it manually to check the reason"); | 949 | $this->printError("Migration cannot be applied. Run it manually to check the reason"); |
| 948 | exit( 1 ); | 950 | exit( 1 ); |
| @@ -970,6 +972,7 @@ | @@ -970,6 +972,7 @@ | ||
| 970 | private function createUser() | 972 | private function createUser() |
| 971 | { | 973 | { |
| 972 | $params = $this->getParams(); | 974 | $params = $this->getParams(); |
| 975 | + $phppath = $this->getParamValue('phppath') ? : 'php'; | ||
| 973 | if (!isset( $params[ 'defaultuser' ] )) { | 976 | if (!isset( $params[ 'defaultuser' ] )) { |
| 974 | if ($this->getParamValue('user') == 'no') { | 977 | if ($this->getParamValue('user') == 'no') { |
| 975 | echo $this->formatMessage( | 978 | echo $this->formatMessage( |
| @@ -1002,9 +1005,9 @@ | @@ -1002,9 +1005,9 @@ | ||
| 1002 | echo "\n Enter password: "; | 1005 | echo "\n Enter password: "; |
| 1003 | $password = trim(fgets(STDIN)); | 1006 | $password = trim(fgets(STDIN)); |
| 1004 | echo "\n"; | 1007 | echo "\n"; |
| 1005 | - $result = exec("php yii create/user $username $email $password", $output, $return); | 1008 | + $result = exec("$phppath yii create/user $username $email $password", $output, $return); |
| 1006 | } else { | 1009 | } else { |
| 1007 | - $result = exec("php yii create/user", $output, $return); | 1010 | + $result = exec("$phppath yii create/user", $output, $return); |
| 1008 | } | 1011 | } |
| 1009 | $this->handleUserCreation($result, $output, $return); | 1012 | $this->handleUserCreation($result, $output, $return); |
| 1010 | } | 1013 | } |
| @@ -1071,7 +1074,8 @@ | @@ -1071,7 +1074,8 @@ | ||
| 1071 | } | 1074 | } |
| 1072 | $filename = "db{$this->db['dbtype']}.php"; | 1075 | $filename = "db{$this->db['dbtype']}.php"; |
| 1073 | $fullpath = "{$path}/{$filename}"; | 1076 | $fullpath = "{$path}/{$filename}"; |
| 1074 | - exec("php yii check/connection {$fullpath}", $output, $return); | 1077 | + $phppath = $this->getParamValue('phppath') ? : 'php'; |
| 1078 | + exec("$phppath yii check/connection {$fullpath}", $output, $return); | ||
| 1075 | if ($return > 0) { | 1079 | if ($return > 0) { |
| 1076 | if (isset( $params[ 'dbinit' ] )) { | 1080 | if (isset( $params[ 'dbinit' ] )) { |
| 1077 | throw new Exception("Couldn't connect to the database"); | 1081 | throw new Exception("Couldn't connect to the database"); |