Инициализация модуля

@return $this
346912
public function init($config = null)
    {
        $config = $config ?: Env::getLegacyConfig();
        $host = $config->get('host', 'amqp', 'localhost');
        $port = $config->get('port', 'amqp', 5672);
        
        $this->defaultServerId = $host . ':' . $port;
        
        $this->servers[$this->defaultServerId] = [
            self::SERVER_HOST => $host,
            self::SERVER_PORT => $port
        ];
        
        $this->registeredQueues = [
            self::ALL_QUEUES => $this->defaultServerId
        ];
        
        $this->nodeId = $this->_prepareQueueName(gethostname() . ':' . getmypid());
        
        return $this;
    }
154457
public function initialize()
    {
        $request = $this->router->getAction();

        $isRouteCallback = $this->processRequestParameters($request);

        $this->start($isRouteCallback);

        return $this;
    }
444812
public function init()
    {
        foreach ($this->dynamic as $key => $data) {
            $field = &$this->items[$key];

            foreach ($data as $property => $call) {
                $action = 'dynamic' . ucfirst($call['action']);

                if (method_exists($this, $action)) {
                    $this->{$action}($field, $property, $call);
                }
            }
        }

        return $this;
    }
652696
protected function validateIni()
    {
        $data = $this->configuration;
        if (!isset($data['ini'])) {
            array_push($this->messages, ['error', trans('Unable to read php ini configuration. It is recommended to contact with your provider.')]);
            return $this;
        }
        if (empty(self::$iniRequirements)) {
            return $this;
        }
        $ini = $data['ini'];

        foreach (self::$iniRequirements as $name => $value) {
            if (!isset($ini[$name])) {
                array_push($this->messages, ['error', sprintf('Option (%s) not exists in php ini configuration.', $name)]);
            } else {
                if ($ini[$name]['global_value'] != $value) {
                    array_push($this->messages, ['warning', sprintf('Option (%s) is not same with minimal requirement. Found %s expected %s.', $name, $ini[$name]['global_value'], $value)]);
                }
            }
        }
        return $this;
    }
642632
public function doConfirm()
    {
        if ($this->isConfirmable()) {
            $this->status = self::STATUS_CONFIRMED;

            $this->save();
        }

        return $this;
    }
1222689
public function bootstrap(): self
    {
        if (!$this->info->installMode()) {
            $this->getApplicationInitializer()->init($this);
            $this->emit('system.init');

            return $this;
        }

        $manager = $this->moduleManager();

        /** @var Module|null $installer */
        $installer = null;

        foreach ($manager->modules() as $module) {
            if ($module->isApplicationInstaller()) {
                if ($installer !== null) {
                    $formatText = '%s was defined as an application installer before %s';
                    $formatArgs = [$installer->name(), $module->name()];
                    throw new \RuntimeException(vsprintf($formatText, $formatArgs));
                }

                $installer = $module;
            }
        }

        if ($installer === null) {
            throw new \RuntimeException("No application installer was found");
        }

        $enabled = [$installer->name() => Module::ENABLED];

        foreach ($manager->recursiveDependencies($installer) as $module) {
            $enabled[$module->name()] = Module::ENABLED;
        }

        $this->getApplicationInitializer()->init($this);
        $manager->setStatusList($enabled);

        $this->emit('system.init');

        return $this;
    }
38125
public function reset()
    {
        $this->controllerResolver->reset();
        $this->repositoryResolver->reset();
        $this->viewResolver->reset();

        return $this;
    }
373770
public function initialize() {
        if ($data = $this->getLocaleBundle()->loadResource(null, 'locale')) {
            $data = \Locale::parseLocale($data['code']) + $data;

            $config = $this->allConfig();
            unset($config['code'], $config['initialize']);

            $this->addConfig($config + $data);
        }

        // Force parent config to merge
        $this->getParentLocale();

        return $this;
    }
752685
public function initIndices()
    {
        $elems = $this->node->xpath("value[@key='indices']");
        $this->indices = $this->getFormatter()->createIndices($this, $elems[0]);

        return $this;
    }
574882
public function reset()
	{
		unset($this->_registry);
		unset($this->_mixin);
		unset($this->_errorHandler);
		unset($this->_errorContext);
		unset($this->_middleware);
		return $this;
	}
511285
private function setUp(): self
    {
        fn::allowCors();
        fn::allowHeader();
        $this->configApp();
        $this->configRoutes();

        return $this;
    }
38215
public function loadDefault() {
		foreach($this->getDefinition()->properties() as $name=>$property)
			$this->_set($name, $property->getDefault($this, $name), null, false);
		return $this;
	}
557451
protected function initGitUtil()
    {
        $this->gitUtil = new GitUtil($this->io, $this->config, $this->process, $this->filesystem);
        return $this;
    }
901689
public function reload()
	{
		$this->_relationships = array();
		$pk = array_values($this->getValuesFor($this->getPrimaryKey()));

		$this->setAttributesViaMassAssignment($this->find($pk)->attributes, false);
		$this->resetDirty();

		return $this;
	}
624002
public function populate()
    {
        $password = \Yii::$app->security->generateRandomString(6);

        $this->generateUsername();
        $this->setPassword($password);
        $this->generateAuthKey();

        return $this;
    }
1225072
protected function _initSettings()
    {
        try {

            $this->setAttributes($this->settings);
            $this->_oldAttributes = $this->toArray($this->safeAttributes());
        } catch (\Exception $e) {
            \Yii::error(\Yii::t('skeeks/cms', '{cms} component error load defaul settings',
                    ['cms' => 'Cms']).': '.$e->getMessage());
        }

        return $this;
    }
1161387
public function treat()
    {
        if (!$this->isTreated) {
            $this->initFetchValues();
            $this->isTreated = TRUE;
            if ($this->isActive()) {
                $this->validFetchValues();
            }
        }
        return $this;
    }