Start application using routes

@return void
777462
public static function exec()
    {
        if (self::$state > 0) {
            return null;
        }

        self::$state = 1;

        self::trigger('init');

        if (self::env('maintenance')) {
            self::$state = 4;
            self::stop(503);
        }

        self::trigger('changestatus', array(\UtilsStatusCode(), null));

        $resp = Route::get();

        if (is_integer($resp)) {
            self::$state = 5;
            self::stop($resp, 'Invalid route');
        }

        $callback = $resp['callback'];

        if (!$callback instanceof \Closure) {
            $parsed = explode(':', $callback, 2);

            $callback = '\\Controller\\' . strtr($parsed[0], '.', '\\');
            $callback = array(new $callback, $parsed[1]);
        }

        $output = call_user_func_array($callback, $resp['args']);

        if (class_exists('\\Inphinit\\Http\\Response', false)) {
            Response::dispatch();
        }

        if (class_exists('\\Inphinit\\Viewing\\View', false)) {
            View::dispatch();
        }

        if (self::$state < 2) {
            self::$state = 2;
        }

        self::trigger('ready');

        if ($output || is_numeric($output)) {
            echo $output;
        }

        if (self::$state < 3) {
            self::$state = 3;
        }

        self::trigger('finish');

        if (self::$state < 4) {
            self::$state = 4;
        }
    }
585292
public static function Start() {
      
      self::$Prefixes = array(
         self::CONTEXT_CORE            => 'c',
         self::CONTEXT_APPLICATION     => 'a',
         self::CONTEXT_PLUGIN          => 'p',
         self::CONTEXT_THEME           => 't'
      );
      self::$ContextOrder = array(
         self::CONTEXT_THEME,
         self::CONTEXT_LOCALE,
         self::CONTEXT_PLUGIN,
         self::CONTEXT_APPLICATION,
         self::CONTEXT_CORE
      );
      
      self::$Maps = array();
      self::$MapGroups = array();
   
      // Register autoloader with the SPL
      spl_autoload_register(array('Gdn_Autoloader', 'Lookup'));
      
      // Configure library/core and library/database
      self::RegisterMap(self::MAP_LIBRARY, self::CONTEXT_CORE, PATH_LIBRARY.'/core');
      self::RegisterMap(self::MAP_LIBRARY, self::CONTEXT_CORE, PATH_LIBRARY.'/database');
      self::RegisterMap(self::MAP_LIBRARY, self::CONTEXT_CORE, PATH_LIBRARY.'/vendors');
      
      // Register shutdown function to auto save changed cache files
      register_shutdown_function(array('Gdn_Autoloader', 'Shutdown'));
   }
224494
public function start(): void
    {
        if (\session_status() !== PHP_SESSION_ACTIVE) {

            //prepare the session start
            \session_name($this->name);

            //start session
            \session_start([
                'cookie_path'      => $this->cookiePath,
                'cookie_domain'    => $this->cookieDomain,
                'cookie_lifetime'  => $this->expire,
                'cookie_secure'    => $this->cookieSecure,
                'cookie_httponly'  => $this->cookieHttpOnly
            ]);

            //link session super global to $data property
            $this->data = &$_SESSION;
        }

        //refresh session
        $this->refresh();
    }
969917
public function start() {
        // Don't load db if we don't want it (redo in the future)
        if($this->config->exists('database')) {
            $this->db = new DB\Connection($this->config);
        }

        $this->router = new Router($this->klein, $this->config);
    }
928654
private function start()
    {
        $name = $this->scaffoldCommandObj->getObjName('Name');
        $route_name = floatval(app()::VERSION) < 5.3 ? 'route_old' : 'route';
        $path = $this->getPath($name, $route_name);
        $stub = $this->compileRouteStub();
        
        if (strpos($this->files->get($path), $stub) === false) {
            $this->files->append($path, $this->compileRouteStub());
            return $this->scaffoldCommandObj->info('+ ' . $path . ' (Updated)');
        }
        
        return $this->scaffoldCommandObj->comment("x $path" . ' (Skipped)');
    }
899696
public function start()
    {
        $pipes = [];

        $this->process = call_user_func_array(
            $this->resourceOpen,
            [$this->executable, self::$descriptorspec, &$pipes]
        );

        // make output and error streams non-blocking streams
        stream_set_blocking($pipes[1], 0);
        stream_set_blocking($pipes[2], 0);

        $this->pipes = $pipes;
        $this->started = true;
    }
113931
public function route()
    {
        $this->routes->rewind();
        while ($this->routes->valid()) {
            $route = $this->routes->current();
            if ($route->run()) {
                return;
            }
            $this->routes->next();
        }

        throw new \RuntimeException("FlexPress router: No route found - please make sure you have setup routes.");

    }
217025
private function start()
    {
        # Starting session.
        # Here making session active to every request.
        new Session();

        $this->setBaseURL();
        $this->setRequestURI();
        $this->fetchRouteRules();
        $this->establishConnection();
        $this->locateMethod();
        $this->invokeMethod();
    }
1112751
public function start()
    {
        $routeType = $this->getType();
        if ($routeType == RouteType::NORMAL) {
            $this->typeNormal();
        }
        if ($routeType == RouteType::PATHINFO) {
            $this->typePathInfo();
        }
        if ($routeType == RouteType::MAP) {
            $this->typeMap();
        }
        if ($routeType == RouteType::SYMFONY) {
            $this->typeSymfony();
        }
        return true;
    }
450608
public function boot()
    {
        parent::boot();

        if (Request::is('*/portfolio/portfolio/*')) {
            Route::bind('portfolio', function ($portfolio) {
                $portfoliorepo = $this->app->make('Litecms\Portfolio\Interfaces\PortfolioRepositoryInterface');
                return $portfoliorepo->findorNew($portfolio);
            });
        }

        if (Request::is('*/portfolio/category/*')) {
            Route::bind('category', function ($category) {
                $categoryrepo = $this->app->make('Litecms\Portfolio\Interfaces\CategoryRepositoryInterface');
                return $categoryrepo->findorNew($category);
            });
        }

    }
793132
public function route()
    {
        global $logger;
        try {
            // TODO : Refactor Code :
            // $url    = URLParser::parse();
            // $route  = RouteMapper::getRoute($url['route']);
            // $router = new Router();
            // $router->route($route);
            $urlInterpreter = new UrlInterpreter();
            $command        = $urlInterpreter->getCommand();
            $router         = new Router($command);
            $logger->debug('Routing to : '.$command->getControllerName());
            $router->route();
        } catch (Exception $e) {
            throw new RouteNotFoundException();	
        }
    }
355581
protected function run()
    {
        if (PHP_SAPI === 'cli') {
            return;
        }
        
        if ($this->ctrlRouterInfos->target === null) {
            return;
        }
        
        $this->module
            ->monolog
            ->getLogger()
            ->debug(
                'Execute current route.',
                ['target' => $this->ctrlRouterInfos->target]
            );
        
        $useClass = $this->config->getValue('useClass');
        
        if ($useClass === true) {
            $this->runObject();
        } else {
            $this->runProcedural();
        }
    }
427305
public function run()
    {
        // Load routing user config file
        $this->routes();
        // Launch routage
        Router::resolve();
        // Load databases user config file
        $this->databases();
        // Load Bootstrap
        $this->bootstrap();
        // Launch Controller defined by routage
        $bodyContent = $this->controller();
        // Show body content return by Controller
        echo $bodyContent;
    }
266094
public function run()
    {
        // Firstly make sure, default is set
        if (!isset($this->config['components']['router']['default'])) {
            throw new RuntimeException('You should provide default controller for router');
        }

        $sl = $this->bootstrap();

        // Grab required services to run the application
        $request = $sl->get('request');
        $dispatcher = $sl->get('dispatcher');
        $response = $sl->get('response');

        // Do we need to perform SSL redirect?
        if (isset($this->config['components']['router']['ssl']) && $this->config['components']['router']['ssl'] == true) {
            $request->sslRedirect();
        }

        // We will start from route matching firstly
        $router = new Router();

        // Returns RouteMatch on success, false on failure
        $route = $router->match($request->getURI(), $dispatcher->getURIMap());
        $notFound = false;

        // $route is false on failure, otherwise RouteMatch is returned when found
        if ($route !== false) {
            $content = null;

            try {
                $content = $dispatcher->render($route->getMatchedURITemplate(), $route->getVariables());
            } catch(\DomainException $e){
                $notFound = true;
            }

            if ($content === false) {
                // Returning false from an action, will trigger 404
                $notFound = true;
            }

        } else {
            $notFound = true;
        }

        // Handle now found now
        if ($notFound === true) {
            $default = $this->config['components']['router']['default'];

            if (is_string($default)) {
                $notation = new RouteNotation();
                $args = $notation->toArgs($default);

                // Extract controller and action from $args
                $controller = $args[0];
                $action = $args[1];
                
                // Finally call it
                $content = $dispatcher->call($controller, $action);

            } else if (is_callable($default)) {
                $content = call_user_func($default, $sl);
            } else {
                throw new LogicException(sprintf(
                    'Default route must be either callable or a string that represents default controller, not %s', gettype($default)
                ));
            }

            $response->setStatusCode(404);
        }

        $response->send($content);
    }
1334707
public function run()
    {
        session_start();
        self::$_app = $this;
        if (empty($this->_runtimePath)) {
            $this->_runtimePath = $this->_basePath . '/runtime';
        }
        $application = $this->getComponent('application');
        $application->runController();
    }
969345
protected function start(): void
	{
		// Get the session id from the cookie or generate a new one if it doesn't exist.

		$this->sessionId = $this->request->getCookies()->getSigned($this->options['name'], false);

		if($this->sessionId === false)
		{
			$this->sessionId = $this->generateId();
		}

		// Create a new / update the existing session cookie

		$this->setCookie();

		// Load the session data

		$this->loadData();

		// Create a session token if we don't have one

		if(empty($this->sessionData['mako.token']))
		{
			$this->sessionData['mako.token'] = $this->generateId();
		}

		$this->token = $this->sessionData['mako.token'];
	}
365843
protected function mapWebRoutes(): void
    {
        $file = $this->basePath.'routes/web.php';

        if (file_exists($file)) {
            $this->loadRoutesFrom(
                Route::middleware('web')
                ->group($file));
        }
    }