public function installPackage($packageName, $options = [])
    {
        $process = $this->getProcess();

        $processCommand = trim($this->findComposer() . ' create-project ' . $packageName . ' "' .
                               $this->workingPath . '" ' .
                               $this->prepareOptions($options, ['--no-ansi', '--no-install']));

        $process->setCommandLine($processCommand);
        $this->prepareInstallationDirectory($this->workingPath);

        $this->log->info('Running Composer command', ['command' => $processCommand]);

        $process->run();

        if ($process->isSuccessful() == false) {
            $composerError = $this->parseComposerErrorMessage($process->getErrorOutput());
            $this->log->error('Composer create-project process failure', ['composer' => $composerError]);

            $additionalInformation = '';

            if (Str::contains($process->getErrorOutput(), 'The system cannot find the path specified. (code: 3)')) {
                $additionalInformation = PHP_EOL.PHP_EOL.'Based on the provided error message, the following article may be helpful:'.PHP_EOL.'https://getcomposer.org/doc/articles/troubleshooting.md#-the-system-cannot-find-the-path-specified-windows-';
            }

            throw new PackageInstallationException($process->getErrorOutput(),
                "There was an error installing the package: {$packageName}" . PHP_EOL .
                'Composer is reporting the following error:' . PHP_EOL . '--> ' . $composerError.$additionalInformation);
        }

        return true;
    }
public function installPackage($packageName, $options = [])
    {
        $process = $this->getProcess();

        $processCommand = trim($this->findComposer() . ' create-project ' . $packageName . ' "' .
                               $this->workingPath . '" ' .
                               $this->prepareOptions($options, ['--no-ansi', '--no-install']));

        $process->setCommandLine($processCommand);
        $this->prepareInstallationDirectory($this->workingPath);

        $this->log->info('Running Composer command', ['command' => $processCommand]);

        $process->run();

        if ($process->isSuccessful() == false) {
            $composerError = $this->parseComposerErrorMessage($process->getErrorOutput());
            $this->log->error('Composer create-project process failure', ['composer' => $composerError]);

            $additionalInformation = '';

            if (Str::contains($process->getErrorOutput(), 'The system cannot find the path specified. (code: 3)')) {
                $additionalInformation = PHP_EOL.PHP_EOL.'Based on the provided error message, the following article may be helpful:'.PHP_EOL.'https://getcomposer.org/doc/articles/troubleshooting.md#-the-system-cannot-find-the-path-specified-windows-';
            }

            throw new PackageInstallationException($process->getErrorOutput(),
                "There was an error installing the package: {$packageName}" . PHP_EOL .
                'Composer is reporting the following error:' . PHP_EOL . '--> ' . $composerError.$additionalInformation);
        }

        return true;
    }
public function installPackage ( $ packageName , $ options = [ ] ) { $ process = $ this -> getProcess ( ) ; $ processCommand = trim ( $ this -> findComposer ( ) . ' create-project ' . $ packageName . ' "' . $ this -> workingPath . '" ' . $ this -> prepareOptions ( $ options , [ '--no-ansi' , '--no-install' ] ) ) ; $ process -> setCommandLine ( $ processCommand ) ; $ this -> prepareInstallationDirectory ( $ this -> workingPath ) ; $ this -> log -> info ( 'Running Composer command' , [ 'command' => $ processCommand ] ) ; $ process -> run ( ) ; if ( $ process -> isSuccessful ( ) == false ) { $ composerError = $ this -> parseComposerErrorMessage ( $ process -> getErrorOutput ( ) ) ; $ this -> log -> error ( 'Composer create-project process failure' , [ 'composer' => $ composerError ] ) ; $ additionalInformation = '' ; if ( Str :: contains ( $ process -> getErrorOutput ( ) , 'The system cannot find the path specified. (code: 3)' ) ) { $ additionalInformation = PHP_EOL . PHP_EOL . 'Based on the provided error message, the following article may be helpful:' . PHP_EOL . 'https://getcomposer.org/doc/articles/troubleshooting.md#-the-system-cannot-find-the-path-specified-windows-' ; } throw new PackageInstallationException ( $ process -> getErrorOutput ( ) , "There was an error installing the package: {$packageName}" . PHP_EOL . 'Composer is reporting the following error:' . PHP_EOL . '--> ' . $ composerError . $ additionalInformation ) ; } return true ; }
Installs a Composer package, placing it in NewUp's template storage.

@param        $packageName
@param  array $options
@throws PackageInstallationException
@return bool
Installs a Composer package placing it in NewUp s template storage .