runLocalCommand() final public method

执行本地宿主机命令
final public runLocalCommand ( $command ) : boolean | integer
$command
return boolean | integer true 成功,false 失败
Esempio n. 1
0
 /**
  * upgrade walle 更新walle版本
  *
  * @throws yii\console\Exception
  */
 public function actionUpgrade()
 {
     $commander = new Command(['console']);
     // stash save local change 暂存本地修改
     echo 'stash save local change 暂存本地修改: git stash save ...', PHP_EOL;
     $commander->runLocalCommand('/usr/bin/env git stash save');
     // pull code 更新代码
     echo 'pull code 更新代码: git pull ...', PHP_EOL;
     $commander->runLocalCommand('/usr/bin/env git pull');
     // stash pop local change 弹出暂存本地修改
     echo 'stash pop local change 弹出暂存本地修改: git stash pop ...', PHP_EOL;
     $commander->runLocalCommand('/usr/bin/env git stash pop');
     // init walle 初始化项目
     $this->runAction('setup', ['interactive' => $this->interactive]);
     // checkout the current version查看最新版本
     echo "\n--------------------------------------------------------", PHP_EOL;
     echo "Congratulations To Upgrade. Your Walle Current Version:", PHP_EOL;
     $this->runAction('index', ['interactive' => $this->interactive]);
 }