Define the "web" routes for the module.

These routes all receive session state, CSRF protection, etc.

@return void
767012
protected function mapWebRoutes()
    {
        Route::group([
            'middleware' => config($this->package.'.web_routes_middleware') ?: 'web',
            'namespace'  => $this->namespace,
            'prefix' => $this->prefix,
        ], function ($router) {
            require __DIR__.'/../Routes/web.php';
        });
    }
726480
public function route()
    {
        if (!empty($this->mod)) {
            if ($this->mod == $this->modApiName) {
                $this->cmd = $this->ctrl . '.' . $this->action;
            }
        }
        if ($this->cmd != '') {
            $cmdParams = explode('.', $this->cmd);
            if (count($cmdParams) > 2) {
                $this->mod = $cmdParams[0];
                $this->cmd = $cmdParams[1] . '.' . $cmdParams[2];
            }
            $this->routeApi();
        } else {
            $this->routeCtrl();
        }
    }
313534
protected function performInit()
    {
        /** @var RouteHelperInterface $routeHelper */
        $routeHelper = app(RouteHelperInterface::class);

        $this->routePrefix = $routeHelper->getRouteNameForModelClass($this->modelClass, true);

        $permissions = $this->actionData->permissions();

        if (empty($permissions)) {
            $this->isPermitted = true;
        } else {
            $this->isPermitted = cms_auth()->can($permissions);
        }
    }
583795
public function init()
    {
        $this->routes = $this->routes->getRouteCollections();

        $this->dispatcher = $this->createDispatcher();

        $this->currentURL = $this->request->getPathInfo();

        $this->dispatch();
    }
388429
protected function controlCsrf()
    {
        if ($this->isPosted()
            && !$this->isInternalRoute()
            && (!isset($this->current_route['token']) || !empty($this->current_route['token']))) {

            $token = $this->request->post('token', '', false, 'string');

            if (!gplcart_string_equals($token, $this->token)) {
                $this->response->outputError403();
            }
        }
    }
758991
private function setRoutes() : void
    {
        $this->routes = $this->routeProvider->getRoutes();
        $this->syRouteCollection = new RouteCollection();
        foreach ($this->routes as $route) {
            $syRoute = new SymfonyRoute(
                $route->getPath(),
                $route->getParamsDefaults(),
                $route->getParamsRequirements(),
                [],
                '',
                [],
                $route->getMethods()
            );
            $this->syRouteCollection->add($route->getName(), $syRoute);
        }
    }
1350141
public function route()
	{
		$content = $this->_controller->{$this->_actionMethod}();

		if ($this->_controller->isJson()) {
			Request::setHeader(Request::HEADER_JSON);
			echo json_encode($content);
		} else {
			echo $content;
		}
	}
1020740
protected function registerRoutes()
    {
        $this->app['router']->group([
            'namespace' => __NAMESPACE__ . '\Http\Controllers'
        ], function($router) {
            $router->get('votee/test', ['uses' => 'VoteeController@test', 'as' => 'votee.test']);
            $router->post('votee/up', ['uses' => 'VoteeController@up', 'as' => 'votee.up']);
            $router->post('votee/down', ['uses' => 'VoteeController@down', 'as' => 'votee.down']);
        });
    }
997178
private function handleStrict(): void
    {
        if (!ini_get('session.use_strict_mode') || headers_sent()) {
            return;
        }

        $cookieName = session_name();
        if (empty($_COOKIE[$cookieName])) {
            return;
        }

        $sessionId = $_COOKIE[$cookieName];

        $identifier = $this->cryptProvider->makeSessionIdentifier($sessionId);

        if ($this->storageDriver->sessionExists($identifier)) {
            return;
        }

        $newSessionId = session_create_id();
        session_id($newSessionId);
    }
1041893
protected function initRouter()
    {

        // Get all routes from local bootstrap
        $routes = $this->setRoutes();

        // Send all routes to Router
        foreach ($routes as $route) {
            if ($route[0] == 'any') {
                Router::any($route[1], $route[2]);
            } elseif ($route[0] == 'get') {
                Router::get($route[1], $route[2]);
            } elseif ($route[0] == 'post') {
                Router::post($route[1], $route[2]);
            } else {
                echo error::display('Route Error: bad declaration');
            }
        }

        // Set default controller and action for errors
        Router::error('\Core\Error@index');
        Router::dispatch();
    }
1007770
protected function initRoute(): void
    {
        foreach ($this->route as $route => &$pattern) {
            $pattern = $this->prepareRoutePattern($route);
        }
    }
707485
protected function setAfterSendRoute()
    {
        if ($this->routeAction && ($this->request->getActionName() !== $this->routeAction)) {
            $this->afterSendRouteUrl = array('action' => $this->routeAction);

            $keys  = $this->model->getKeys();
            if (count($keys) == 1) {
                $key = reset($keys);
                if (isset($this->formData[$key])) {
                    $this->afterSendRouteUrl[\MUtil_Model::REQUEST_ID] = $this->formData[$key];
                }
            } else {
                $i = 1;
                foreach ($keys as $key) {
                    if (isset($this->formData[$key])) {
                        $this->afterSendRouteUrl[\MUtil_Model::REQUEST_ID . $i] = $this->formData[$key];
                    }
                    $i++;
                }
            }

            $this->afterSendRouteUrl['controller'] = $this->request->getControllerName();

            $find['action'] = $this->afterSendRouteUrl['action'];
            $find['controller'] = $this->afterSendRouteUrl['controller'];

            if (null == $this->menu->find($find)) {
                $this->afterSendRouteUrl['action'] = 'index';
                $this->resetRoute = true;
            }
        }
    }
754110
public function loadRoutes()
	{
		if ($this->bound('router')) {
			/**
			 * Use Cached Routes if Available
			 */

			if ($this['config']->get('routes.cache') && $this['files']->exists($this['config']->get('routes.compiled'))) {
				$contents = $this['files']->get($this['config']->get('routes.compiled'));
				if (!empty($contents)) {
					//Get Cached Routes & Set Them
					$this['router']->setRoutes(unserialize(base64_decode($contents)));
				}
			} else {
				//Assign Router to Simple Variable for Include
				$route = $this['router'];
				$response = $this['response'];
				//Include Routes
				if($this['files']->exists($this->base_path . '/app/Http/routes.php')){

					require_once $this->base_path . '/app/Http/routes.php';
				}
			}
			/**
			 * Store Cached Routes
			 */
			if ($this['config']->get('routes.cache') && !$this['files']->exists($this['config']->get('routes.compiled'))) {
				try {
					//Set Routes Cache
					if (!$this['files']->exists($this['config']->get('routes.compiled'))) {
						$allRoutes = $this['router']->getRoutes();
						//If Routes then Serialize
						if (count($allRoutes) > 0) {
							foreach ($allRoutes as $routeObject) {
								$routeObject->prepareForSerialization();
							}
						}
						//Store Routes in Cache
						$this['files']->put($this['config']->get('routes.compiled'), base64_encode(serialize($allRoutes)));
					}
				} catch (\Exception $exception) {
					if (!empty($exception->getMessage())) {
						add_action('admin_notices', function () use ($exception) {
							?>
							<div class="error notice">
								<p>&#9888; <?php echo $exception->getMessage(); ?></p>
								<p><em><? echo 'Route caching cannot serialize closures'; ?>.</em></p>
							</div>
							<?php
						});
					}
				}
			}
		}
	}
1005056
public function cookiesAction() {
        $config       = Zend_Registry::get('config');
        $viewBasePath = $config->resources->view->basePath ?:
            APPLICATION_PATH . '/modules/default/views';

        $this->_helper->layout->setLayoutPath($viewBasePath . '/layouts/');
        $this->view->title = 'Cookies';
    }
1216569
public static function csrfCheck() {
        if ($_SERVER['REQUEST_METHOD'] == 'POST' || $_SERVER['REQUEST_METHOD'] == 'PUT' || $_SERVER['REQUEST_METHOD'] == 'DELETE') {
            $request = Request::all();

            if (!isset($request['token']) && !Request::getCSRFToken()) {
                throw new RouteException(ExceptionMessages::CSRF_TOKEN_NOT_FOUND);
            }

            if (isset($request['token'])) {
                $token = $request['token'];
            } elseif (Request::getCSRFToken()) {
                $token = Request::getCSRFToken();
            }

            if (!Csrf::checkToken($request['token'])) {
                throw new RouteException(ExceptionMessages::CSRF_TOKEN_NOT_MATCHED);
            }
        }
    }
706227
public static function route() :void {

		// marker
		Profiler::setMarker('Router.route', 'framework');
		// get the requested url
		$request_url = Request::getUrl();
		// get the requested method
		$request_method = Request::getMethod();
		// Loop over each route and test to see if they are valid
		foreach(self::$_routes as $route) {
			// if the route matches
			if(self::routeMatch($request_url, $request_method, $route)) {
				// get it
				$matching_route = $route;
				// stop trying
				break;
			}
		}
		// marker
		Profiler::releaseMarker('Router.route');
		// if no match is found and we don't have an error route to fallback on
		if(!isset($matching_route)) {
			// throw a native exception since there is no cleaner alternative
			Throw new Exception('Router::route() no matching route', 404);
		}
		// send the matching route to the dispatcher
		self::forward($matching_route);	
		
	}
499630
protected function registerDefaultRoutes()
    {
        $this->registerRoutes(function (Router $router) {
            (new ModelRouter($this->app, $router))->register($this->app['sleeping_owl']->getModels());

            if (file_exists($routesFile = __DIR__.'/../Http/routes.php')) {
                require $routesFile;
            }

            AliasBinder::registerRoutes($router);
        });
    }