src/Composer/Command/BaseCommand.php
protected function initialize(InputInterface $input, OutputInterface $output)
    {
        // initialize a plugin-enabled Composer instance, either local or global
        $disablePlugins = $input->hasParameterOption('--no-plugins');
        $composer = $this->getComposer(false, $disablePlugins);
        if (null === $composer) {
            $composer = Factory::createGlobal($this->getIO(), $disablePlugins);
        }
        if ($composer) {
            $preCommandRunEvent = new PreCommandRunEvent(PluginEvents::PRE_COMMAND_RUN, $input, $this->getName());
            $composer->getEventDispatcher()->dispatch($preCommandRunEvent->getName(), $preCommandRunEvent);
        }

        if (true === $input->hasParameterOption(array('--no-ansi')) && $input->hasOption('no-progress')) {
            $input->setOption('no-progress', true);
        }

        parent::initialize($input, $output);
    }
protected function initialize(InputInterface $input, OutputInterface $output)
    {
        // initialize a plugin-enabled Composer instance, either local or global
        $disablePlugins = $input->hasParameterOption('--no-plugins');
        $composer = $this->getComposer(false, $disablePlugins);
        if (null === $composer) {
            $composer = Factory::createGlobal($this->getIO(), $disablePlugins);
        }
        if ($composer) {
            $preCommandRunEvent = new PreCommandRunEvent(PluginEvents::PRE_COMMAND_RUN, $input, $this->getName());
            $composer->getEventDispatcher()->dispatch($preCommandRunEvent->getName(), $preCommandRunEvent);
        }

        if (true === $input->hasParameterOption(array('--no-ansi')) && $input->hasOption('no-progress')) {
            $input->setOption('no-progress', true);
        }

        parent::initialize($input, $output);
    }
protected function initialize ( InputInterface $ input , OutputInterface $ output ) { // initialize a plugin-enabled Composer instance, either local or global $ disablePlugins = $ input -> hasParameterOption ( '--no-plugins' ) ; $ composer = $ this -> getComposer ( false , $ disablePlugins ) ; if ( null === $ composer ) { $ composer = Factory :: createGlobal ( $ this -> getIO ( ) , $ disablePlugins ) ; } if ( $ composer ) { $ preCommandRunEvent = new PreCommandRunEvent ( PluginEvents :: PRE_COMMAND_RUN , $ input , $ this -> getName ( ) ) ; $ composer -> getEventDispatcher ( ) -> dispatch ( $ preCommandRunEvent -> getName ( ) , $ preCommandRunEvent ) ; } if ( true === $ input -> hasParameterOption ( array ( '--no-ansi' ) ) && $ input -> hasOption ( 'no-progress' ) ) { $ input -> setOption ( 'no-progress' , true ) ; } parent :: initialize ( $ input , $ output ) ; }
{@inheritDoc}
{