protected function createEnvironmentsDir(InputInterface $input, OutputInterface $output)
    {
        $targetDir = getcwd() . '/' . $this->envDir;
        $tmplDir = $this->tmplDir . '/environments';

        $output->writeln('  - Environment settings');

        if (file_exists($targetDir)) {
            $question = new ConfirmationQuestion(
                '    <error>Directory ' . $targetDir . ' already exists</error>' . PHP_EOL
                . '    <info>Overwrite? [Y/n]</info> ',
                true,
                '/^(y|j)/i'
            );

            if (!$this->questionHelper->ask($input, $output, $question)) {
                return;
            }
        }

        $fs = new Filesystem();
        $tmplIterator = new \RecursiveDirectoryIterator($tmplDir, \RecursiveDirectoryIterator::SKIP_DOTS);
        $iterator = new \RecursiveIteratorIterator($tmplIterator, \RecursiveIteratorIterator::SELF_FIRST);

        foreach ($iterator as $item) {
            $itemPath = $targetDir . '/' . $iterator->getSubPathName();

            if ($item->isDir()) {
                $fs->mkdir($itemPath);
            } else {
                $fs->copy($item, $itemPath, true);
            }
        }

        $output->writeln('    Created directory settings of environments: <comment>' . $targetDir . '</comment>');
    }
protected function createEnvironmentsDir(InputInterface $input, OutputInterface $output)
    {
        $targetDir = getcwd() . '/' . $this->envDir;
        $tmplDir = $this->tmplDir . '/environments';

        $output->writeln('  - Environment settings');

        if (file_exists($targetDir)) {
            $question = new ConfirmationQuestion(
                '    <error>Directory ' . $targetDir . ' already exists</error>' . PHP_EOL
                . '    <info>Overwrite? [Y/n]</info> ',
                true,
                '/^(y|j)/i'
            );

            if (!$this->questionHelper->ask($input, $output, $question)) {
                return;
            }
        }

        $fs = new Filesystem();
        $tmplIterator = new \RecursiveDirectoryIterator($tmplDir, \RecursiveDirectoryIterator::SKIP_DOTS);
        $iterator = new \RecursiveIteratorIterator($tmplIterator, \RecursiveIteratorIterator::SELF_FIRST);

        foreach ($iterator as $item) {
            $itemPath = $targetDir . '/' . $iterator->getSubPathName();

            if ($item->isDir()) {
                $fs->mkdir($itemPath);
            } else {
                $fs->copy($item, $itemPath, true);
            }
        }

        $output->writeln('    Created directory settings of environments: <comment>' . $targetDir . '</comment>');
    }
protected function createEnvironmentsDir ( InputInterface $ input , OutputInterface $ output ) { $ targetDir = getcwd ( ) . '/' . $ this -> envDir ; $ tmplDir = $ this -> tmplDir . '/environments' ; $ output -> writeln ( '  - Environment settings' ) ; if ( file_exists ( $ targetDir ) ) { $ question = new ConfirmationQuestion ( '    <error>Directory ' . $ targetDir . ' already exists</error>' . PHP_EOL . '    <info>Overwrite? [Y/n]</info> ' , true , '/^(y|j)/i' ) ; if ( ! $ this -> questionHelper -> ask ( $ input , $ output , $ question ) ) { return ; } } $ fs = new Filesystem ( ) ; $ tmplIterator = new \ RecursiveDirectoryIterator ( $ tmplDir , \ RecursiveDirectoryIterator :: SKIP_DOTS ) ; $ iterator = new \ RecursiveIteratorIterator ( $ tmplIterator , \ RecursiveIteratorIterator :: SELF_FIRST ) ; foreach ( $ iterator as $ item ) { $ itemPath = $ targetDir . '/' . $ iterator -> getSubPathName ( ) ; if ( $ item -> isDir ( ) ) { $ fs -> mkdir ( $ itemPath ) ; } else { $ fs -> copy ( $ item , $ itemPath , true ) ; } } $ output -> writeln ( '    Created directory settings of environments: <comment>' . $ targetDir . '</comment>' ) ; }
Creates directory with environments settings.

@param InputInterface $input
@param OutputInterface $output
Creates directory with environments settings .