Automatically generated run method

@param Request $request
@return Response
425602
public function run(Request $request) {
		$token = $this->getParam('token');
		$auth = $this->getServiceContainer()->getAuthManager();
		$translator = $this->getServiceContainer()->getTranslator();

		$page = $this->getServiceContainer()->getKernel()->getApplication()->getPage();
		$page->setTitle($translator->trans('forgot_password'));

		if ($request->isMethod('POST')) {
			// reset password
			if (!empty($token)) {
				$post = $request->request;
				$user = $auth->getUser();

				$pwA = $post->get('new_password');
				$pwB = $post->get('new_password_confirm');

				if ($pwA == $pwB) {
					$user->setPassword($auth->encryptPassword($pwA));
					$user->setPasswordRecoverToken(null);
					$user->setPasswordRecoverTime(null);
					$user->save();
					$payload = new Updated();
				} else {
					$payload = new Found([
						'token' => $token,
						'destination' => $this->getTargetLocation($token),
						'error' => $translator->trans('change_password_nomatch')
					]);
				}

			}

			// generate token when user is identified
			else {
				$login = $request->request->get('login');
				$user = $auth->findUser($login);

				if ($user === null) {
					$message = $translator->trans('error.user_not_found', [], 'keeko.account');
					$payload = new Blank([
						'error' => $message,
						'login' => $login
					]);
				} else {
					$token = AuthManager::generateToken();
					$user->setPasswordRecoverToken($token);
					$user->setPasswordRecoverTime(new DateTime());
					$user->save();

					// send mail
					$prefs = $this->getServiceContainer()->getPreferenceLoader()->getSystemPreferences();
					$localeService = $this->getServiceContainer()->getLocaleService();
					$file = $localeService->findLocaleFile('/keeko/account/locales/{locale}/mail/forgot-password.twig');
					$body = $this->render($file, [
						'user' => $user->getDisplayName(),
						'plattform' => $prefs->getPlattformName(),
						'link' => $this->getTargetLocation($token)
					]);

					$mailer = $this->getServiceContainer()->getMailer();
					$message = $this->getServiceContainer()->createMessage();
					$message->setTo($user->getEmail());
					$message->setSubject($translator->trans('forgot_password.subject'));
					$message->setBody($body);
					$mailer->send($message);

					$payload = new Created(['mail' => $user->getEmail()]);
				}
			}
		}

		// recover pw formular with token
		else if (!empty($token)) {
			$user = UserQuery::create()->findOneByPasswordRecoverToken($token);
			if ($user !== null) {
				$now = new DateTime();
				$time = $user->getPasswordRecoverTime();
				$diff = $now->diff($time);

				if ($diff->h >= 1) {
					$payload = new Failed(['error' => $translator->trans('error.token_timeout')]);
				} else {
					$payload = new Found([
						'token' => $token,
						'destination' => $this->getTargetLocation($token)
					]);
				}
			} else {
				$payload = new Failed(['error' => $translator->trans('error.token_invalid')]);
			}
		}

		// anyway, identify user
		else {
			$payload = new Blank();
		}

		return $this->responder->run($request, $payload);
	}
497403
public function run(Request $request)
    {
        if (! $this->getSnapshot() instanceof Container) {
            throw new SandboxException('Sandbox is not enabled.');
        }

        $shouldUseOb = $this->config->get('swoole_http.ob_output', true);

        if ($shouldUseOb) {
            return $this->prepareObResponse($request);
        }

        return $this->prepareResponse($request);
    }
1221633
public function run($action, $request=null) {
		$this->action = $action;
		$this->defaultView = $action;

		if($request === null)
			$request = new Request;
		$this->request = $request;
		$this->response = new Response;
		$this->response->setRequest($this->request);

		#before filters
		$result = null;
		foreach($this->beforeFilters as $filter) {
			if(($result = $filter($this, $request)) !== null)
				break;
		}

		if($result === null) {
			if(($result = $this->before($request)) === null)
				$result = $this->doRun($action, [$request]);
		}

		$this->after($request, $result);

		#after filters
		foreach($this->afterFilters as $filter)
			$filter($this, $request, $result);

		if($result instanceof Response)
			return $result;
		elseif(is_string($result))
			return $this->response->setContent($result);

		return $this->response;
	}
1174521
public function run(Closure $next = null, Request $request = null)
    {
        if (!$next) {
            return;
        }

        $this->generate();
        abort_unless($this->validate($request), 403, 'Token Validation Failed');
        return $next($request);
    }
64193
public function run() {

        foreach ( $this->requests as $request ) {

            if ( isset($request['ERROR_CODE']) && isset($request['ERROR_MESSAGE']) ) {

                $this->logger->warning("Invalid request ".$request['ID']);

                $result = self::packJsonError($request['ERROR_CODE'], $request['ERROR_MESSAGE'], $request['ID']);

                if ( !is_null($result) ) $this->results[] = $result;

            } else {

                try {

                    $this->logger->debug("Serving request ".$request['METHOD']."(".$request['ID'].")");

                    $response = $this->runSingleRequest($request['METHOD'], $request['PARAMETERS']);

                    $result = self::packJsonSuccess($response, $request['ID']);

                } catch (RpcException $re) {

                    $this->logger->warning("Error handling request ".$request['ID'].": ".$re->getMessage());

                    $result = self::packJsonError($re->getCode(), $re->getMessage(), $request['ID']);

                } catch (Exception $e) {

                    $this->logger->error($e->getMessage());

                    throw $e;

                }

                if ( !is_null($result) ) $this->results[] = $result;

            }


        }

        if ( empty($this->results) ) {

            return null;

        } else if ( $this->is_batch_request ) {

            return $this->results;

        } else {

            return $this->results[0];

        }

    }
530173
public function run(Request $request, Response $response)
    {
        $this["logger.service"]("System")->info("Beginning process for request.", [$request]);

        $this->setRequestProperties($request);

        $result = $this["hooks.service"]->exec(
            "application.dispatch.before",
            $request,
            $response,
            $this
        );
        if ($result === "exit"
            || (is_array($result) && in_array("exit", $result))) {
            return;
        }

        // record the time before execution
        $start = microtime(true);

        // dispatch request
        try {
            $this["routeDispatcher.service"]->dispatch($request, $response, $this);
        } catch (RouteNotFoundException $routeNotFound) {
            $this["logger.service"]("System")->error("No Route found for Request");
            $this["logger.service"]("System")->debug(
                "No Route Found Debug Information",
                ["exception" => $routeNotFound]
            );

            $response->setStatusCode(404);
            $response->setContent($this->load404Page());
            throw $routeNotFound;
        }

        $this["logger.service"]("System")->info(
            "Request has finished processing, Response is ready to be sent to "
            . "caller."
        );

        $this["hooks.service"]->exec("application.dispatch.after");

        // record the time after execution
        $end = microtime(true);
        $this["logger.service"]("System")->debug(
            "Time taken to finish Request processing",
            [
                "start"     =>  $start,
                "end"       =>  $end,
                "elapsed"   =>  $end - $start,
                "uri"       =>  $request->getRequestUri()
            ]
        );
    }
879455
public function run(Request $request)
    {
        $this->container = $this->container ?: Application::getInstance();
        $this->container->set(Request::class, $request);

        // Check and run controller
        if ($this->isControllerAction()) {
            return $this->runController();
        }

        return $this->runCallable();
    }
135814
public function runBeforeSendingCallbacks(Request $request): Request
    {
        return tap($request, function ($request) {
            $this->beforeSendingCallbacks->each->__invoke(new HttpRequest($request));
        });
    }
1304144
public function run($request) {
		$units = array ('seconds', 'hours', 'minutes', 'days', 'weeks', 'months', 'years');
		$unit = $request->requestVar('unit');
		if(!$unit || !in_array($unit, $units)) {
			throw new RuntimeException("Please specify a 'unit' parameter. Possible values: ".implode(', ', $units));
		}

		$count = $request->requestVar('count');
		if(!$count) {
			throw new RuntimeException("Please specify a 'count' parameter for the number of $unit you want to to keep.");
		}

		$stamp = strtotime("-{$count} $unit");
		$date = date('Y-m-d H:i:s');

		$count = SentEmail::get()->filter(array(
			'Created:LessThan' => $date
		))->count();
		
		DB::query("DELETE FROM \"SentEmail\" WHERE Created < '$date'");

		echo "Deleted $count records.";
	}
431439
public function handle(Request $request)
	{
		if (!$this->app->runningInConsole())
		{
			$this->app['dispatcher']->trigger('system.onBeforeRoute');

			foreach ($this->app['router']->parse($request->getUri()) as $key => $val)
			{
				$request->setVar($key, $val, 'get');
			}

			$this->app['dispatcher']->trigger('system.onAfterRoute');

			if ($this->app->has('profiler'))
			{
				$this->app['profiler'] ? $this->app['profiler']->mark('afterRoute') : null;
			}
		}

		return $this->next($request);
	}
495178
public function execAction(Request $request)
    {
        ignore_user_abort(true);
        set_time_limit(0);

        $this->get('anime_db.command')->execute($request->get('command'), 0);

        return new Response();
    }
1059812
public function run(Request $request)
	{
		$this->container = $this->container ?: new Container;

		try
		{
			if ( ! is_string($this->action['uses']))
			{
				return $this->runCallable($request);
			}

			if ($this->customDispatcherIsBound())
			{
				return $this->runWithCustomDispatcher($request);
			}

			return $this->runController($request);
		}
		catch (HttpResponseException $e)
		{
			return $e->getResponse();
		}
	}
1374399
protected function run(Request $request)
    {
        $payload = new Payload;

        if ($request->get('acme') === 1) {
            $payload = $payload->withMessage('Acme Interceptor is work');
        }

        return $payload;
    }
1154811
public function run(Request $request) {
		$page = $this->getServiceContainer()->getKernel()->getApplication()->getPage();
		$page->setTitle($this->getServiceContainer()->getTranslator()->trans('dashboard'));
		$user = $this->getServiceContainer()->getAuthManager()->getUser();
		$activities = ActivityQuery::create()->filterByActor($user)->limit(5)->orderById(Criteria::DESC)->find();
		$reg = $this->getServiceContainer()->getExtensionRegistry();
		return $this->responder->run($request, new Blank([
			'settings' => $reg->getExtensions(AccountModule::EXT_SETTINGS),
			'activities' => $activities
		]));
	}
476138
public function runUpdate(Request $request)
    {
        $user = User::find(Auth::id());
        $this->validate($request, [
            'old' => 'required',
            'password' => 'required|min:8|confirmed',
        ]);
        if (Auth::attempt(['name' => $user->name, 'password' => $request->old])) {
            $user->fill([ 'password' => bcrypt($request->password) ])->save();
            $request->session()->flash('success', 'Your password has been changed.');
            return redirect('/my-profile');
        }
        $request->session()->flash('failure', 'Your password has not been changed.');
        return redirect('/my-profile');
    }
42861
public final function generateResponseForRequest(Request $request)
    {
        $this->setAsRunningApplication();
        $this->request = $request;
        $this->activeRequest = $request;

        $additionalData = [];
        if ($request instanceof WebRequest) {
            if (!empty($request->GetData)) {
                $additionalData = $request->GetData;
            }
        }

        Log::createEntry(Log::PERFORMANCE_LEVEL | Log::DEBUG_LEVEL, function () use ($request) {
            if ($request instanceof WebRequest) {
                return "Generating response for url " . $request->urlPath;
            }

            if ($request instanceof CliRequest) {
                return "Starting CLI response";
            }

            return "";
        }, "ROUTER", $additionalData);

        Log::indent();

        // an empty-string Response to fall back on if nothing else is generated
        $response = new HtmlResponse();
        $response->setContent('');

        try {

            // Run pre-response filters.
            $preFilters = $this->getAllResponseFilters(true);

            foreach($preFilters as $filter){
                $response = $filter->processResponse($response);
            }

            $filterResponse = true;

            // Iterate over each handler and ask them to generate a response.
            // If they do return a response we return that and exit the loop.
            // If they return false then we assume they couldn't handle the URL
            // and continue to the next handler.
            foreach ($this->rootHandlers as $handler) {
                $generatedResponse = $handler->generateResponse($request);

                if ($generatedResponse !== false) {
                    Log::debug(function () use ($handler) {
                        return ["Handler `" . get_class($handler) . "` generated response.", []];
                    }, "ROUTER");

                    // it should be preferred for a handler to return a Response object,
                    // but checking this here retains the option for them to just return
                    // their output
                    if ($generatedResponse instanceof Response) {
                        $response = $generatedResponse;
                    } else {
                        $response->setContent($generatedResponse);
                    }

                    break;
                }
            }
        } catch (ForceResponseException $er) {
            // Clear any previous output in buffers to ensure we only send the forced response
            while (ob_get_level()) {
                ob_end_clean();
            }

            $response = $er->getResponse();
            $filterResponse = false;
        } catch (StopGeneratingResponseException $er) {
            $filterResponse = false;
        } catch (RhubarbException $er) {
            $handler = $this->container()->getInstance(ExceptionHandler::class);
            $response = $handler->processException($er);
        } catch (\Exception $er) {
            $handler = $this->container()->getInstance(ExceptionHandler::class);
            $response = $handler->processException(new NonRhubarbException($er));
        }

        if ($filterResponse) {
            Log::createEntry(Log::PERFORMANCE_LEVEL | Log::DEBUG_LEVEL, "Output filters started", "ROUTER");
            Log::indent();

            $filters = $this->getAllResponseFilters();

            foreach ($filters as $filter) {
                $response = $filter->processResponse($response);
            }

            Log::createEntry(Log::PERFORMANCE_LEVEL | Log::DEBUG_LEVEL, "Output filters finished", "ROUTER");
            Log::outdent();
        }

        Log::performance("Response generated", "ROUTER");
        Log::outdent();

        return $response;
    }
1109997
private static function _run($request)
    {
        // Whether or not we have matched the URL to a route
        $matched_route = false;

        $request = '/' . $request;

        //make sure the request has a trailing slash
        $request = rtrim($request, '/') . '/';

        $request = str_replace("//","/",$request);

        // Sort the array by priority
        ksort(self::$_routes);


        // Loop through each priority level
        foreach (self::$_routes as $priority => $routes) {
            // Loop through each route for this priority level
            foreach ($routes as $source => $destination) {

                // Does the routing rule match the current URL?
                if (preg_match($source, $request, $matches)) {
                    // A routing rule was matched
                    $matched_route = TRUE;
                    $attr = implode('/',array_intersect_key($matches, array_flip(array_filter(array_keys($matches), 'is_string'))));
                    self::$_attr = explode('/', trim($attr, '/'));
                    self::_set_callback($destination);
                }



            }
        }

        if(!$matched_route)
        {
            if($request != '/')
            {
                self::_set_callback($request);
            }
        }

    }