Initialize the test runner.

@return self
967887
public function init()
    {
        // Create an object for outputting information to the CLI
        $this->output = new Output($this);

        // Parse the options
        $this->options = new Options([], $this);

        // Create an object for collating code coverage information
        $this->coverage = new Coverage($this);

        // Parse the arguments passed to the script
        $this->parseArguments();

        // Run the main bootstrap script if it exists
        $this->bootstrap($this->pwd.'/tests');

        return $this;
    }
225916
public function init()
    {
        if (Console::isCli()) {
            // fix for fcgi
            defined('STDIN') or define('STDIN', fopen('php://stdin', 'r'));

            if (!isset($_SERVER['argv'])) {
                die('This script must be run from the command line.');
            }
            $this->_runner = $this->createCommandRunner();
            $this->_runner->commands = $this->commandMap;
            $this->_runner->addCommands($this->getCommandPath());

            $env = @getenv('CONSOLE_COMMANDS');
            if (!empty($env)) {
                $this->_runner->addCommands($env);
            }

            foreach ($this->modules as $name => $settings) {
                $modulePath = Alias::get("Modules." . $name . ".Commands");
                if ($modulePath) {
                    $this->_runner->addCommands($modulePath);
                }
            }
        } else {
            // preload 'request' so that it has chance to respond to onBeginRequest event.
            $this->getComponent('request');
        }
    }
387307
public function load(): self
    {
        $this->loader = new Loader($this->files, true);
        $this->loader->load();

        return $this;
    }
982140
protected function initQueue()
	{
		if ($this->beingDestroyed) {
			throw new \RuntimeException(self::ERROR_BEING_DESTROY);
		}
		$this->idleQueue = new \SplQueue();
		$this->taskQueue = new \SplQueue();
		
		return $this;
	}
498437
public function initialize()
    {
        try {
            $this->logger->debug('Connecting to the websocket');
            $this->engine->connect();
            $this->logger->debug('Connected to the server');

            $this->isConnected = true;
        } catch (SocketException $e) {
            $this->logger->error('Could not connect to the server', ['exception' => $e]);

            throw $e;
        }

        return $this;
    }
805557
final public function init() {
		if ($this->request_initted)
			return;
		$this->init_request();
		if ($this->auto_shutdown)
			register_shutdown_function([$this, 'shutdown']);
		$this->request_initted = true;
		return $this;
	}
461613
public static function i()
    {
        $class = get_called_class();
        $initArgs = func_get_args();
        if (count($initArgs) === 1) {
            $initArgs = $initArgs[0];
        }

        if (!empty(self::$_baseInstances[$class])) {
            $inst = self::$_baseInstances[$class];
            if (!empty($initArgs)) {
                $inst->initConfig($initArgs);
            }

            return $inst;
        }

        return new $class($initArgs);
    }
1075866
public function run()
    {
        if ($this->initialized) {
            $this->console(sprintf("Start running '%s' method of script '%s'.", $this->opts->action, get_class($this)));
            $this->{$this->action}();
            $this->console(sprintf("End of running '%s' cli script.", get_class($this)), true);
        }

        return $this;
    }
569342
public function init()
    {
        if ($this->initialized) {
            return $this;
        }

        $result = $this->getEventManager()->trigger(self::EVENT_INIT_BEFORE, $this);
        $xml = $result->last();

        // Init before may short circuit init process (i.e. Chaching)
        if (is_string($xml) || ($xml instanceof SimpleXmlElement) || (is_object($xml) && method_exists($xml, '__toString'))) {
            $this->initialized = true;
            return $this->setXml($xml);
        }

        $this->loadXml();
        $this->getEventManager()->trigger(self::EVENT_INIT_AFTER, $this);

        $this->initialized = true;
        return $this;
    }
1084413
public function init() {
		if ($this->initialized)
			return $this;
		$this->initialized = true;
		$this->check_tables();
		return $this;
	}
1318565
protected function initContainer()
    {
        $initNode = $this->getResolver()->getSectionId('', 'init');

        if ($this->getResolver()->has($initNode)) {
            $this->getFactory()->executeMethodBatch(
                $this->getResolver()->get($initNode)
            );
        }
        return $this;
    }
115689
protected function _initItems()
    {
        if (!$this->_itemsXmlPath) {
            throw new RuntimeException('XML Path for facade items is not specified');
        }
        
        $config = Mage::getConfig()->getNode($this->_itemsXmlPath)->children();
        
        foreach ($config as $class) {
            $this->add(Mage::getModel($class));
        }
        
        return $this;
    }
1370205
public function init()
    {
        if ($this->initialized) {
            return $this;
        }

        $this->grav = Grav::instance();
        $this->config = $this->grav['config'];

        // Enable/disable debugger based on configuration.
        $this->enabled = (bool)$this->config->get('system.debugger.enabled');

        if ($this->enabled()) {
            $this->initialized = true;

            $plugins_config = (array)$this->config->get('plugins');

            ksort($plugins_config);

            $debugbar = $this->debugbar;
            $debugbar->addCollector(new MemoryCollector());
            $debugbar->addCollector(new ExceptionsCollector());
            $debugbar->addCollector(new ConfigCollector((array)$this->config->get('system'), 'Config'));
            $debugbar->addCollector(new ConfigCollector($plugins_config, 'Plugins'));
            $this->addMessage('Grav v' . GRAV_VERSION);
        }

        return $this;
    }
988081
public function init()
    {
        $oInput         = Factory::service('Input');
        $iTestingAsUser = $oInput->header(Testing::TEST_HEADER_USER_NAME);

        if (Environment::not(Environment::ENV_PROD) && $iTestingAsUser) {

            $oUser = $this->getById($iTestingAsUser);
            if (empty($oUser)) {
                set_status_header(500);
                ErrorHandler::halt('Not a valid user ID');
            }
            $this->setLoginData($oUser->id);

        } else {

            //  Refresh user's session
            $this->refreshSession();

            //  If no user is logged in, see if there's a remembered user to be logged in
            if (!$this->isLoggedIn()) {
                $this->loginRememberedUser();
            }
        }
    }
578316
public function run()
    {
        $this->init();
        try {
            $this->bootstrap();
            $this->route();
            $this->dispatch();
        } catch (Exception $e) {
            if (APPLICATION_ENV == self::ENV_DEV) {
                var_dump($e);
            } else {
                throw $e;
            }
        }
        return $this;
    }
239743
function initialize()
    {
        if ($this->isInitialize())
            return $this;

        // ) Load Modules ------------------------------------------------------\
        $serviceManager = $this->getServiceManager();
        /** @var ModuleManager $moduleManager */
        $moduleManager  = $serviceManager->get('ModuleManager');
        $moduleManager->loadModules();

        // ) Attach Listeners To Events ----------------------------------------\
        $events = $this->getEventManager();
        foreach ($this->listeners as $listener) {
            if (!is_object($listener)) {
                if (class_exists($listener))
                    $listener = new $listener();
                else
                    $listener = $this->getServiceManager()->get($listener);
            }

            if (!$listener instanceof ListenerAggregateInterface)
                throw new \Exception(sprintf(
                    'Listener must instance of "ListenerAggregateInterface" but "%s" given.'
                    , is_object($listener) ? get_class($listener) : gettype($listener)
                ));

            // Attach Aggregate Listener
            $events->attach($listener);
        }

        // Ci) Bootstrap Application --------------------------------------------\
        $this->bootstrap();

        $this->__isInitialize = true;

        return $this;
    }
1237746
public function init()
    {
        $serviceFactory = new \OAuth\ServiceFactory();
        $serviceFactory->setHttpClient(new CurlClient());
        $this->service = $serviceFactory->createService(
            $this->getServiceName(), $this->credentials, $this->sessionStorage, $this->scopes
        );

        return $this;
    }