Initialize AppController

@return void
518175
public function initialize()
    {
        parent::initialize();

        $this->loadComponent('Flash');

        $this->loadComponent('CakeAdmin.CakeAdmin');

        $this->loadComponent('Auth', [
            'authorize' => ['Controller'],
            'authenticate' => [
                'Basic' => [
                    'userModel' => 'CakeAdmin.Administrators'
                ],
                'Form' => [
                    'userModel' => 'CakeAdmin.Administrators',
                    'fields' => Configure::read('CA.fields'),
                    'scope' => ['Administrators.cakeadmin' => true]
                ],
            ],
            'loginAction' => [
                'prefix' => 'admin',
                'plugin' => 'CakeAdmin',
                'controller' => 'Users',
                'action' => 'login'
            ],
            'loginRedirect' => [
                'prefix' => 'admin',
                'plugin' => 'CakeAdmin',
                'controller' => 'Dashboard',
                'action' => 'index'
            ],
            'logoutRedirect' => [
                'prefix' => 'admin',
                'plugin' => 'CakeAdmin',
                'controller' => 'Users',
                'action' => 'login'
            ]
        ]);

        $this->Auth->sessionKey = 'Auth.CakeAdmin';
        $this->authUser = $this->Auth->user();

        $this->loadComponent('Utils.GlobalAuth');
        $this->loadComponent('Csrf');
        $this->loadComponent('Utils.Menu');
        $this->loadComponent('CakeAdmin.PostTypes');
        $this->loadComponent('Notifier.Notifier');

        $event = new Event('CakeAdmin.Controller.afterInitialize', $this);
        EventManager::instance()->dispatch($event);
    }
1354408
private static function init() {
        self::$routes = new RoutesManager();
        self::$beforeRoutes = new RoutesManager();
        self::$afterRoutes = new RoutesManager();
        self::$errorRoutes = new RoutesManager();
        self::$notFoundRoutes = new RoutesManager();
    }
1261045
protected function initRouter(): void
    {
        $router = new \Bluz\Router\Router();
        $router->setOptions(Config::get('router'));

        Router::setInstance($router);
    }
202640
protected function _initView ()
    {
        // Create default view model, to be used in all templates and layouts
        $this->appView  = new \Zend\View\Model\ViewModel();

        // Convenience access variables
        $this->_appView = $this->appView;
        $this->view     = $this->appView;
        $this->_view    = $this->appView;
    }
943899
public function initialize()
    {
        if ($this->initialized) {
            throw new \Parable\Framework\Exception("App has already been initialized.");
        }

        // And now possible packages get their turn.
        $this->packageManager->registerPackages();

        $this->loadConfig();

        // Enable error reporting if debug is set to true
        if ($this->config->get('parable.debug') === true) {
            $this->setErrorReportingEnabled(true);
        } else {
            $this->setErrorReportingEnabled(false);
        }

        // Start the session if session.auto-enable is true
        if ($this->config->get('parable.session.auto-enable') !== false) {
            $this->startSession();
        }

        // Init the database if it's configured
        if ($this->config->get('parable.database.type')) {
            $this->loadDatabase();
        }

        // Set the basePath on the url based on the config
        if ($this->config->get('parable.app.homedir')) {
            $homedir = trim($this->config->get('parable.app.homedir'), DS);
            $this->url->setBasePath($homedir);
        }

        // See if there's any inits defined in the config
        if ($this->config->get('parable.inits')) {
            $this->loadInits();
        }

        // Set the default timezone if it's set
        if ($this->config->get('parable.timezone')) {
            date_default_timezone_set($this->config->get('parable.timezone'));
        }

        // Build the base Url
        $this->url->buildBaseurl();

        // Load the routes
        $this->loadRoutes();

        // And set the class to initialized
        $this->initialized = true;

        return $this;
    }
57156
public function initialize(Controller $controller) {
		$this->_controller = $controller;
		$this->_model = $this->_controller->{$this->_controller->modelClass};
		if (!$this->_controller->Components->loaded('RequestHandler')) {
			$this->_controller->RequestHandler = $this->_controller->Components->load('RequestHandler');
			$this->_controller->RequestHandler->initialize($this->_controller);
		}

		$this->_modelConfigTheme = ClassRegistry::init('CakeTheme.ConfigTheme');
	}
1039948
public function init()
    {
        // parsing needed if urlFormat 'path'
        if (Yii::app() instanceof CWebApplication) {
            Yii::app()->urlManager->parseUrl(Yii::app()->getRequest());
        }

        // 1. get language preference
        $preferred = null;
        if (isset($_GET[self::DATA_KEY])) {
            // use language from URL
            $preferred = $_GET[self::DATA_KEY];
        } elseif ($this->usePreferred) {
            // use preferred browser language as default
            $preferred = Yii::app()->request->preferredLanguage;
        } else {
            $preferred = Yii::app()->language;
        }

        // 2. select language based on available languages and mappings
        $lang = $this->resolveLanguage($preferred);

        if (is_null($lang) && $this->matchShort === true) {
            $preferredShort = substr($preferred, 0, 2);
            $lang           = $this->resolveLanguage($preferredShort);
        }
        // 3. set the language
        if (in_array($lang, $this->languages)) {
            Yii::app()->setLanguage($lang);
        } else {
            // fallback or output error
            if ($this->fallback) {
                // default app language
            } else {
                throw new CHttpException(404, "Language '{$_GET[self::DATA_KEY]}' is not available.");
            }
        }

        if ($this->localizedHomeUrl) {
            $controller         = new CController('P3LangHandlerDummy');
            Yii::app()->homeUrl = $controller->createUrl('/');
        }
    }
249451
private static function init() {
        $lang = isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])? substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2) : null;
        if (empty($lang))
            $lang = "es";
        self::$language = $lang;
        self::$messages = [];
        self::$messagesPath = get_property("app.messages_path", get_app()->resourcesPath() . DIRECTORY_SEPARATOR . "messages");
    }
830990
public function init()
    {
        if (
            !$this->serviceContainer->isRegistered(ServiceContainer::SERVICE_LOGGER)
            || !($this->getLogger() instanceof LoggerInterface)
        ) {
            $this->setService(ServiceContainer::SERVICE_LOGGER, new NullLogger());
        }
        $this->getControllerDispatcher()->setLogger($this->getLogger());
    }
655835
public static function init()
    {
        // Instantiate the application
        $app = Application::fromCwd();

        // Give proxies an instance of the application
        $app->initializeProxies();

        // Boot the app
        $app->boot();

        static::$appPath = \App::appPath();
        static::$vendorPath = \App::vendorPath();

        if (defined('COMPILING')) {
            static::$appPath = BUILD_PATH.'/app';
            static::$vendorPath = BUILD_PATH.'/vendor';
        }
    }
1198218
protected function init()
	{
		$this->environment = $this->getConfig('app.settings.environment');

		// locale and timezone set
		\Locale::setDefault($this->getConfig('app.settings.locale'));
		date_default_timezone_set($this->getConfig('app.settings.timezone'));


		// load objects
		$this->eventDispatcher = $this->container->get('Emitter');
	}
1354030
public function initApps()
    {
        if (count($this->apps) > 0) {
            throw new AlreadyInitiatedException('The apps are already loaded!');
        }

        foreach ($this->appList as $className) {
            $instance = new $className($this);
            $this->apps->append($instance);
        }

        // Let the apps configure itself.
        foreach ($this->apps as $app) {
            $app->load();
        }

        // Let the apps register it parts.
        foreach ($this->apps as $app) {
            $app->registerRoutes(Router::getInstance());
        }
    }
1266719
public function init() {

		parent::init();

		// Config
		$this->layout = Yii::$app->notify->defaultLayout ?? $this->layout;
	}
43191
public function init()
    {
        // Autoload the models and components directory 
        $this->setImport(array(
            'api.models.*',
            'api.components.*',
        ));
        
        // Disable layout rendering
        $this->layout = false;
        
        // Disable logging for the API
        foreach(Yii::app()->log->routes as $k=>$v)
        {
            if (get_class($v) == 'CWebLogRoute' || get_class($v) == "CProfileLogRoute")
                Yii::app()->log->routes[$k]->enabled = false; 
        }
        
        // Set default components and routes
        Yii::app()->setComponents(array(
            'errorHandler' => array(
                'errorAction'  => 'api/default/error',
            ),
            'messages' => array(
                'class' => 'cii.components.CiiPHPMessageSource',
                'basePath' => Yii::getPathOfAlias('application.modules.api')
            )
        ));
    }
687694
public function init()
	{
		parent::init();
		Yii::setPathOfAlias('gii',dirname(__FILE__));
		Yii::app()->setComponents(array(
			'errorHandler'=>array(
				'class'=>'CErrorHandler',
				'errorAction'=>$this->getId().'/default/error',
			),
			'user'=>array(
				'class'=>'CWebUser',
				'stateKeyPrefix'=>'gii',
				'loginUrl'=>Yii::app()->createUrl($this->getId().'/default/login'),
			),
			'widgetFactory' => array(
				'class'=>'CWidgetFactory',
				'widgets' => array()
			)
		), false);
		$this->generatorPaths[]='gii.generators';
		$this->controllerMap=$this->findGenerators();
	}
1146027
public function register(Application $app)
    {
        $this->loadProviders();

        foreach ($this->controllerProviders as $class => $values) {
            $app->register(new $class, $values);
        }
    }
795274
public function init()
	{
		if ($this->language === null) {
			$this->language = App::$Request->getLanguage();
		}

        if ($this->targetClass === null) {
            $this->targetClass = 'wysiwyg';
        }

        if ($this->config === null || !Arr::in($this->config, ['config-small', 'config-full', 'config-medium'])) {
            $this->config = 'config-default';
        }

        $this->baseUrl = App::$Alias->scriptUrl . '/vendor/phpffcms/ffcms-ckeditor/assets';
	}