Automatically generated run method

@param Request $request
@return Response
320
public function run(Request $request) {
		$id = $this->getParam('id');
		$sport = SportQuery::create()
			->leftJoinGroup()
			->leftJoinSkill()
			->findOneById($id);

		$pictures = PictureQuery::create()
			->useSkillQuery()
				->filterBySportId($id)
			->endUse()
			->count();

		$videos = VideoQuery::create()
			->useSkillQuery()
				->filterBySportId($id)
			->endUse()
			->count();

		$references = ReferenceQuery::create()
			->useSkillReferenceQuery()
				->useSkillQuery()
					->filterBySportId($id)
				->endUse()
			->endUse()
			->count();

		$statistics = [
			'skills' => $sport->countSkills(),
			'groups' => $sport->countGroups(),
			'pictures' => $pictures,
			'videos' => $videos,
			'references' => $references
		];

		return $this->responder->run($request, new Blank($statistics));
	}
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();
    }
1115690
public function run($request)
    {
        /** @var \SilverStripe\ORM\DataObjectSchema $schema */
        $schema = DataObject::getSchema();

        foreach ($this->tables as $db) {
            $columns = $schema->databaseFields($db);
            $query = "SHOW COLUMNS FROM $db";
            $liveColumns = DB::query($query)->column();
            $backedUp = 0;
            $query = "SHOW TABLES LIKE 'Backup_$db'";
            $tableExists = DB::query($query)->value();
            if ($tableExists != null) {
                echo "Tasks run already on $db exiting";
                return;
            }
            $backedUp = 0;
            foreach ($liveColumns as $index => $column) {
                if ($backedUp == 0) {
                    echo "Backing up $db <br />";
                    echo "Creating Backup_$db <br />";
                    // backup table
                    $query = "CREATE TABLE Backup_$db LIKE $db";
                    DB::query($query);
                    echo "Populating Backup_$db <br />";
                    $query = "INSERT Backup_$db SELECT * FROM $db";
                    DB::query($query);
                    $backedUp = 1;
                }
                if (!isset($columns[$column]) && !in_array($column, $this->keepColumns)) {
                    echo "Dropping $column from $db <br />";
                    $query = "ALTER TABLE $db DROP COLUMN $column";
                    DB::query($query);
                }
            }
        }
    }
763116
public function run(Request $request) {
		$prefs = $this->getServiceContainer()->getPreferenceLoader()->getSystemPreferences();
		$auth = $this->getServiceContainer()->getAuthManager();
		$auth->logout();
		return new RedirectResponse($prefs->getAccountUrl());
	}
974870
public function run(Request $request)
    {
        $this->container = $this->container ?: new Container;
        
        try {
            if (! is_string($this->action['uses'])) {
                return $this->runCallable($request);
            }
            
            list($class, $method) = explode('@', $this->action['uses']);
            $cl = new ClassLoader;
            $cl->addPsr4($this->getAppNamespace(), app('path'));
            $file = $cl->findFile($class);
            $cmd = 'php -l ' . $file;
            
            if (strpos(exec($cmd, $output), 'No syntax errors detected') === false) {
                $route = array_get($this->action, 'as', $this->action['uses']);
                $error = head(array_filter($output));
                
                throw new SyntaxErrorException($route, $error);
            }
            
            set_error_handler([$this, 'error']);
            
            if ($this->customDispatcherIsBound()) {
                return $this->runWithCustomDispatcher($request);
            }
            
            return $this->runController($request);
        } catch (HttpResponseException $e) {
            return $e->getResponse();
        }
    }
174505
protected function runRoute(Request $request, Route $route)
    {
        $request->setRouteResolver(function () use ($route) {
            return $route;
        });

        $this->events->dispatch(new Events\RouteMatched($route, $request));

        return $this->prepareResponse($request,
            $this->runRouteWithinStack($route, $request)
        );
    }
1331174
public function run(Request $request) {
		$page = $this->getServiceContainer()->getKernel()->getApplication()->getPage();
		$page->setTitle($this->getServiceContainer()->getTranslator()->trans('change_password'));

		$payload = new Blank();
		if ($request->isMethod('POST')) {
			$post = $request->request;
			$auth = $this->getServiceContainer()->getAuthManager();
			$user = $auth->getUser();
			$payload = new Failed();

			if ($post->has('password') && $auth->verifyUser($user, $post->get('password'))) {
				$pwA = $post->get('new_password');
				$pwB = $post->get('new_password_confirm');

				if ($pwA == $pwB) {
					$user->setPassword($auth->encryptPassword($pwA));
					$user->save();
					$payload = new Success();
				}
			}
		}

		return $this->responder->run($request, $payload);
	}
687762
public function run($request = null)
    {
        $response = $this->dispatch($request);

        if ($response instanceof SymfonyResponse) {
            $response->send();
        } else {
            echo (string) $response;
        }

        if (count($this->middleware) > 0) {
            $this->callTerminableMiddleware($response);
        }
    }
88475
public function run(HttpRequest $request = null): Response
    {
        if ($request === null) {
            $request = HttpRequest::fromGlobals();
        }

        $this->httpRequest = $request;

        $context = new Context($request->getUri()->getPath(), $request);

        $response = $this->getHttpRouter()->route($context);

        if (!$response instanceof HttpResponse) {
            $response = new HttpResponse($response);
        }

        $this->flushResponse($request, $response);

        $this->httpRequest = null;

        return $response;
    }
867838
public function run()
    {
        $this->requestId = uniqid();
        $this->startTime = microtime();

        try {
            // Generate a Request object from the data available in the
            // current running environment.
            try {
            $requestFactory = new Requests\Factories\Http;
            $request = $requestFactory->get($this);
                // Set the application locale from the request.
                // TODO: Move into the Request constructor?
                $this->setLocale($request->getLocale());
                // Run the process of responding to the request.
                $this->issueResponse($request);
            } catch (\Throwable $throwable) {
                // There was an error somewhere during the request
                // creation, or somewhere during the response building
                // process.
                $errorRequest = new Requests\Http\Error;
                $errorRequest->setThrowable($throwable);
                $this->issueResponse($errorRequest, $throwable);
            }
        } catch (\Exception $exception) {
            // There was an error while trying to fail gracefully.
            // Little else can be done now.
            $this->fail($exception);
        }

        Logger::get()->info($this->getStats());

        // Since the application is being run in an HTTP context, and
        // PHP is the scripting language it is, the application cycle
        // just finishes after the response is done with its tasks.
    }
986719
public function run(Request $request) {
		$page = $this->getServiceContainer()->getKernel()->getApplication()->getPage();
		$page->setTitle($this->getServiceContainer()->getTranslator()->trans('sessions'));

		if ($request->isMethod('POST')) {
			$post = $request->request;
			if ($post->has('token')) {
				SessionQuery::create()->findOneByToken($post->get('token'))->delete();
				$service = $this->getServiceContainer();
				$accountUrl = $service->getPreferenceLoader()->getSystemPreferences()->getAccountUrl();
				$translator = $service->getTranslator();
				$url = sprintf('%s%s/%s',
					$accountUrl,
					$translator->trans('slug.settings'),
					$translator->trans('slug.settings.sessions')
				);
				return new RedirectResponse($url);
			}
		}

		return $this->responder->run($request);
	}
679064
public function run(array $request)
    {
        $report = new Report;
        foreach ($request as $key => $value) {
            $report = $this->iterate($key, $value, $report);
        }
        return $report;
    }
1319213
public function run(&$query, $model, $request)
    {
        $this->query = $query;
        $this->getAttributes($model);
        $this->parseRequest($request);

        return $this->query();
    }
761921
public function run(&$request)
    {
        $this->detect($request);
        $request = $this->driver->formatIncomingRequest($request);
    }
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()
            ]
        );
    }
703406
protected function run(Request $request)
	{
		// If there's nothing to dispatch, continue along the middleware pipeline
		$handler = $request->getAttribute('dispatch.handler', false);
		if ($handler === false) {
			return $this->chain($request);
		}

		// Setup any remaining chained parts of the dispatch for future dispatch
		$request = $request->withAttribute('dispatch.handler', $this->resolver->shift($handler));

		// Resolve the handler into something callable
		$dispatchable = $this->resolver->resolve($handler, $resolutionType);

		// Dispatch
		$parameters = [
			$dispatchable,
			$resolutionType,
			DispatchAdaptorInterface::SOURCE_DISPATCH_MIDDLEWARE,
			$request
		];
		$response = $this->getResponseObject();
		if ($response !== null) {
			$parameters[] = $response;
		}
		return $this->dispatcher->dispatch(...$parameters) ?: $this->chain($request);
	}
652358
public function run(Request $request) {
		$login = '';
		$error = '';
		$redirect = $request->headers->get('referer');
		$prefs = $this->getServiceContainer()->getPreferenceLoader()->getSystemPreferences();

		// try login
		if ($request->isMethod('POST')) {
			$login = $request->request->get('login');
			$password = $request->request->get('password');
			$redirect = rawurldecode($request->request->get('redirect'));

			$auth = $this->getServiceContainer()->getAuthManager();
			if ($auth->login($login, $password)) {
				$token = $auth->getSession()->getToken();
				$foward = $redirect ?: $prefs->getAccountUrl();
				$response = new RedirectResponse($foward);
				$this->getServiceContainer()->getKernel()->setCookie($response, AuthManager::COOKIE_TOKEN_NAME, $token);
				return $response;
			}

			$error = 'Invalid credentials';
		}

		$translator = $this->getServiceContainer()->getTranslator();
		$module = $this->getModule();
		$form = $module->getWidgetFactory()->createLoginWidget();
		$form = $form->build([
			'error' => $error,
			'destination' => $prefs->getAccountUrl() . '/' . $translator->trans('slug.login'),
			'redirect' => $redirect,
			'login' => $login
		]);

		return $this->responder->run($request, new Blank([
			'form' => $form
		]));
	}