Overwrite default init to support subsites (if installed)

@return void
501147
protected function init()
    {
        parent::init();

        // Setup current controller on init (as Security::getMember()
        // is not available on construction)
        $dataRecord = ShoppingCartFactory::create()->getCurrent();
        $this->setDataRecord($dataRecord);
        $this->setFailover($this->dataRecord);

        # Check for subsites and add support
        if (class_exists(Subsite::class)) {
            $subsite = Subsite::currentSubsite();

            if ($subsite && $subsite->Theme) {
                SSViewer::add_themes([$subsite->Theme]);
            }

            if ($subsite && i18n::getData()->validate($subsite->Language)) {
                i18n::set_locale($subsite->Language);
            }
        }
    }
1049015
public function initDefaultDirectories()
    {
        $this->setParam(DirectoryKeys::DATA, ParamNode::TYPE_STRING, '/data');
        $this->setParam(DirectoryKeys::CACHE, ParamNode::TYPE_STRING, '/cache');
        $this->setParam(DirectoryKeys::SESSION, ParamNode::TYPE_STRING, '/session');
    }
772787
public function init() {
    $git_repo = exec('basename `git rev-parse --show-toplevel`');

    // Remove instructions for creating a new repo, because we've got one now.
    $readme_contents = file_get_contents('README.md');
    $start_string = '### Initial build (new repo)';
    $end_string = '### Initial build (existing repo)';
    $from = $this->findAllTextBetween($start_string, $end_string, $readme_contents);

    $find_replaces = array(
      array(
        'source' => 'composer.json',
        'from' => '"name": "thinkshout/drupal-project",',
        'to' => '"name": "thinkshout/' . $git_repo . '",',
      ),
      array(
        'source' => '.env.dist',
        'from' => 'TS_PROJECT="SITE"',
        'to' => 'TS_PROJECT="' . $git_repo . '"',
      ),
      array(
        'source' => 'README.md',
        'from' => array($from, 'new-project-name'),
        'to' => array($end_string, $git_repo),
      ),
    );

    foreach ($find_replaces as $find_replace) {
      $this->taskReplaceInFile($find_replace['source'])
        ->from($find_replace['from'])
        ->to($find_replace['to'])
        ->run();
    }
  }
763004
protected function _initialize()
    {
        $config = $this->_config->get('joomla');

        if(is_null($config) || !is_array($config)) {
            $config = array();
        }

        $defaults = array(
            'name' => 'root',
            'username'  => 'root',
            'groups'    => array(8),
            'email'     => 'root@localhost.home'
        );

        $this->_credentials = array_merge($defaults, $config);

        $this->_bootstrap();
        $this->_loadFramework();
    }
31130
public function setInit(bool $init)
    {
        $this->init = $init;

        $this->hostConfig = array_merge($this->hostConfig, ['Init' => $init]);

        return $this;
    }
30355
protected function initTemplates()
    {
        foreach ($this->templates as $template => $templatePath) {
            $this->templates[$template] = $this->normalizePath($templatePath);
        }

        if (!isset($this->templates['default'])) {
            $this->templates['default'] = realpath(dirname(__DIR__) . '/../templates/default');
        }
    }
1313105
private function initialize()
    {
        $params = $this->getParameters();

        if ($params) {
            foreach ($params as $param) {
                $setter = 'set' . str_replace(' ', '', ucwords(str_replace('-', ' ', $param->getName())));
                if (FALSE === method_exists($this, $setter)) {
                    $msg = sprintf('Unknown parameter "%s" for LocalConfigurationFilter!', $param->getName());
                    throw new BuildException($msg);
                }

                call_user_func(array($this, $setter), $param->getValue());
            }
        }

        if (NULL === $this->installTool) {
            $this->addInstallTool();
        }
    }
647801
public function initialize()
    {
        $app = $this->app;

        $include = $app->request->get('!include');
        if (!empty($include)) {
            Norm::options('include', true);
        }

        $tz = $app->request->get('!tz');
        if (!empty($tz)) {
            Norm::options('tz', $tz);
        }

        if (!isset($this->options['datasources'])) {
            $this->options['datasources'] = $this->app->config('norm.datasources');
        }

        // DEPRECATED: norm.databases deprecated
        if (!isset($this->options['datasources'])) {
            $this->options['datasources'] = $this->app->config('norm.databases');
        }

        if (!isset($this->options['datasources'])) {
            throw new \Exception('[Norm] No data source configuration. Append "norm.datasources" bono configuration!');
        }

        if (!isset($this->options['collections'])) {
            $this->options['collections'] = $this->app->config('norm.collections');
        }

        Norm::init($this->options['datasources'], $this->options['collections']);

        $controllerConfig = $this->app->config('bono.controllers');
        if (!isset($controllerConfig['default'])) {
            $controllerConfig['default'] = 'Norm\\Controller\\NormController';
        }
        $this->app->config('bono.controllers', $controllerConfig);

        if (! class_exists('Norm')) {
            class_alias('Norm\\Norm', 'Norm');
        }

        $d = explode(DIRECTORY_SEPARATOR.'src', __DIR__);
        $this->app->theme->addBaseDirectory($d[0], 10);
    }
298440
protected function init()
    {
        $this->addOption('p')
            ->alias('package')
            ->description('Package name');

        $this->addOption('r')
            ->alias('replace')
            ->description('Replace current file instead save to tmp.')
            ->defaultValue(false);

        $this->addOption('f')
            ->alias('flat')
            ->description('Flatten language keys as one level.')
            ->defaultValue(false);

        $this->addOption('s')
            ->alias('sort')
            ->description('Sort language keys.')
            ->defaultValue(false);
    }
313561
public function init() {
		
		// Prevents the extension from registering scripts and publishing assets when ran from the command line.
		if ($this->isInConsoleMode() && !$this->isInTests())
			return;

        self::setBooster($this);

        $this->setRootAliasIfUndefined();

		$this->setAssetsRegistryIfNotDefined();

		$this->includeAssets();

		parent::init();
	}
581239
protected function initConfig(): void
    {
        $configFile = $this->getRootRelatedPath($this->getConfigFileName());

        $this->assertFileIsReadable($configFile);

        self::$config = (array)(include $configFile);
    }
590639
public function init(): void
    {
        parent::init();

        foreach (['useTablePrefix', 'showOnly', 'generalSchema', 'fixHistory'] as $property) {
            if ($this->$property !== true) {
                if ($this->$property === 'true' || $this->$property === 1) {
                    $this->$property = true;
                }

                $this->$property = (bool)$this->$property;
            }
        }
    }
355883
static function Init()
	{
		require_once 'verysimple/Phreeze/Controller.php';
		require_once 'verysimple/HTTP/RequestUtil.php';

		if (!self::$IS_INITIALIZED)
		{
			RequestUtil::NormalizeUrlRewrite();

			Controller::$SmartyViewPrefix = '';
			Controller::$DefaultRedirectMode = 'header';

			self::$IS_INITIALIZED = true;
		}

	}
908547
protected function initDefaultFiles()
    {
        $logDir = $this->getParam(DirectoryKeys::VAR_LOG) . DIRECTORY_SEPARATOR;
        $this->setParam(FileKeys::APPSERVER_ERRORS_LOG, ParamNode::TYPE_STRING, $logDir . 'appserver-errors.log');
        $this->setParam(FileKeys::APPSERVER_ACCESS_LOG, ParamNode::TYPE_STRING, $logDir . 'appserver-access.log');
    }
586513
private function initialize()
    {
        $this->extension = 'module';
        $this->extensions = [
            'module' => [],
            'theme' => [],
            'profile' => [],
        ];
        $this->filters = [
            'showInstalled' => false,
            'showUninstalled' => false,
            'showCore' => false,
            'showNoCore' => false
        ];
    }
712441
protected function _init() {
		if (!$this->_config['host']) {
			throw new ConfigException('No host configured.');
		}

		if (HostString::isSocket($this->_config['host'])) {
			$this->_config['dsn'] = sprintf(
				'mysql:unix_socket=%s;dbname=%s',
				$this->_config['host'],
				$this->_config['database']
			);
		} else {
			$host = HostString::parse($this->_config['host']) + [
				'host' => static::DEFAULT_HOST,
				'port' => static::DEFAULT_PORT
			];
			$this->_config['dsn'] = sprintf(
				'mysql:host=%s;port=%s;dbname=%s',
				$host['host'],
				$host['port'],
				$this->_config['database']
			);
		}
		parent::_init();

		$this->_operators += [
			'REGEXP' => [],
			'NOT REGEXP' => [],
			'SOUNDS LIKE' => []
		];
	}
776396
protected function init_as_singlesite() {
		$this->admin_email = get_bloginfo('admin_email');
		$this->name = get_bloginfo('name');
		$this->title = $this->name;
		$this->description = get_bloginfo('description');
		$this->theme = new Theme();
		$this->multisite = false;
	}