Platformsh\Cli\Helper\ShellHelperInterface::execute PHP Method

execute() public method

Run a shell command, suppressing errors.
public execute ( array $args, string | false $dir = null, boolean $mustRun = false, boolean $quiet = false ) : string | boolean
$args array
$dir string | false
$mustRun boolean
$quiet boolean
return string | boolean The command's output or true on success, false on failure.
    public function execute(array $args, $dir = null, $mustRun = false, $quiet = false);

Usage Example

コード例 #1
0
ファイル: GitHelper.php プロジェクト: ecolinet/platformsh-cli
 /**
  * Execute a Git command.
  *
  * @param string[]     $args
  *   Command arguments (everything after 'git').
  * @param string|false $dir
  *   The path to a Git repository. Set to false if the command should not
  *   run inside a repository.
  * @param bool         $mustRun
  *   Enable exceptions if the Git command fails.
  * @param bool         $quiet
  *   Suppress command output.
  *
  * @throws \RuntimeException If the repository directory is invalid.
  *
  * @return string|bool
  */
 public function execute(array $args, $dir = null, $mustRun = false, $quiet = true)
 {
     // If enabled, set the working directory to the repository.
     if ($dir !== false) {
         $dir = $dir ?: $this->repositoryDir;
     }
     // Run the command.
     array_unshift($args, 'git');
     return $this->shellHelper->execute($args, $dir, $mustRun, $quiet);
 }
All Usage Examples Of Platformsh\Cli\Helper\ShellHelperInterface::execute