Startup callback.

Initializes defaults.

@return void
549864
public function startup()
    {
        $reflector = new ReflectionClass('Resque');
        $this->_resqueLibrary = dirname(dirname($reflector->getFileName()));

        $reflector = new ReflectionClass('ResqueScheduler\ResqueScheduler');
        $this->_resqueSchedulerLibrary = dirname(dirname(dirname($reflector->getFileName())));

        $this->ResqueStatus = new ResqueStatus(Resque::redis());

        $this->_io->styles('success', ['text' => 'green']);
        $this->_io->styles('bold', ['bold' => true]);
    }
839901
public function boot()
    {
        $this->setFingerprint(mt_rand());

        $this->setArguments($this->getMessages());
        $this->setSingular($this->getArgument('title'));
        $this->setPlural($this->getArgument('title'));
        // $this->setValue($this->getArgument('default'));

        $this->manager->boot($this);
    }
1188397
public function boot()
    {
        if ($this->booted) {
            return;
        }

        \array_walk($this->loadedProviders, function ($p) {
            $this->bootProvider($p);
        });

        // Once the application has booted we will also fire some "booted" callbacks
        // for any listeners that need to do work after this initial booting gets
        // finished. This is useful when ordering the boot-up processes we run.
        $this->fireAppCallbacks($this->bootingCallbacks);

        $this->booted = true;

        $this->fireAppCallbacks($this->bootedCallbacks);
    }
1346615
protected function defaults()
    {
        parent::defaults();

        if ($this->isMissingLeft()) {
            $this->left();
        }

        if ($this->isMissingRight()) {
            $this->right();
        }
    }
1078275
public function init() {

        $args = $this->console->arguments;

        $args->parse();

        if ( $args->defined('hardstart') ) {

            $this->hardstart();

        }

        if ( $args->defined('daemon') ) {

            $this->daemonize();

        } else if ( $args->defined('foreground') ) {

            if ( $args->defined('verbose') ) {
                $this->logger->pushHandler(new LogHandler());
            }

            $this->start();

        } else {

            $this->console->pad()->green()->usage();
            $this->end(0);

        }

    }
582247
public function boot() {

		if (!$this->booted) {

			if(!isset($this['debug'])) {
				$this['debug'] = false;
			}

			if(!isset($this['salt'])) {
				$this['salt'] = md5(__DIR__);
			}

			date_default_timezone_set($this['timezone']);

			$this->initialize();

		}

		parent::boot();
	}
578666
public function onInit()
    {
        $this->nameSort = Utility::get($this->params, '{name}', null);
        $this->labelSort = Utility::get($this->params, '{label}', null);
        $this->fixedColumns = Utility::get($this->params, 'fixedColumns', null);
    }
402511
public function initDefaults() {
        /**
         * @var Tree $this
         */
        $module = Yii::$app->controller->module;
        $iconTypeAttribute = null;
        extract($module->dataStructure);
        $this->setDefault($iconTypeAttribute, TreeView::ICON_CSS);
        foreach (static::$boolAttribs as $attr) {
            $val = in_array($attr, static::$falseAttribs) ? false : true;
            $this->setDefault($attr, $val);
        }
    }
794581
public function actionInit() : void
    {
        $this->initSURole();
        $config = $this->loadConfig();
        $this->applyConfig($config);
        $this->applyAssignConfig($config);
        $this->addAssignmentsToSu();
        $this->log(true);
    }
679025
public function init()
    {
        $default = $this->config->get('system.languages.default_lang');
        if (isset($default) && $this->validate($default)) {
            $this->default = $default;
        } else {
            $this->default = reset($this->languages);
        }

        $this->page_extensions = null;

        if (empty($this->languages)) {
            $this->enabled = false;
        }
    }
571682
private function startup()
    {
        $this->registerSigHandlers();
        $this->pruneDeadWorkers();
        Event::trigger('beforeFirstFork', $this);
        $this->registerWorker();
    }
145855
protected function set_defaults()
	{
		parent::set_defaults();
		$this->headers = array();

		if ( ! empty($this->preserve_resource))
		{
			$this->resource = $this->preserve_resource;
			$this->preserve_resource = null;
		}

		return $this;
	}
665086
protected function onInit()
    {
        foreach ($this->params as $cName => $cParams) {
            if (gettype($cParams) == "array") {
                $bucket = Utility::get($cParams, "bucket");
                $formatString = Utility::get($cParams, "formatString");
                $this->params[$cName] = array(
                    "bucket" => $bucket,
                    "formatString" => $formatString ? $formatString : $this->defaultFormatString($bucket),
                );
            } else {
                //cParams now is bucket
                $this->params[$cName] = array(
                    "bucket" => $cParams,
                    "formatString" => $this->defaultFormatString($cParams),
                );

            }
        }
    }
550223
protected function startup()
    {
        parent::startup();

        // change language
        if (is_numeric($this->getParam('l'))) {
            $this->changeLanguage($this->getParam('l'));
        }

        // set language
        if (is_numeric($this->getParam('language'))) {
            $this->language = $this->em->find('WebCMS\Entity\Language', $this->getParam('language'));
        } else {
            $this->language = $this->em->getRepository('WebCMS\Entity\Language')->findOneBy(array(
                'defaultFrontend' => TRUE,
            ));
        }

        $this->abbr = $this->language->getDefaultFrontend() ? '' : $this->language->getAbbr().'/';

        // load languages
        $this->languages = $this->em->getRepository('WebCMS\Entity\Language')->findAll();

        setlocale(LC_ALL, $this->language->getLocale());
        \WebCMS\Helpers\PriceFormatter::setLocale($this->language->getLocale());

        // translations
        $translation = new \WebCMS\Translation\Translation($this->em, $this->language, 0, $this->getContext()->getService('cacheStorage'));
        $this->translation = $translation->getTranslations();
        $this->translator = new \WebCMS\Translation\Translator($this->translation);

        // system settings
        $this->settings = new \WebCMS\Settings($this->em, $this->language);
        $this->settings->setSettings($this->getSettings());

        // mobile device detection
        $this->mobileDetect = new \WebCMS\MobileDetect;

        // system helper sets variables
        \WebCMS\Helpers\SystemHelper::setVariables(array(
            'baseUrl' => $this->presenter->getHttpRequest()->url->baseUrl,
            'infoEmail' => $this->settings->get('Info email', 'basic')->getValue(),
        ));

        $id = $this->getParam('id');
        if ($id) {
            $this->actualPage = $this->em->find('WebCMS\Entity\Page', $id);

            if ($this->actualPage->getRedirect() != NULL) {
                if (strpos($this->actualPage->getRedirect(), 'http') === false) {
                    $this->redirectUrl($this->presenter->getHttpRequest()->url->baseUrl . $this->actualPage->getRedirect());   
                } else {
                    $this->redirectUrl($this->actualPage->getRedirect());
                }
            }
        }

        if (!file_exists('sitemap.xml')) {
            $this->generateSitemap();
        }

        if (is_object($this->actualPage)) {
            $this->setDefaultSeo();
        }

        // generate sitemap if doesn't exist yet
        if (!file_exists('sitemap.xml')) {
            $this->generateSitemap();
        }

        if ($this->isAjax()) {
            $this->invalidateControl();

            $this->payload->title = $this->template->seoTitle;
            $this->payload->url = $this->link('this', array(
                'path' => $this->actualPage->getPath(),
                'abbr' => $this->abbr,
            ));
            $this->payload->nameSeo = $this->actualPage->getSlug();
            $this->payload->name = $this->actualPage->getTitle();
            $this->payload->class = $this->actualPage->getClass();
        }
    }
1068217
public function init()
    {
        // Initialize filepath with configs
        $funcs = $this->getFunctions('Setting', [
            'admin-bar',
            'admin-footer',
            'admin-menu-order',
            'admin-meta-boxes',
            'comments-fields-order',
            'jpeg-quality',
        ]);

        // Check functions
        if (empty($funcs)) {
            return;
        }

        // Iterate on functions
        foreach ($funcs as $key => $args) {
            $this->$func($args);
        }
    }
227460
public function bootIfNotBooted()
    {
        if (
            isset($this->defaultValues)
            || is_array($this->defaultValues)
            || !empty($this->defaultValues)
        ) {
            $attributes = array_replace_recursive($this->defaultValues, $this->attributes);

            $this->fill($attributes);
        }

        parent::bootIfNotBooted();
    }
133144
private function loadSettings()
	{
    	// Set initial settings base on the initial config
		$userdefinedsettings = $this->initialConfig->get('settings')?: [];

		$this->initialSettings = new Settings();
		$this->initialSettings->loadSettings($userdefinedsettings);

    	// Set settings
        $userdefinedsettings = $this->config->get('settings')?: [];

		$this->settings = new Settings();
		$this->settings->loadSettings($userdefinedsettings);
    }