Initialize eXpansion.

@param OutputInterface $console

@return $this|mixed
@throws \Maniaplanet\DedicatedServer\Xmlrpc\TransportException
3491
public function init(OutputInterface $console)
    {
        $this->checkPhpExtensions($console);

        $this->console->init($console, $this->dispatcher);
        $this->dispatcher->dispatch(self::EVENT_BEFORE_INIT, []);

        $this->factory->createConnection();
        $this->dispatcher->init($this->factory->getConnection());

        $this->dispatcher->dispatch(self::EVENT_AFTER_INIT, []);
        return $this;
    }
826184
public function init( Configurable $configurable, string $environment, InputInterface $input, OutputInterface $output ) {

		/**
		 * config values from the selected environment
		 */
		$environmentConfigurable = new PrefixConfigurableDecorator($configurable, "project.environments.$environment.");

		/**
		 * config values from the project `default` section
		 */
		$projectConfigurable = new PrefixConfigurableDecorator($configurable, "project.default.");

		/**
		 * config values from the selected environment
		 * If no value is set then the project `default` is checked
		 * If no value is there then the default value is returned
		 */
		$fallbackConfigurable = new ConfigurableFallback($environmentConfigurable, $projectConfigurable);

		/**
		 * Convenience service
		 * Replaces
		 *
		 *  if( $config->has($key) )  {
		 *		echo info exists already
		 * }
		 * echo info setting default value
		 * $config->set($key, $defaultValue)
		 *
		 * with
		 * $initializer->init($$fallbackConfigurable, 'key', defaultValue) - sets in default value in environment
		 * or
		 * $initializer->init($fallbackConfigurable, 'key', defaultValue, ) - sets in default value in project defaults
		 */
		$initializer = new ConfigurationInitializer($output);



		/**
		 *
		 */
		if( $this->getFlag('dev', false) ) {
			/**
			 * Provide defaults for local development environment
			 */
			$initializer->init($fallbackConfigurable, 'mount-workdir', true);
			$initializer->init($fallbackConfigurable, 'use-app-container', false);
		} else {
            $initializer->init($fallbackConfigurable, 'rancher.stack', 'Project');

            $schedulerInitializer = new SchedulerInitializer($initializer);
            $schedulerInitializer->init($fallbackConfigurable, $projectConfigurable);
        }

        /**
         * Provide defaults for rancher environments
         */
        $initializer->init($fallbackConfigurable, 'external_links', []);

        $initializer->init($fallbackConfigurable, 'docker.repository', 'repo/name', $projectConfigurable);
        $initializer->init($fallbackConfigurable, 'docker.version-prefix', '', $projectConfigurable);
        $initializer->init($fallbackConfigurable, 'service-name', 'Project', $projectConfigurable);
        $initializer->init($fallbackConfigurable, 'docker.base-image', 'php:7.0-alpine', $projectConfigurable);
        $initializer->init($fallbackConfigurable, 'environment', ["EXAMPLE" => 'value']);

        /**
         * Blueprint specific entries
         */
        $initializer->init($fallbackConfigurable, 'php', '7.0', $projectConfigurable);
//        $initializer->init($fallbackConfigurable, 'extensions', []);
        $initializer->init($fallbackConfigurable, 'add-composer', false, $projectConfigurable);
        $initializer->init($fallbackConfigurable, 'command', "-i", $projectConfigurable);

    }
742798
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->define();

        $serializer = $this->getContainer()->get('rs_queue.serializer');
        $psubscriberCommand = $this;
        $methods = $this->methods;

        $patterns = array_keys($methods);

        if ($this->shuffleQueues()) {

            shuffle($patterns);
        }

        $this
            ->getContainer()
            ->get('rs_queue.redis')
            ->psubscribe($patterns, function ($redis, $pattern, $channel, $payloadSerialized) use ($methods, $psubscriberCommand, $serializer, $input, $output) {

                $payload = $serializer->revert($payloadSerialized);
                $method = $methods[$pattern];

                /**
                 * All custom methods must have these parameters
                 *
                 * InputInterface  $input   An InputInterface instance
                 * OutputInterface $output  An OutputInterface instance
                 * Mixed           $payload Payload
                 */
                $psubscriberCommand->$method($input, $output, $payload);
            });
    }
972897
protected function initialize(InputInterface $input, OutputInterface $output)
    {
        parent::initialize($input, $output);
        $this->permissionResolver->setCurrentUserReference(
            $this->userService->loadUserByLogin($input->getOption('user'))
        );
    }
1261486
protected function newProgressBar(OutputInterface $output)
    {
        // If the console output is not decorated (i.e. it does not support
        // ANSI), use NullOutput to suppress the progress bar entirely.
        $progressOutput = $output->isDecorated() ? $output : new NullOutput();

        return new ProgressBar($progressOutput);
    }
732677
public function initialize($container, PaymentServiceProvider $psp)
    {
        parent::initialize($container, $psp);
        if(isset($this->parameters['host'])) $this->setHost($this->parameters['host']);
        if(isset($this->parameters['client_id'])) $this->setClientId($this->parameters['client_id']);
        if(isset($this->parameters['secret'])) $this->setSecret($this->parameters['secret']);
        if(isset($this->parameters['return_url'])) $this->setReturnUrl($this->parameters['return_url']);
        if(isset($this->parameters['cancel_url'])) $this->setCancelUrl($this->parameters['cancel_url']);
        
        return $this;
    }
291348
public function expand(ODataExpandableCollectionInterface $expand = NULL) {
        if (isset($expand)) {
            $this->setExpand($expand);
            return $this;
        }
        return $this->getExpand();
    }
946925
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $errOutput = $output instanceof ConsoleOutputInterface ? $output->getErrorOutput() : $output;
        $output->setVerbosity(OutputInterface::VERBOSITY_QUIET);
        $errOutput->setVerbosity(OutputInterface::VERBOSITY_NORMAL);

        $context = json_decode($input->getOption('context') ?: '{}', true);
        $context['tenant_id'] = (string)$input->getOption('tenant-id');

        $nodeRef = NodeRef::fromString($input->getArgument('node-ref'));
        $consistent = $input->getOption('consistent') ? true : false;

        try {
            $node = $this->ncr->getNode($nodeRef, $consistent, $context);
            echo json_encode($node, $input->getOption('pretty') ? JSON_PRETTY_PRINT : 0) . PHP_EOL;
        } catch (\Throwable $e) {
            $errOutput->writeln($e->getMessage());
        }
    }
463414
protected function getWriter(Console\Input\InputInterface $input, Console\Output\OutputInterface $output)
    {
        $outputFile = $input->getOption('output');
        if ($input->getOption('edit')) {
            if ($outputFile !== $this->getDefinition()->getOption('output')->getDefault()) {
                throw new \InvalidArgumentException("You cannot specify both --edit (-e) and --output (-f)");
            }
            $outputFile = $input->getOption('edit');
        }

        $writer = Writer\Factory::createWriter($input->getOption('output-format') ?: $input->getOption('input-format') ?: 'json');
        if (null === $outputFile && $output instanceof Console\Output\StreamOutput) {
            $writer->setOutput($output->getStream());
        } else {
            $writer->setOutput(fopen($outputFile ?: 'php://stdout', 'w'));
        }
        return $writer;
    }
854520
public function setOutput(OutputInterface $output)
    {
        $this->output = $output;
        $this->stdErr = $output instanceof ConsoleOutputInterface
            ? $output->getErrorOutput()
            : $output;
    }
120168
protected function initialize(InputInterface $input, OutputInterface $output)
    {
        $this->transifexconfig = $input->getOption('transifex-config');
        $this->setProject($input, $output);
        $this->setPrefix($input, $output);
        $this->setXliffDirectory($input, $output);
        $this->setContaoLanguageDirectory($input, $output);
        $this->baselanguage = $input->getOption('base-language');
        $this->skipFiles    = $input->getOption('skip-files') ? explode(',', $input->getOption('skip-files')) : null;

        if (!$this->skipFiles) {
            $this->skipFiles = $this->getTransifexConfigValue('/skip_files') ?: array();
        } else {
            // Make sure it is an array.
            $this->skipFiles = array();
        }

        $activeLanguages = array();
        if (($langs = $input->getArgument('languages')) != 'all') {
            $activeLanguages = explode(',', $langs);
        }

        $this->determineLanguages($output, $this->getLanguageBasePath(), $activeLanguages);
    }
1177029
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $start = microtime(true);

        $this->setOutput($output);
        $this->setVerbosity($output->getVerbosity());

        $isChild = $input->getOption('child');

        if ($isChild && $output->getVerbosity() <= OutputInterface::VERBOSITY_NORMAL) {
            $this->setVerbosity(self::VERBOSITY_CHILD);
        }

        $this->getContainer()->get('ez_migration_bundle.step_executed_listener.tracing')->setOutput($output);

        // q: is it worth declaring a new, dedicated migration service ?
        $migrationService = $this->getMigrationService();
        $migrationService->setLoader($this->getContainer()->get('ez_migration_bundle.loader.filesystem_recursive'));

        $force = $input->getOption('force');

        $toExecute = $this->buildMigrationsList($input->getOption('path'), $migrationService, $force, $isChild);

        if (!count($toExecute)) {
            $this->writeln('<info>No migrations to execute</info>');
            return 0;
        }

        if ($isChild) {
            return $this->executeAsChild($input, $output, $toExecute, $force, $migrationService);
        } else {
            return $this->executeAsParent($input, $output, $toExecute, $start);
        }
    }
945458
protected function initialize(Input $input, Output $output) {
        return $this->cmd->initialize($input,$output);
    }
221302
protected function initialize(InputInterface $input, OutputInterface $output)
    {

        parent::initialize($input, $output);

        $translationMode = $input->getOption('mode');
        $validModes      = array(
            'reviewed',
            'translated',
            'default'
        );
        if (!in_array($translationMode, $validModes)) {
            throw new \InvalidArgumentException(
                sprintf(
                    'Invalid translation mode %s specified. Must be one of %s',
                    $translationMode,
                    implode(', ', $validModes)
                )
            );
        }
    }
1249584
protected function execute(InputInterface $input, OutputInterface $output) : int
    {
        /* @var ConsoleOutput $output */
        $output->setPrefix(ConsoleOutput::PREFIX_TIMESTAMP | ConsoleOutput::PREFIX_CLASSNAME);

        $this->queue = self::queue($input->getOption('queue'));

        if ($this->input->getOption('stop-when-empty') && !$this->queue->getStorage() instanceof CountableInterface) {
            throw new UserException("Can't use stop-when-empty on '" . $this->queue->getType() . "' storage");
        }

        return parent::execute($input, $output);
    }
1184158
public function initializeInstallOutput(OutputInterface $output)
    {
        $progressBar = null;
        if ($output->getVerbosity() < OutputInterface::VERBOSITY_VERY_VERBOSE) {
            // Low verbosity, use progress bar.
            $progressBar = new ProgressBar($output);
            $progressBar->setFormat(' %current%/%max% [%bar%] %percent:3s%% %elapsed:6s% [%message%]');
        }

        return new InstallOutput(new ConsoleLogger($output), $progressBar);
    }
1095963
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $start = microtime(true);
        $output->writeln('Starting data import');

        $this->migrateData->setOutputInterface($output)->run();

        $output->writeln(sprintf('Import complete in %s', round(microtime(true) - $start, 2)));
    }