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 | 76 | * * --defaultuser - Whether to use default user creation |
| 77 | 77 | * * --o - Webpage to open after intallaction process |
| 78 | 78 | * * --fun - Run HOLLYWOOD BABY!!! |
| 79 | + * * --phppath - Path to execute php script | |
| 79 | 80 | * |
| 80 | 81 | * @see Initializer::getInstance() |
| 81 | 82 | */ |
| ... | ... | @@ -942,7 +943,8 @@ |
| 942 | 943 | if (empty( $migrationPath )) { |
| 943 | 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 | 948 | if ($return !== 0) { |
| 947 | 949 | $this->printError("Migration cannot be applied. Run it manually to check the reason"); |
| 948 | 950 | exit( 1 ); |
| ... | ... | @@ -970,6 +972,7 @@ |
| 970 | 972 | private function createUser() |
| 971 | 973 | { |
| 972 | 974 | $params = $this->getParams(); |
| 975 | + $phppath = $this->getParamValue('phppath') ? : 'php'; | |
| 973 | 976 | if (!isset( $params[ 'defaultuser' ] )) { |
| 974 | 977 | if ($this->getParamValue('user') == 'no') { |
| 975 | 978 | echo $this->formatMessage( |
| ... | ... | @@ -1002,9 +1005,9 @@ |
| 1002 | 1005 | echo "\n Enter password: "; |
| 1003 | 1006 | $password = trim(fgets(STDIN)); |
| 1004 | 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 | 1009 | } else { |
| 1007 | - $result = exec("php yii create/user", $output, $return); | |
| 1010 | + $result = exec("$phppath yii create/user", $output, $return); | |
| 1008 | 1011 | } |
| 1009 | 1012 | $this->handleUserCreation($result, $output, $return); |
| 1010 | 1013 | } |
| ... | ... | @@ -1071,7 +1074,8 @@ |
| 1071 | 1074 | } |
| 1072 | 1075 | $filename = "db{$this->db['dbtype']}.php"; |
| 1073 | 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 | 1079 | if ($return > 0) { |
| 1076 | 1080 | if (isset( $params[ 'dbinit' ] )) { |
| 1077 | 1081 | throw new Exception("Couldn't connect to the database"); | ... | ... |