buildOptions() public static method

Option, which does not use any value should be specified as an array value, option with value should be specified as key-value pair, where key is an option name and value - option value. Option name will be automatically prefixed with -- in case it has not already. For example: php [ 'verbose', 'username' => 'root' ]
Since: 1.0.2
public static buildOptions ( array $options ) : string
$options array options specification.
return string options string.
コード例 #1
0
 /**
  * Performs vendors update via Composer at all [[composerRootPaths]].
  */
 protected function updateVendor()
 {
     $options = Shell::buildOptions(array_merge($this->composerOptions, ['no-interaction']));
     foreach ($this->composerRootPaths as $path) {
         $this->execShellCommand('(cd {composerRoot}; {composer} install ' . $options . ')', ['{composerRoot}' => Yii::getAlias($path), '{composer}' => Yii::getAlias($this->composerBinPath)]);
     }
 }