Will initialize the Controller and will do the Actions to which the Controller has register

@param \OWeb\types\Controller $controller The controller to Initialize
348176
public function initController(\OWeb\types\Controller $controller = null)
    {

        if ($this->controller == null)
            return;

        Events::getInstance()->sendEvent('Init_Prepare@OWeb\manage\Controller', $this->controller);

        $this->controller->initController();

        Events::getInstance()->sendEvent('Init_Done@OWeb\manage\Controller', $this->controller);

        Events::getInstance()->sendEvent('ActionDist_Prepare@OWeb\manage\Controller', $this->controller);

        //gestion des Actions...
        $source[] = \OWeb\OWeb::getInstance()->get_get();
        $source[] = \OWeb\OWeb::getInstance()->get_post();

        foreach ($source as $get) {
            if (isset($get['action']))
                $this->controller->doAction($get['action']);

            $i = 1;
            while (isset($get['action_' . $i])) {
                $this->controller->doAction($get['action_' . $i]);
                $i++;
            }
        }

        Events::getInstance()->sendEvent('ActionDist_Done@OWeb\manage\Controller', $this->controller);
    }
108400
public function run($controller, $request)
    {
        $instance = $controller;
        if (!is_object($controller)) {
            $instance = $this->instanceController($controller);
        }

        if(!($instance instanceof Controller)) {
            throw new \Exception('Controller: ' . $controller . ' is not an instanceOf ' . Controller::class);
        }

        $instance->onCreate();

        if ($instance instanceof Controller) {
            $this->checkUserPermissions($instance);

            return $instance->call($request);
        }
        return false;
    }
68589
public function onControllerInit(BaseController $controller)
    {
        // 除去 admin/login 页面
        if (substr($this->app->getController(), 0, 6) === 'admin/') {
            $controller->middleware(CheckAppStatus::class);
        }

        $this->checkCli();
    }
1322961
public function controller($controller)
    {

        // Instantiate a string controller
        if (is_string($controller)
            && class_exists($controller)
            && is_subclass_of($controller, 'Bkwld\Decoy\Controllers\Base')) {
            $this->controller_name = $controller;
            $this->controller = new $controller;

            // Apply the parent if one was set
            if ($this->parent_item && $this->controller) {
                $this->controller->parent($this->parent_item);
            }

        // Or, validate a passed controller instance
        } elseif (is_object($controller)
            && is_a($controller, 'Bkwld\Decoy\Controllers\Base')) {
            $this->controller_name = get_class($controller);
            $this->controller = $controller;
        }

        // Chain
        return $this;
    }
725362
public function render($controller = null)
    {
        // If we have parent module connection and have no view set
        if (isset($this->parent) && $this->view_path == false /*&& !method_exists($this, $controller)*/) {
            // Merge current and parent module view data
            $this->parent->view_data = array_merge($this->parent->view_data, $this->view_data);
            // Set internal view context data pointer
            $this->parent->data = &$this->parent->view_data[$this->parent->view_context];
            // Call parent render
            $this->parent->render($controller);
        } else { // Call default module behaviour
            parent::render($controller);
        }
    }
89835
public static function init(&$config) {
		$controllers = CacheManager::getControllers ();
		foreach ( $controllers as $controller ) {
			CacheManager::$cache->remove( self::getControllerCacheKey ( $controller ));
			$parser = new DiControllerParser ();
			$parser->parse ( $controller, $config );
			$injections = $parser->getInjections ();
			if (sizeof ( $injections ) > 0) {
				self::store ( $controller, $parser->__toString () );
			}
		}
	}
1144860
public function initialize(Controller $controller) {
		$this->_controller = $controller;
		if (!$this->_controller->Components->loaded('RequestHandler')) {
			$this->_controller->RequestHandler = $this->_controller->Components->load('RequestHandler');
			$this->_controller->RequestHandler->initialize($this->_controller);
		}
		if (!$this->_controller->Components->loaded('Session')) {
			$this->_controller->Session = $this->_controller->Components->load('Session');
			$this->_controller->Session->initialize($this->_controller);
		}
		if ($this->_controller->Auth->loggedIn() ||
			$this->_controller->RequestHandler->prefers('json')) {
			return;
		}

		$isAuthCfg = $this->_modelSetting->isAuthGroupConfigured();
		if ($isAuthCfg) {
			if ($this->_controller->Session->read('Settings.FirstLogon')) {
				$this->_controller->Session->delete('Settings.FirstLogon');

				return $this->_controller->redirect($this->_controller->Auth->logout());
			}

			return;
		}

		$pluginName = $this->_controller->request->param('plugin');
		$controllerName = $this->_controller->request->param('controller');
		$actionName = $this->_controller->request->param('action');
		if (($pluginName !== 'cake_settings_app') ||
			($controllerName !== 'settings') ||
			($actionName !== 'index')) {
			return;
		}

		$this->_controller->Auth->allow('index');
		$this->_controller->Session->write('Settings.FirstLogon', true);
	}
796189
private function registerControllers()
    {
        $this->_controller = new Controller();
        $this->_controller->load($this->_router,
        $this->_config->get('basepath'));
    }
1128197
protected function uses(String & $controller)
    {
        if( ! empty($this->settings['use']) )
        {
            foreach( $this->settings['use'] as $key => $use )
            {
                if( is_numeric($key) )
                {
                    $controller .= "use {$use};".EOL;
                }
                else
                {
                    $controller .= "use {$key} as {$use};".EOL;
                }
            }

            $controller .= EOL;
        }
    }
755666
public function generate($controller)
    {
        if (!$controller instanceof Controller) {
            $controller = new $controller('', null);
        }
        $this->controller = get_class($controller);
        $this->admin = $controller->admin;
        $this->title = $controller->name;
        $this->description = $controller->description;
    }
322743
public function hookTheme(Controller $controller)
    {
        if ($controller->isCurrentTheme('mobile') && !$controller->isInternalRoute()) {
            $this->setModuleAssets($controller);
            $this->setModuleMetaTags($controller);
        }
    }
377299
public function addAction($controller, $action = null)
    {
        if ($action === null) {
            list($controller, $action) = explode('.', $controller);
        }
        $this->actions[] = array(
            'controller' => null,
            'controller_name' => $controller,
            'action' => $action,
            'result' => null,
        );
        $this->action_names[] = "{$controller}.{$action}";
    }
898083
public function setController(Controller $controller)
    {
        $this->_Controller = $controller;
        $this->setEventManager($controller->getEventManager());
    }
556099
protected function configureController(Controller $controller)
    {
        parent::configureController($controller);
        $controller[] = new Entity($this->entityName);
    }
435227
public function setController(AController $controller) {
        if (count(self::$_modules) > 0) {
            foreach (self::$_modules as $module) {
                $module->setController($controller);
            }
        }
    }
637400
protected function vars(String & $controller)
    {
        if( ! empty($this->settings['vars']) )
        {
            $var = '';
            foreach( $this->settings['vars'] as $isKey => $var )
            {
                if( ! is_numeric($isKey) )
                {
                    $value = $var;
                    $var   = $isKey;
                }

                $vars = $this->vartype($var);
                $controller .= HT.$vars->priority.' $'.$vars->var.( ! empty($value) ? " = ".$value : '' ).";".EOL;
            }

            $controller .= EOL;
        }
    }
521690
private function registerRoutes($controller, $controllerService, $reflectionClass)
    {
        $methods = $reflectionClass->getMethods();

        foreach ($methods as $reflectionMethod) {
            $route = $this->reader->getMethodAnnotation($reflectionMethod, 'Singular\Annotation\Route');

            $beforeFilters = $this->reader->getMethodAnnotation($reflectionMethod, 'Singular\Annotation\Before');
            $afterFilters = $this->reader->getMethodAnnotation($reflectionMethod, 'Singular\Annotation\After');

            if ($route) {
                $this->registerBasicRoute($route, $controller, $controllerService, $reflectionClass, $reflectionMethod, $beforeFilters, $afterFilters);
            }
        }
    }