Generate the container
@param  Input\InputInterface   $input  The commands input
@param  Output\OutputInterface $output The commands output
@return null
5296
protected function execute(Input\InputInterface $input, Output\OutputInterface $output)
    {
        $this->generatorService->process($input->getOption('force'));
        $output->writeln('Completed');
    }
698137
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $root = $this->getContainer()->getParameter('kernel.root_dir');
        chdir("$root/..");
        $path = "$root/Resources/gettext/messages.pot";
        $twig = "$root/Resources/gettext/twig.cache.php";
        $results = $this->convertTwigToPhp($twig, 'app');
        foreach ($results as $filename => $status) {
            $output->writeln("$status: $filename");
        }
        $results = $this->extractFromPhp($path);
        foreach ($results as $filename => $status) {
            $output->writeln("$status: $filename");
        }
        if (!$input->getOption('keep-cache')) {
            unlink($twig);
        }
    }
70948
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $context = $this->getContainer()->get('router')->getContext();
        $context->setBaseUrl('');

        if ($siteId = $input->getOption('siteId')) {
            $site = $this->getContainer()->get('open_orchestra_model.repository.site')->findOneBySiteId($siteId);
            if ($site) {
                $this->generateErrorPages($site, $output);
            } else {
                $output->writeln("<error>No website found with siteId " . $siteId . ".</error>");

                return 1;
            }
        } else {
            $siteCollection = $this->getContainer()->get('open_orchestra_model.repository.site')->findByDeleted(false);
            if ($siteCollection) {
                foreach ($siteCollection as $site) {
                    $this->generateErrorPages($site, $output);
                }
            }
        }

        $output->writeln("\n<info>Done.</info>");

        return 0;
    }
163958
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $rootDir = $this->getRootDir();
        $stagingName = $input->getOption('staging-name');
        $stagingPath = $this->getCapistranoDir().'/deploy/';
        $staging = sprintf('%s%s.rb', $stagingPath, $stagingName);

        $output->setVerbosity(OutputInterface::VERBOSITY_VERBOSE);
        $this->sayWelcome($output);

        if (false === file_exists($staging)) {
            $yamlStaging = sprintf('%s/config/rch/staging/%s.yml', $rootDir, $stagingName);

            if (false === file_exists($yamlStaging)) {
                throw new InvalidArgumentException(sprintf('Unable to find staging with name %s', $stagingName));
            }

            $params = $this->parseYamlStaging($yamlStaging);
            $generator = new StagingGenerator($params, $stagingPath, $stagingName);

            $this->generate($generator);
        }

        $builder = new ProcessBuilder(['bundle', 'exec', 'cap', $stagingName, 'deploy']);
        $builder->setTimeout(null);
        $process = $builder->getProcess();

        $process->run(function ($type, $buffer) use ($output) {
            $output->write(sprintf('<info>%s</info>', $buffer));
        });

        if (!$process->isSuccessful()) {
            $output->writeln(PHP_EOL);
            $output->writeln('<error>Deployment failed</error>');
            $output->writeln(
                sprintf('<error>Execute <comment>cap %s deploy --trace</comment> for more details</error>', $stagingName)
            );

            return $process->getExitCode();
        }

        return $output->writeln(
            '<info>Project successfully deployed !</info>'
        );
    }
304540
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $dialog = $this->getDialogHelper();

        if ($input->isInteractive()) {
            if (!$dialog->askConfirmation($output, $dialog->getQuestion('Do you confirm generation', 'yes', '?'), true)) {
                $output->writeln('<error>Command aborted</error>');

                return 1;
            }
        }

        foreach (array('namespace', 'dir') as $option) {
            if (null === $input->getOption($option)) {
                throw new \RuntimeException(sprintf('The "%s" option must be provided.', $option));
            }
        }

        $namespace = Validators::validateBundleNamespace($input->getOption('namespace'));
        if (!$bundle = $input->getOption('bundle-name')) {
            $bundle = strtr($namespace, array('\\' => ''));
        }
        $bundle = Validators::validateBundleName($bundle);
        $dir = Validators::validateTargetDir($input->getOption('dir'), $bundle, $namespace);
        $format = Validators::validateFormat($input->getOption('format'));
        $structure = $input->getOption('structure');

        $dialog->writeSection($output, 'Bundle generation');

        if (!$this->getContainer()->get('filesystem')->isAbsolutePath($dir)) {
            $dir = getcwd().'/'.$dir;
        }

        $generatorName = $input->getOption('generator');
        $modelName = $input->getOption('model-name');

        $generator = $this->createGenerator();
        $generator->setGenerator($generatorName);
        $generator->setPrefix($input->getOption('prefix'));

        $generator->generate($namespace, $bundle, $dir, $format, $structure, $generatorName, $modelName);

        $output->writeln('Generating the bundle code: <info>OK</info>');

        $errors = array();
        $runner = $dialog->getRunner($output, $errors);

        // check that the namespace is already autoloaded
        $runner($this->checkAutoloader($output, $namespace, $bundle, $dir));

        // register the bundle in the Kernel class
        $runner($this->updateKernel($dialog, $input, $output, $this->getContainer()->get('kernel'), $namespace, $bundle));

        // routing
        $runner($this->updateRouting($dialog, $input, $output, $bundle, $format));

        $dialog->writeGeneratorSummary($output, $errors);
    }
854921
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $io = new SymfonyStyle($input, $output);
        $io->title('Scheduler Storage Creator');

        $this->getPbjxServiceLocator()->getScheduler()->createStorage();
        $io->success(sprintf('Scheduler storage created.'));
    }
497846
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $questionHelper = $this->getQuestionHelper();
        $questionHelper->writeSection($output, 'Search Page Generation');

        $prefix = $input->getOption('prefix');
        $createPage = $input->getOption('createpage');
        if (Kernel::VERSION_ID < 40000) {
            GeneratorUtils::ensureOptionsProvided($input, ['namespace']);

            $namespace = Validators::validateBundleNamespace($input->getOption('namespace'));
            $bundle = strtr($namespace, ['\\' => '']);

            $bundle = $this
                ->getApplication()
                ->getKernel()
                ->getBundle($bundle);
        } else {
            $bundle = new Sf4AppBundle($this->getContainer()->getParameter('kernel.project_dir'));
        }

        $rootDir = $this->getApplication()->getKernel()->getRootDir();

        $generator = $this->getGenerator($this->getApplication()->getKernel()->getBundle('KunstmaanGeneratorBundle'));
        $generator->generate($bundle, $prefix, $rootDir, $createPage, $output);

        $output->writeln(array(
                'Make sure you update your database first before you test the pagepart:',
                '    Directly update your database:          <comment>bin/console doctrine:schema:update --force</comment>',
                '    Create a Doctrine migration and run it: <comment>bin/console doctrine:migrations:diff && bin/console doctrine:migrations:migrate</comment>', )
        );

        if ($createPage) {
            $output->writeln('    New DataFixtures were created. You can load them via: <comment>bin/console doctrine:fixtures:load --fixtures=src/'.str_replace('\\', '/', $bundle->getNamespace()).'/DataFixtures/ORM/SearchPageGenerator/ --append</comment>');
        }

        $output->writeln('');
    }
69036
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $root = $this->getContainer()->getParameter('kernel.root_dir');
        chdir("$root/..");
        $path = "$root/Resources/gettext/messages.pot";
        $languages = $input->getArgument('languages');
        $results = $this->initializeFromTemplate($path, $languages);
        foreach ($results as $filename => $status) {
            $output->writeln("$status: $filename");
        }
    }
1342093
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $gen = new CodeGenerator(
            Database::getConnection(),
            array('default' => 'PHPCI'),
            array('default' => PHPCI_DIR),
            false
        );

        $gen->generateModels();
        $gen->generateStores();
    }
462491
public function execute(InputInterface $input, OutputInterface $output)
    {
        $inOut     = $this->wrapIo($input, $output);
        $container = $this->createContainer($this->getComposer(), static::NAME);

        $argAction = static::ARG_ACTION;
        $action    = $inOut->getArgument($argAction);
        switch ($action) {
            case static::ACTION_CONNECT:
                $this->executeConnect($container, $inOut);
                break;
            case static::ACTION_CREATE:
                $this->executeCreate($container, $inOut);
                break;
            default:
                $inOut->writeError("Unknown value `$action` for argument `$argAction`." . PHP_EOL);
                break;
        }
    }
867329
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $io = new SymfonyStyle($input, $output);

        if (!$this->metadata) {
            try {
                $this->metadata = $this->retrieveMetadatas($input->getArgument('name'));
            } catch (\Exception $e) {
                $io->error($e->getMessage());
                return;
            }
        }
        $metadatas = $this->metadata->getMetadata();

        $namespace = str_replace('\\Entity', '', $this->metadata->getNamespace());
        $path = $this->metadata->getPath();

        $basePath = sprintf(
            '%s/%s',
            $path,
            str_replace('\\', '/', $namespace)
        );

        $appDir = $this->getContainer()->getParameter('kernel.root_dir');

        $adminGenerator = new AdminGenerator($appDir);
        $managerGenerator = new ManagerGenerator($appDir);
        $adminCtlGenerator = new AdminControllerGenerator($appDir);
        $servicesGenerator = new ServicesGenerator($appDir);
        $transGenerator = new TranslationsGenerator($appDir);
        foreach ($metadatas as $metadata) {
            $entityName = $this->getEntityNameFromMetadata($metadata);
            $output->writeln('');
            $output->writeln(sprintf('Generate files for entity %s', $entityName));
            // generate Admin class
            $output->writeln($adminGenerator->generate($namespace, $basePath, $metadata));
            // generate Manager class
            $output->writeln($managerGenerator->generate($namespace, $basePath, $metadata));
            // generate AdminController class
            $output->writeln($adminCtlGenerator->generate($namespace, $basePath, $metadata));
            // update translations
            $transGenerator->setBundleName($this->getBundleNameFromEntity($metadata->rootEntityName));
            $output->writeln($transGenerator->generate($namespace, $basePath, $metadata));
            // update services.yml
            $servicesGenerator->setBundleName($this->getBundleNameFromEntity($metadata->rootEntityName));
            $output->writeln($servicesGenerator->generate($namespace, $basePath, $metadata));
        }
    }
534591
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $container = $this->getApplication()->getContainer();
        $container->configure();

        $classname = $input->getArgument('class');
        $method = $input->getArgument('method');

        if (!$this->confirm($input, $classname, $method)) {
            return;
        }

        $resource = $container->get('locator.resource_manager')->createResource($classname);

        $container->get('code_generator')->generate($resource, 'specification_method', [
            'method' => $method,
            'type' => $this->confirmMethodType($input, $output),
        ]);
    }
278871
private function init(InputInterface $input, OutputInterface $output)
    {
        $this->helper = $this->getHelper('question');
        $this->input = $input;
        $this->output = $output;

        // Set whether target files should be overwritten or not.
        $this->force = $input->getOption('force');
        $this->root = $input->getOption('root');

        $this->init_wordpress();

        // Setup Snap.
        Snap::create_container();
        Snap::init_config($this->root);

        // Setup WP filesystem helper.
        $this->setup_filesystem();
    }
300545
public function generate(InputInterface $input, OutputInterface $output): void
    {
        $projectDir = $this->container->getParameter('kernel.project_dir');
        $legacyExtensionDir = $projectDir . '/src/AppBundle/ezpublish_legacy/app';

        // Variables valid for all siteaccesses

        $siteAccessList = $input->getOption('site-access-list');
        $allSiteAccesses = array_keys($siteAccessList);
        $allSiteAccesses[] = self::LEGACY_ADMIN_SITEACCESS_NAME;
        $allSiteAccesses[] = self::NGADMINUI_SITEACCESS_NAME;

        $allLanguages = array_values(array_unique(array_merge(...array_values($siteAccessList))));
        $translationList = implode(';', array_values(array_diff($allLanguages, [$allLanguages[0]])));

        $fileSystem = $this->container->get('filesystem');

        // Generate Netgen Admin UI siteaccess

        if ($fileSystem->exists($legacyExtensionDir . '/settings/_skeleton_ngadminui')) {
            $this->setSkeletonDir($legacyExtensionDir . '/settings/_skeleton_ngadminui');

            $this->renderFile(
                'site.ini.append.php',
                $legacyExtensionDir . '/settings/siteaccess/' . self::NGADMINUI_SITEACCESS_NAME . '/site.ini.append.php',
                [
                    'relatedSiteAccessList' => $allSiteAccesses,
                    'siteAccessLocale' => $allLanguages[0],
                    'siteLanguageList' => $allLanguages,
                    'translationList' => $translationList,
                ]
            );

            $output->writeln(
                [
                    '',
                    'Generated <comment>Netgen Admin UI</comment> siteaccess!',
                ]
            );

            $fileSystem->remove($legacyExtensionDir . '/settings/_skeleton_ngadminui');
        }

        // Generating legacy admin siteaccess

        if ($fileSystem->exists($legacyExtensionDir . '/settings/_skeleton_legacy_admin')) {
            $this->setSkeletonDir($legacyExtensionDir . '/settings/_skeleton_legacy_admin');

            $this->renderFile(
                'site.ini.append.php',
                $legacyExtensionDir . '/settings/siteaccess/' . self::LEGACY_ADMIN_SITEACCESS_NAME . '/site.ini.append.php',
                [
                    'relatedSiteAccessList' => $allSiteAccesses,
                    'siteAccessLocale' => $allLanguages[0],
                    'siteLanguageList' => $allLanguages,
                    'translationList' => $translationList,
                ]
            );

            $output->writeln(
                [
                    '',
                    'Generated <comment>legacy</comment> admin siteaccess!',
                ]
            );

            $fileSystem->remove($legacyExtensionDir . '/settings/_skeleton_legacy_admin');
        }
    }
660892
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->injectOutputIntoLogger($output, $this->logger);
        $this->logger->info('Getting table metadata for database "' . $input->getArgument('database') . '".');
        $tables = $this->getTables($input);
        $outputTable = new Table($output);
        $outputTable
            ->setHeaders(array('Database', 'Rows', 'Size in ' . $input->getOption('unit')));
        foreach ($tables as $name => $table) {
            $outputTable->addRow([$name, $table['rows'], $table['size']]);
        }
        $outputTable->render();
        return 0;
    }
763607
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $io = new SymfonyStyle($input, $output);

        if ($input->isInteractive() && !$io->confirm('Do you confirm generation?', true)) {
            $io->error('Command aborted');

            return 1;
        }

        foreach (['namespace', 'dir'] as $option) {
            if (null === $input->getOption($option)) {
                throw new RuntimeException(sprintf('The "%s" option must be provided.', $option));
            }
        }

        $namespace = Validators::validateBundleNamespace($input->getOption('namespace'));
        if (!$bundle = $input->getOption('module-name')) {
            $bundle = strtr($namespace, ['\\' => '']);
        }
        $bundle = Validators::validateBundleName($bundle);
        $dir = Validators::validateTargetDir($input->getOption('dir'), $bundle, $namespace);
        if (null === $input->getOption('format')) {
            $input->setOption('format', 'annotation');
        }
        $format = Validators::validateFormat($input->getOption('format'));

        $io->block('Module generation', null, 'bg=blue;fg=white', '  ', true);

        if (!$this->getContainer()->get('filesystem')->isAbsolutePath($dir)) {
            $dir = getcwd().'/'.$dir;
        }

        $io->text('Generating the module code...');
        $generator = $this->getGenerator();
        $generator->generate($namespace, $bundle, $dir, $format);
        $io->success('Code generated!');

        $io->block('You can now start using the generated code!', null, 'bg=blue;fg=white', '  ', true);

        return 0;
    }
1071262
public function createTable(InputInterface $input, OutputInterface $output)
    {
        $databse = $this->getApplication()->find('create:table');
        $databse_arguments = array(
            'command'   => 'create:table',
            'table'     => $input->getArgument('table'),
            'column'    => $input->getArgument('column')
        );
        $input_db   = new ArrayInput($databse_arguments);
        $return_db  = $databse->run($input_db,$output);
        return $output->writeln($return_db);
    }