diff --git a/Initializer.php b/Initializer.php index 5cdac3e..097bd64 100644 --- a/Initializer.php +++ b/Initializer.php @@ -76,6 +76,7 @@ * * --defaultuser - Whether to use default user creation * * --o - Webpage to open after intallaction process * * --fun - Run HOLLYWOOD BABY!!! + * * --phppath - Path to execute php script * * @see Initializer::getInstance() */ @@ -942,7 +943,8 @@ if (empty( $migrationPath )) { $migrationPath = 'vendor/artweb/artbox-core/migrations'; } - $result = exec("php yii migrate --migrationPath=$migrationPath --interactive=0", $output, $return); + $phppath = $this->getParamValue('phppath') ? : 'php'; + $result = exec("$phppath yii migrate --migrationPath=$migrationPath --interactive=0", $output, $return); if ($return !== 0) { $this->printError("Migration cannot be applied. Run it manually to check the reason"); exit( 1 ); @@ -970,6 +972,7 @@ private function createUser() { $params = $this->getParams(); + $phppath = $this->getParamValue('phppath') ? : 'php'; if (!isset( $params[ 'defaultuser' ] )) { if ($this->getParamValue('user') == 'no') { echo $this->formatMessage( @@ -1002,9 +1005,9 @@ echo "\n Enter password: "; $password = trim(fgets(STDIN)); echo "\n"; - $result = exec("php yii create/user $username $email $password", $output, $return); + $result = exec("$phppath yii create/user $username $email $password", $output, $return); } else { - $result = exec("php yii create/user", $output, $return); + $result = exec("$phppath yii create/user", $output, $return); } $this->handleUserCreation($result, $output, $return); } @@ -1071,7 +1074,8 @@ } $filename = "db{$this->db['dbtype']}.php"; $fullpath = "{$path}/{$filename}"; - exec("php yii check/connection {$fullpath}", $output, $return); + $phppath = $this->getParamValue('phppath') ? : 'php'; + exec("$phppath yii check/connection {$fullpath}", $output, $return); if ($return > 0) { if (isset( $params[ 'dbinit' ] )) { throw new Exception("Couldn't connect to the database"); -- libgit2 0.21.4