Consolidation\Cgr\Application::generalCommand PHP Метод

generalCommand() публичный Метод

General command handler.
public generalCommand ( string $composerCommand, string $execPath, array $composerArgs, array $projects, array $options ) : array
$composerCommand string The composer command to run e.g. require
$execPath string The path to composer
$composerArgs array Anything from the global $argv to be passed on to Composer
$projects array A list of projects to install, with the key specifying the project name, and the value specifying its version.
$options array User options from the command line; see $optionDefaultValues in the main() function.
Результат array
    public function generalCommand($composerCommand, $execPath, $composerArgs, $projects, $options)
    {
        $globalBaseDir = $options['base-dir'];
        $binDir = $options['bin-dir'];
        $env = array("COMPOSER_BIN_DIR" => $binDir);
        $result = array();
        foreach ($projects as $project => $version) {
            $installLocation = "{$globalBaseDir}/{$project}";
            $projectWithVersion = $this->projectWithVersion($project, $version);
            $commandToExec = $this->buildGlobalCommand($composerCommand, $execPath, $composerArgs, $projectWithVersion, $env, $installLocation);
            $result[] = $commandToExec;
        }
        return $result;
    }