Run This Middleware Before The Route Executes.
499668
def before(self):
        """"""
        user = self.request.user()

        if user and user.verified_at is None:
            self.request.redirect('/email/verify')
1211265
def pre_run(self, outline=False, *args, **kwargs):
        """"""
        pre_destroy = self.context.config.pre_destroy
        if not outline and pre_destroy:
            handle_hooks(
                stage="pre_destroy",
                hooks=pre_destroy,
                provider=self.provider,
                context=self.context)
1250528
public function run()
    {
        $resolvedRequest = $this->router->route($this->request);
        echo $this->dispatcher->dispatch($resolvedRequest);
    }
215987
protected function preRun()
    {
        parent::preRun();

        $options = $this->getOptions();

        $this->mcStatus
            ->setHostname($options['host'])
            ->setPort($options['port']);

        return $this;
    }
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();
        }
    }
471221
def run(self):
        """"""
        resp = _wait_until(obj=self.obj, att=self.att,
                desired=self.desired, callback=None,
                interval=self.interval, attempts=self.attempts,
                verbose=False, verbose_atts=None)
        self.callback(resp)
394838
def pre_run(self, outline=False, dump=False, *args, **kwargs):
        """"""
        if should_ensure_cfn_bucket(outline, dump):
            self.ensure_cfn_bucket()
        hooks = self.context.config.pre_build
        handle_hooks(
            "pre_build",
            hooks,
            self.provider,
            self.context,
            dump,
            outline
        )
149482
public function runBefore()
    {
        $this->themeName       = Config::getInstance()->get('Eureka\Global\Theme\php\theme');
        $this->themeLayoutPath = Config::getInstance()->get('Eureka\Global\Theme\php\layout');
    }
775791
public function runApplication()
    {
        $routeCollection = $this->createRouteCollection();
        $dispatcher = $routeCollection->getDispatcher();

        $request = $this->createRequest();
        $response = $dispatcher->dispatch($request->getMethod(), $request->getPathInfo());
        $response->send();
    }
441420
public function runBefore(Request $request, Response $response)
    {
        foreach ($this->middlewares as $middleware) {
            if (class_exists($middleware)) {
                $instance = new $middleware($request, $response);
                if ($instance instanceof MiddlewareAbstract) {
                    /* @var $instance MiddlewareAbstract */
                    $instance->onBefore();
                    $this->running[] = $instance;
                }
            }
        }
    }
1121379
public function run()
    {
        if (!(bool)$this->ready) {
            $this->init();
        }

        $this->configureCustomPostType();
        $this->addAppRoutes();
        $this->improveSecurity();

        $this->displayRuntimeHeader();
        $this->loadMiddleware();
    }
841340
public function preRun()
    {
        
        $this->options = array('verbose' => false,
        					   'user' => null,
        					   'password' => null,
        					   'model' => null,
        					   'input' => null);
        
        $this->options = array_merge($this->options, $this->parameters);
        
        // the 'file' param is checked by the parent implementation.
        
        if ($this->options['user'] == null){
        	$this->err("Please provide a TAO 'user'.", true);
        }
        else if ($this->options['password'] == null){
        	$this->err("Please provide a TAO 'password'.", true);
        }
        else if ($this->options['input'] == null){
        	$this->err("Please provide a RDF 'input' file.", true);
        }

        
    }
956293
public function runRouteMiddleware($middleware, $type)
    {
        $middlewarePath = $this->baseFolder . '/' . $this->paths['middlewares'];
        $middlewareNs = $this->namespaces['middlewares'];
        if ($type == 'before') {
            if (! is_null($middleware['group'])) {
                $this->routerCommand()->beforeAfter(
                    $middleware['group'][$type], $middlewarePath, $middlewareNs
                );
            }
            $this->routerCommand()->beforeAfter(
                $middleware[$type], $middlewarePath, $middlewareNs
            );
        } else {
            $this->routerCommand()->beforeAfter(
                $middleware[$type], $middlewarePath, $middlewareNs
            );
            if (! is_null($middleware['group'])) {
                $this->routerCommand()->beforeAfter(
                    $middleware['group'][$type], $middlewarePath, $middlewareNs
                );
            }
        }
    }
1225595
function startAtRoute( routeName, optionalContext = {} ) {
      return flowController.loadFlow( 'mainz' )
         .then( routerMock.awaitRegisterRoutes )
         .then( () => routerMock.triggerRouteHandler( routeName, optionalContext ) )
         .then( awaitDidNavigate );
   }
1007770
protected function initRoute(): void
    {
        foreach ($this->route as $route => &$pattern) {
            $pattern = $this->prepareRoutePattern($route);
        }
    }
278788
public function _beforeInit()
    {
        $this->pm = $this->add($this->pagemanager_class, $this->pagemanager_options);
        /** @type Controller_PageManager $this->pm */
        $this->pm->parseRequestedURL();
        parent::_beforeInit();
    }
1279902
public function run_befores($scope) {
    if ($this->_parent) {
      $this->_parent->run_befores($scope);
    }
    
    foreach ($this->_befores as $before) {
      $before($scope);
    }
  }