dev/src/Split/Command.php
protected function execute(InputInterface $input, OutputInterface $output)
    {
        if (PHP_VERSION_ID < 50600) {
            throw new \RuntimeException('This command is only available in PHP 5.6 and later.');
        }

        $execDir = $this->rootPath . '/' . self::EXEC_DIR;
        $token = $this->githubToken($input->getOption('token'));

        $shell = new RunShell;
        $guzzle = $this->guzzleClient();
        $github = $this->githubClient($output, $shell, $guzzle, $token);
        $split = $this->splitWrapper($output, $shell);

        @mkdir($execDir);

        $splitBinaryPath = $this->splitshInstall($output, $shell, $execDir, $input->getOption('splitsh'));

        $componentId = $input->getOption('component');
        $components = $this->componentManager->componentsExtra($componentId);

        // remove umbrella component.
        $components = array_filter($components, function ($component, $key) {
            return $key !== 'google-cloud';
        }, ARRAY_FILTER_USE_BOTH);

        $manifestPath = $this->rootPath . '/docs/manifest.json';

        $parentTagSource = sprintf(self::PARENT_TAG_NAME, $input->getArgument('parent'));

        $errors = [];
        foreach ($components as $component) {
            $res = $this->processComponent($output, $github, $split, $component, $splitBinaryPath, $parentTagSource);
            if (!$res) {
                $errors[] = $component['id'];
            }

            $output->writeln('');
            $output->writeln('');
        }

        if ($errors) {
            $output->writeln('<error>[ERROR]</error>: One or more components reported an error.');
            $output->writeln('Please correct errors and try again.');
            $output->writeln('Error component(s): ' . implode(', ', $errors));

            return 1;
        }

        return 0;
    }
protected function execute(InputInterface $input, OutputInterface $output)
    {
        if (PHP_VERSION_ID < 50600) {
            throw new \RuntimeException('This command is only available in PHP 5.6 and later.');
        }

        $execDir = $this->rootPath . '/' . self::EXEC_DIR;
        $token = $this->githubToken($input->getOption('token'));

        $shell = new RunShell;
        $guzzle = $this->guzzleClient();
        $github = $this->githubClient($output, $shell, $guzzle, $token);
        $split = $this->splitWrapper($output, $shell);

        @mkdir($execDir);

        $splitBinaryPath = $this->splitshInstall($output, $shell, $execDir, $input->getOption('splitsh'));

        $componentId = $input->getOption('component');
        $components = $this->componentManager->componentsExtra($componentId);

        // remove umbrella component.
        $components = array_filter($components, function ($component, $key) {
            return $key !== 'google-cloud';
        }, ARRAY_FILTER_USE_BOTH);

        $manifestPath = $this->rootPath . '/docs/manifest.json';

        $parentTagSource = sprintf(self::PARENT_TAG_NAME, $input->getArgument('parent'));

        $errors = [];
        foreach ($components as $component) {
            $res = $this->processComponent($output, $github, $split, $component, $splitBinaryPath, $parentTagSource);
            if (!$res) {
                $errors[] = $component['id'];
            }

            $output->writeln('');
            $output->writeln('');
        }

        if ($errors) {
            $output->writeln('<error>[ERROR]</error>: One or more components reported an error.');
            $output->writeln('Please correct errors and try again.');
            $output->writeln('Error component(s): ' . implode(', ', $errors));

            return 1;
        }

        return 0;
    }
protected function execute ( InputInterface $ input , OutputInterface $ output ) { if ( PHP_VERSION_ID < 50600 ) { throw new \ RuntimeException ( 'This command is only available in PHP 5.6 and later.' ) ; } $ execDir = $ this -> rootPath . '/' . self :: EXEC_DIR ; $ token = $ this -> githubToken ( $ input -> getOption ( 'token' ) ) ; $ shell = new RunShell ; $ guzzle = $ this -> guzzleClient ( ) ; $ github = $ this -> githubClient ( $ output , $ shell , $ guzzle , $ token ) ; $ split = $ this -> splitWrapper ( $ output , $ shell ) ; @ mkdir ( $ execDir ) ; $ splitBinaryPath = $ this -> splitshInstall ( $ output , $ shell , $ execDir , $ input -> getOption ( 'splitsh' ) ) ; $ componentId = $ input -> getOption ( 'component' ) ; $ components = $ this -> componentManager -> componentsExtra ( $ componentId ) ; // remove umbrella component. $ components = array_filter ( $ components , function ( $ component , $ key ) { return $ key !== 'google-cloud' ; } , ARRAY_FILTER_USE_BOTH ) ; $ manifestPath = $ this -> rootPath . '/docs/manifest.json' ; $ parentTagSource = sprintf ( self :: PARENT_TAG_NAME , $ input -> getArgument ( 'parent' ) ) ; $ errors = [ ] ; foreach ( $ components as $ component ) { $ res = $ this -> processComponent ( $ output , $ github , $ split , $ component , $ splitBinaryPath , $ parentTagSource ) ; if ( ! $ res ) { $ errors [ ] = $ component [ 'id' ] ; } $ output -> writeln ( '' ) ; $ output -> writeln ( '' ) ; } if ( $ errors ) { $ output -> writeln ( '<error>[ERROR]</error>: One or more components reported an error.' ) ; $ output -> writeln ( 'Please correct errors and try again.' ) ; $ output -> writeln ( 'Error component(s): ' . implode ( ', ' , $ errors ) ) ; return 1 ; } return 0 ; }
Execute Split and Release process.

@param InputInterface $input The Symfony input handler.
@param OutputInterface $output The Symfony output handler.
@return int The exit code.
Execute Split and Release process .