@param Request $request
@param string  $alias

@return Response
164639
public function resetAction(Request $request, string $alias): Response
    {
        $this->permissionAccess('uicron', 'reset');

        $cron = $this->cronService->getCron($alias);
        if (!$cron) {
            return $this->redirect('ezplatform.dashboard');
        }

        $this->cronService->removeQueud($alias);

        $this->notificationHandler->info(
            $this->translator->trans(
                'edgar.ezuicron.reset.info',
                [],
                'edgarezuicron'
            )
        );

        return $this->redirect('ezplatform.dashboard');
    }
216026
function indexAction($request)
    {

        $response = new FrontendResponse('journal/journalList.twig', $request);

        $journalRepository = new Repository(new Journal(),$this->database);

        $journals = $journalRepository->findAll();

        $journals = array_reverse($journals);

        $response->setTwigVariables(
            [
                'journals' => $journals
            ]
        );

        return $response;


        // $insertJournal = new \Model\Entity\Journal(NULL,'title','content');
        // $journalRepository->update($insertJournal);


        // $journal = $journalRepository->findById(1);
        // $journalRepository->remove($journal);

        // $filter = new Filter($this->database);
        // $filter->addCondition(new Condition('content','<>','content'));
        // $journals = $journalRepository->findByFilter($filter);

    }
978359
public function proxyAction(Request $request)
    {
        $api = $this->decideApiAndEndpoint($request->getUri());
        $this->registerProxySources($api['apiName']);
        $this->apiLoader->addOptions($api);

        $url = new Uri($this->apiLoader->getEndpoint($api['endpoint'], true));

        if ($url->getScheme() === null) {
            $url = $url->withScheme($request->getScheme());
        }

        $response = null;
        try {
            $newRequest = Request::create(
                (string) $url,
                $request->getMethod(),
                [],
                [],
                [],
                [],
                $request->getContent(false)
            );
            $newRequest->headers->add($request->headers->all());
            $newRequest->query->add($request->query->all());

            $newRequest = $this->transformationHandler->transformRequest(
                $api['apiName'],
                $api['endpoint'],
                $request,
                $newRequest
            );

            $psrRequest = $this->psrHttpFactory->createRequest($newRequest);

            $psrRequestUri = $psrRequest->getUri();
            $psrRequestUriPort = $url->getPort();
            if (is_numeric($psrRequestUriPort) || is_null($psrRequestUriPort)) {
                $psrRequestUri = $psrRequestUri->withPort($psrRequestUriPort);
            }

            $psrRequest = $psrRequest->withUri($psrRequestUri);

            $psrResponse = $this->proxy->forward($psrRequest)->to($this->getHostWithScheme($url));
            $response = $this->httpFoundationFactory->createResponse($psrResponse);
            $this->cleanResponseHeaders($response->headers);
            $this->transformationHandler->transformResponse(
                $api['apiName'],
                $api['endpoint'],
                $response,
                clone $response
            );
        } catch (ClientException $e) {
            $response = (new HttpFoundationFactory())->createResponse($e->getResponse());
        } catch (ServerException $serverException) {
            $response = (new HttpFoundationFactory())->createResponse($serverException->getResponse());
        } catch (TransformationException $e) {
            $message = json_encode(
                ['code' => 404, 'message' => 'HTTP 404 Not found']
            );

            throw new NotFoundHttpException($message, $e);
        } catch (RequestException $e) {
            $message = json_encode(
                ['code' => 404, 'message' => 'HTTP 404 Not found']
            );

            throw new NotFoundHttpException($message, $e);
        }

        return $response;
    }
123997
public function handle(Request $request): Response
    {
        try {
            $matcher = $this->getUrlMatcher($request);

            $parameters = $matcher->match($request->getPathInfo());

            if (empty($parameters['_controller'])) {
                throw new InvalidRouteException('Route requires a _controller callable');
            }

            if (!\is_callable($parameters['_controller'])) {
                throw new InvalidRouteException('_controller must be a callable');
            }

            $callback = $parameters['_controller'];

            $result = call_user_func_array($callback, $this->getControllerParameters($request, $parameters));

            if (!$result instanceof Response) {
                throw new InvalidResponseException('Response must be an instance of \Symfony\Component\HttpFoundation\Response');
            }
        } catch (\Exception $e) {
            $result = $this->handleException($request, $e);
        }

        return $result;
    }
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();
    }
1341171
public function resolve(Request $request) : Response {
        if($request->expectsJson()) {
            return $this->json();
        }

        return $this->redirect();
    }
1081395
public function setRequest(Request $request)
    {
        $this->request = $request;

        $this->cachedRoot = null;
        $this->cachedScheme = null;
        $this->routeGenerator = null;
    }
510980
protected function exportFormStep(Request $request, $alias)
    {
        $exportManager = $this->get('chill.main.export_manager');
        
        // check we have data from the previous step (export step)
        $data = $this->get('session')->get('centers_step', null);
        
        if ($data === null) {
            
            return $this->redirectToRoute('chill_main_export_new', array(
               'step' => $this->getNextStep('export', true),
               'alias' => $alias
               ));
        }
        
        $export = $exportManager->getExport($alias);
                
        $form = $this->createCreateFormExport($alias, 'export', $data);
        
        if ($request->getMethod() === 'POST') {
            $form->handleRequest($request);
            if ($form->isValid()) {
                
                $this->get('logger')->debug('form export is valid', array(
                      'location' => __METHOD__));
                
                // store data for reusing in next steps
                $data = $form->getData();
                $this->get('session')->set('export_step_raw', 
                      $request->request->all());
                $this->get('session')->set('export_step', $data);
                
                //redirect to next step
                return $this->redirect(
                      $this->generateUrl('chill_main_export_new', array(
                         'step' => $this->getNextStep('export'),
                         'alias' => $alias
                      )));
            } else {
                $this->get('logger')->debug('form export is invalid', array(
                      'location' => __METHOD__));
            }
        }
        
        return $this->render('ChillMainBundle:Export:new.html.twig', array(
            'form' => $form->createView(),
            'export_alias' => $alias,
            'export' => $export
        ));
    }
178912
public function composeAction(Request $request)
    {
        $admin = $this->getAdmin();

        $admin->checkAccess('compose');
        if (false === $this->get('sonata.dashboard.admin.block')->isGranted('LIST')) {
            throw $this->createAccessDeniedException();
        }

        $id = $request->get($admin->getIdParameter());
        $dashboard = $admin->getObject($id);
        if (!$dashboard) {
            throw $this->createNotFoundException(sprintf('unable to find the dashboard with id : %s', $id));
        }

        $containers = [];

        // separate containers.
        /** @var array $blocks */
        $blocks = $dashboard->getBlocks();

        foreach ($blocks as $block) {
            /** @var Block $block */
            $blockCode = $block->getSetting('code');
            if (null === $block->getParent()) {
                $containers[$blockCode]['block'] = $block;
            }
        }

        return $this->renderWithExtraParams($template = $admin->getTemplate('compose'), [
            'object' => $dashboard,
            'action' => 'edit',
            'containers' => $containers,
            'csrfTokens' => [
                'remove' => $this->getCsrfToken('sonata.delete'),
            ],
        ]);
    }
882654
public function browseAction(Request $request)
    {
        $response = $this->convertResourceToPlainText(
            $request->getRequestFormat('xml'),
            $this->mapper->getCollection()
        );

        return new Response($response);
    }
38986
public function indexAction(Request $request)
    {
        $response = new Response();
        try {
            $this->channelContext->getChannel();
        } catch (ChannelNotFoundException $e) {
            $response->headers->setCookie(new Cookie('_channel_code', $this->fallbackChannelCode));
            $request->query->set('_channel_code', $this->fallbackChannelCode);
        }

        return $this->templating->renderResponse('@SyliusShop/Homepage/index.html.twig', [], $response);
    }
659244
public function indexAction(Request $request)
    {

        /** @var \Networking\InitCmsBundle\Lib\PhpCacheInterface $phpCache */
        $phpCache = $this->get('networking_init_cms.lib.php_cache');

        /** @var PageSnapshotInterface $page */
        $page = $request->get('_content');

        $template = $request->get('_template');
        if ($template instanceof \Sensio\Bundle\FrameworkExtraBundle\Configuration\Template) {
            $template = $template->getTemplate();
        }
        $user = $this->getUser();

        if ($phpCache->isCacheable($request, $user) && $page instanceof PageSnapshotInterface) {
            if (!$this->isSnapshotActive($page)) {
                throw new NotFoundHttpException();
            }

            if ($this->getSnapshotVisibility($page) != PageInterface::VISIBILITY_PUBLIC) {
                if (false === $this->get('security.authorization_checker')->isGranted('ROLE_USER')) {
                    throw new AccessDeniedException();
                }
            }

            $updatedAt = $phpCache->get(sprintf('page_%s_created_at', $page->getId()));
            $cacheKey = $request->getLocale().$request->getPathInfo();

            if ($updatedAt != $page->getSnapshotDate()) {
                $phpCache->delete($cacheKey);
            }

            $response = $phpCache->get($request->getLocale().$request->getPathInfo());

            if (!$response || !$response instanceof Response) {
                $params = $this->getPageParameters($request);

                if ($params instanceof RedirectResponse) {
                    return $params;
                }
                $html = $this->renderView(
                    $template,
                    $params
                );
                $response = new Response($html);

                $phpCache->set($cacheKey, $response);
                $phpCache->set(sprintf('page_%s_created_at', $page->getId()), $page->getSnapshotDate());
            } else {
                $phpCache->touch($cacheKey);
                $phpCache->touch(sprintf('page_%s_created_at', $page->getId()));
            }
        } else {
            $params = $this->getPageParameters($request);

            if ($params instanceof RedirectResponse) {
                return $params;
            }
            $html = $this->renderView(
                $template,
                $params
            );
            $response = new Response($html);
        }

        if ($this->getPageHelper()->isAllowLocaleCookie() && !$this->getPageHelper()->isSingleLanguage()) {
            $response->headers->setCookie(new Cookie('_locale', $request->getLocale()));
        }

        return $response;
    }
178305
protected function doRequest($request)
    {
        if (!$this->firstRequest) {
            $this->initialize($request);
        }
        $this->firstRequest = false;

        $this->applyBindings();
        $this->applyContextualBindings();
        $this->applyInstances();
        $this->applyApplicationHandlers();

        $request = Request::createFromBase($request);
        $response = $this->kernel->handle($request);
        $this->app->make('Illuminate\Contracts\Http\Kernel')->terminate($request, $response);

        return $response;
    }
74123
public function markAllAsReadAction(Request $request): Response
    {
        $configuration = $this->requestConfigurationFactory->create($this->metadata, $request);
        $this->isGrantedOr403($configuration, ResourceActions::UPDATE);

        $this->messageManager->markAllAsRead($this->getUser());

        if (!$configuration->isHtmlRequest()) {
            return $this->viewHandler->handle($configuration, View::create(null, Response::HTTP_NO_CONTENT));
        }

        $this->flashHelper->addSuccessFlash($configuration, ResourceActions::UPDATE);

        return $this->redirectHandler->redirectToIndex($configuration);
    }
274570
public function oauthCallbackAction(Request $request, Session $session, Client $client): RedirectResponse
    {
        // Give up if the required GET params or stored request token don't exist.
        if (!$request->get('oauth_verifier')) {
            throw $this->createNotFoundException('No OAuth verifier given.');
        }
        if (!$session->has('oauth.request_token')) {
            throw $this->createNotFoundException('No request token found. Please try logging in again.');
        }

        // Complete authentication.
        $token = $session->get('oauth.request_token');
        $verifier = $request->get('oauth_verifier');
        $accessToken = $client->complete($token, $verifier);

        // Store access token, and remove request token.
        $session->set('oauth.access_token', $accessToken);
        $session->remove('oauth.request_token');

        // Regenerate session ID.
        $session->migrate();

        // Store user identity.
        $ident = $client->identify($accessToken);
        $session->set('logged_in_user', $ident);

        // Send to homepage.
        return $this->redirectToRoute('home');
    }
233056
public function moveAction(Request $request)
    {
        $section = $this->getSection($request->query->get('id'), true);

        $terms = $section->getTerms();

        // [OP 2014-09-07] Verify that the target section is part of the same terms!
        $dest = $this->getQuery()
            ->filterByTermsId($terms->getId())
            ->findPk($request->query->get('dest_id'));

        if (!$request->isXmlHttpRequest() || !$dest) {
            throw $this->createNotFoundException('Section not found');
        }

        $data = array();

        try {
            switch ($request->query->get('as')) {
                case 'child':
                    $section->moveToFirstChildOf($dest);
                    break;
                case 'sibling':
                    $dest->isRoot() ?
                        $section->moveToFirstChildOf($dest)
                        : $section->moveToNextSiblingOf($dest);
                    break;
                default:
                    $section->moveToLastChildOf($dest);
                    break;
            }

            $data['success'] = true;
            $this->get('session')->getFlashBag()->add(
                'notice',
                $this->get('translator')->trans('section.move.success', array(), 'CPTermsBundle', $request->getLocale())
            );

        } catch (RuntimeException $e) {
            $data['success'] = false;
            $this->get('session')->getFlashBag()->add(
                'notice',
                $this->get('translator')->trans('section.move.error', array(), 'CPTermsBundle', $request->getLocale())
            );

        }

        return new Response(json_encode($data), 200, array('Content-Type' => 'application/json'));
    }
259871
public function dispatch(\Amp\Artax\Request $request) {
        $response = $this->api->execute($request, $this);
        $this->response = $response;
        $instance = \GithubService\Model\OauthAccess::createFromResponse($response, $this);

        return $instance;
    }