<commit_before><?php
/*
 * This file is part of the CampaignChain package.
 *
 * (c) <NAME> <<EMAIL>>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace CampaignChain\CoreBundle\Command;

use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\HttpFoundation\Request;

/**
 * Class ModuleUpdateCommand
 * @package CampaignChain\CoreBundle\Command
 * @author <NAME> <<EMAIL>>
 *
 * Usage:
 * php app/console campaignchain:module:update
 */
class ModuleUpdateCommand extends ContainerAwareCommand
{
    protected function configure()
    {
        $this
            ->setName('campaignchain:module:update')
            ->setDescription('Updates modules.')
            ->setHelp(<<<EOT
The <info>campaignchain:module:update</info> command updates CampaignChain modules:

  <info>php app/console campaignchain:module:update</info>

To update only the configuration provided by the modules that have already been
downloaded, then use the <comment>--config-only</comment> option.
EOT
            )
            ->addOption(
                'config-only',
                null,
                InputOption::VALUE_NONE,
                'Register config.yml files of all modules.'
            )
            ->addOption(
                'routing-only',
                null,
                InputOption::VALUE_NONE,
                'Register routing.yml files of all modules.'
            )
            ->addOption(
                'class-only',
                null,
                InputOption::VALUE_NONE,
                'Register bundle classes of all modules in AppKernel.php.'
            );
    }

    protected function execute(InputInterface $input, OutputInterface $output)
    {
        if (
            $input->getOption('config-only') ||
            $input->getOption('routing-only') ||
            $input->getOption('class-only')
        ) {
            $installer = $this->getContainer()->get('campaignchain.core.module.installer');
            $installer->setSkipVersion(true);
            $installer->getNewBundles();

            $kernel = $this->getContainer()->get('campaignchain.core.module.kernel');
            if($input->getOption('config-only')){
                $types = array('configs' => true);
                $output->writeln('Registering config.yml files of all modules');
            } elseif($input->getOption('routing-only')){
                $types = array('routings' => true);
                $output->writeln('Registering routing.yml files of all modules');
            } elseif($input->getOption('class-only')){
                $types = array('classes' => true);
                $output->writeln('Registering bundle classes of all modules in AppKernel.php.');
            }
            $kernel->register($installer->getKernelConfig(), $types);
            $output->writeln('Done');
        } else {
            $this->getContainer()->enterScope('request');
            $this->getContainer()->set('request', new Request(), 'request');
            $output->writeln('Updating CampaignChain system registry for all modules');
            $installer = $this->getContainer()->get('campaignchain.core.module.installer');
//            $installer->setSkipVersion(true);
            $installer->install();
            $output->writeln('Done');
        }
    }
}<commit_msg>CE-353 bootstrap-clockpicker.min.js missing upon installation at step 1<commit_after><?php
/*
 * This file is part of the CampaignChain package.
 *
 * (c) <NAME> <<EMAIL>>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace CampaignChain\CoreBundle\Command;

use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\HttpFoundation\Request;

/**
 * Class ModuleUpdateCommand
 * @package CampaignChain\CoreBundle\Command
 * @author <NAME> <<EMAIL>>
 *
 * Usage:
 * php app/console campaignchain:module:update
 */
class ModuleUpdateCommand extends ContainerAwareCommand
{
    protected function configure()
    {
        $this
            ->setName('campaignchain:module:update')
            ->setDescription('Updates modules.')
            ->setHelp(<<<EOT
The <info>campaignchain:module:update</info> command updates CampaignChain modules:

  <info>php app/console campaignchain:module:update</info>

To update only the configuration provided by the modules that have already been
downloaded, then use the <comment>--config-only</comment> option.
EOT
            )
            ->addOption(
                'config-only',
                null,
                InputOption::VALUE_NONE,
                'Register config.yml files of all modules.'
            )
            ->addOption(
                'routing-only',
                null,
                InputOption::VALUE_NONE,
                'Register routing.yml files of all modules.'
            )
            ->addOption(
                'class-only',
                null,
                InputOption::VALUE_NONE,
                'Register bundle classes of all modules in AppKernel.php.'
            );
    }

    protected function execute(InputInterface $input, OutputInterface $output)
    {
        if (
            $input->getOption('config-only') ||
            $input->getOption('routing-only') ||
            $input->getOption('class-only')
        ) {
            $installer = $this->getContainer()->get('campaignchain.core.module.installer');
            $installer->setSkipVersion(true);
            $installer->getNewBundles();

            $kernel = $this->getContainer()->get('campaignchain.core.module.kernel');
            if($input->getOption('config-only')){
                $types = array('configs' => true);
                $output->writeln('Registering config.yml files of all CampaignChain modules');
            } elseif($input->getOption('routing-only')){
                $types = array('routings' => true);
                $output->writeln('Registering routing.yml files of all CampaignChain modules');
            } elseif($input->getOption('class-only')){
                $types = array('classes' => true);
                $output->writeln('Registering bundle classes of all CampaignChain modules in AppKernel.php.');
            }
            $kernel->register($installer->getKernelConfig(), $types);
            $output->writeln('Done');
        } else {
            $this->getContainer()->enterScope('request');
            $this->getContainer()->set('request', new Request(), 'request');
            $output->writeln('Updating CampaignChain system registry for all modules');
            $installer = $this->getContainer()->get('campaignchain.core.module.installer');
//            $installer->setSkipVersion(true);
            $installer->install();
            $output->writeln('Done');
        }
    }
}
{'fraction_non_alphanumeric': 0.12696660226331768, 'fraction_numerical': 0.0005520287054926856, 'mean_word_length': 2.335020708697653, 'pattern_counts': {'":': 0, '<': 35, '<?xml version=': 0, '>': 101, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7224804', 'n_tokens_mistral': 1871, 'n_tokens_neox': 1809, 'n_words': 402}