protected function createConfiguration(InputInterface $input, OutputInterface $output)
    {
        $path = $this->getApplication()->getRoot() . '/.jedi.php';

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

        if (file_exists($path)) {
            $question = new ConfirmationQuestion(
                '    <error>Configuration file ' . $path . ' 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();

        $question = new Question('    <info>Enter path to web directory relative to '
            . $this->getApplication()->getRoot() . ':</info> ' . PHP_EOL
            . '    (or do not specify if you are already in the web directory)' . PHP_EOL);

        $question->setValidator(function ($answer) use ($fs) {
            $path = $answer;

            if ($answer === null) {
                $path = $this->getApplication()->getRoot();
            } elseif (!$fs->isAbsolutePath($answer)) {
                $path = $this->getApplication()->getRoot() . '/' . $answer;
            }

            if (!is_dir($path)) {
                throw new \RuntimeException('Directory "' . $path . '" is missing');
            }

            return $answer;
        });

        $webDir = $this->questionHelper->ask($input, $output, $question);

        $content = file_get_contents($this->tmplDir . '/.jedi.php');
        $content = str_replace(
            ['%web-dir%', '%env-dir%'],
            [addslashes($webDir), addslashes($this->envDir)],
            $content
        );
        $fs->dumpFile($path, $content);

        $output->writeln('    Created configuration file of application <comment>' . $path . '</comment>');
    }
protected function createConfiguration(InputInterface $input, OutputInterface $output)
    {
        $path = $this->getApplication()->getRoot() . '/.jedi.php';

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

        if (file_exists($path)) {
            $question = new ConfirmationQuestion(
                '    <error>Configuration file ' . $path . ' 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();

        $question = new Question('    <info>Enter path to web directory relative to '
            . $this->getApplication()->getRoot() . ':</info> ' . PHP_EOL
            . '    (or do not specify if you are already in the web directory)' . PHP_EOL);

        $question->setValidator(function ($answer) use ($fs) {
            $path = $answer;

            if ($answer === null) {
                $path = $this->getApplication()->getRoot();
            } elseif (!$fs->isAbsolutePath($answer)) {
                $path = $this->getApplication()->getRoot() . '/' . $answer;
            }

            if (!is_dir($path)) {
                throw new \RuntimeException('Directory "' . $path . '" is missing');
            }

            return $answer;
        });

        $webDir = $this->questionHelper->ask($input, $output, $question);

        $content = file_get_contents($this->tmplDir . '/.jedi.php');
        $content = str_replace(
            ['%web-dir%', '%env-dir%'],
            [addslashes($webDir), addslashes($this->envDir)],
            $content
        );
        $fs->dumpFile($path, $content);

        $output->writeln('    Created configuration file of application <comment>' . $path . '</comment>');
    }
protected function createConfiguration ( InputInterface $ input , OutputInterface $ output ) { $ path = $ this -> getApplication ( ) -> getRoot ( ) . '/.jedi.php' ; $ output -> writeln ( '  - Configuration' ) ; if ( file_exists ( $ path ) ) { $ question = new ConfirmationQuestion ( '    <error>Configuration file ' . $ path . ' 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 ( ) ; $ question = new Question ( '    <info>Enter path to web directory relative to ' . $ this -> getApplication ( ) -> getRoot ( ) . ':</info> ' . PHP_EOL . '    (or do not specify if you are already in the web directory)' . PHP_EOL ) ; $ question -> setValidator ( function ( $ answer ) use ( $ fs ) { $ path = $ answer ; if ( $ answer === null ) { $ path = $ this -> getApplication ( ) -> getRoot ( ) ; } elseif ( ! $ fs -> isAbsolutePath ( $ answer ) ) { $ path = $ this -> getApplication ( ) -> getRoot ( ) . '/' . $ answer ; } if ( ! is_dir ( $ path ) ) { throw new \ RuntimeException ( 'Directory "' . $ path . '" is missing' ) ; } return $ answer ; } ) ; $ webDir = $ this -> questionHelper -> ask ( $ input , $ output , $ question ) ; $ content = file_get_contents ( $ this -> tmplDir . '/.jedi.php' ) ; $ content = str_replace ( [ '%web-dir%' , '%env-dir%' ] , [ addslashes ( $ webDir ) , addslashes ( $ this -> envDir ) ] , $ content ) ; $ fs -> dumpFile ( $ path , $ content ) ; $ output -> writeln ( '    Created configuration file of application <comment>' . $ path . '</comment>' ) ; }
Creates configuration file of application.

@param InputInterface $input
@param OutputInterface $output
Creates configuration file of application .