@param \Symfony\Component\HttpFoundation\Request $request

@return \Symfony\Component\HttpFoundation\StreamedResponse
499260
public function getInvoiceAction(Request $request)
    {
        $customerClient = $this->getFactory()->getCustomerClient();
        $customerTransfer = $customerClient->getCustomer();

        if (!$customerTransfer) {
            return $this->redirectResponseInternal(PayoneControllerProvider::ROUTE_LOGIN);
        }

        $getInvoiceTransfer = new PayoneGetInvoiceTransfer();
        $getInvoiceTransfer->setReference($request->query->get('id'));
        $getInvoiceTransfer->setCustomerId($customerTransfer->getIdCustomer());

        $response = $this->getClient()->getInvoice($getInvoiceTransfer);

        if ($response->getStatus() === 'ERROR') {
            return $this->viewResponse(['errormessage' => $response->getInternalErrorMessage()]);
        }

        $callback = function () use ($response) {
            echo base64_decode($response->getRawResponse());
        };

        return $this->streamedResponse($callback, 200, ["Content-type" => "application/pdf"]);
    }
889792
public function audioAction(Request $request)
    {
        $params = $request->request->all();

        unset($params['module']);
        unset($params['controller']);
        unset($params['action']);

        $previewer = $this->get('phlexible_media_template.previewer.audio');
        $locator = $this->get('file_locator');

        $filePath = $locator->locate('@PhlexibleMediaTemplateBundle/Resources/public/audio/test.mp3', null, true);
        $data = $previewer->create($filePath, $params);

        return new ResultResponse(true, 'Preview created', $data);
    }
96452
public function getFileAction(Request $request)
    {
        $customerClient = $this->getFactory()->createCustomerClient();
        $customerTransfer = $customerClient->getCustomer();

        if (!$customerTransfer) {
            return $this->redirectResponseInternal(PayoneControllerProvider::ROUTE_LOGIN);
        }

        $getFileTransfer = new PayoneGetFileTransfer();
        $getFileTransfer->setReference($request->query->get('id'));
        $getFileTransfer->setCustomerId($customerTransfer->getIdCustomer());

        $response = $this->getClient()->getFile($getFileTransfer);

        if ($response->getStatus() === 'ERROR') {
            return $this->viewResponse(['errormessage' => $response->getCustomerErrorMessage()]);
        }

        $callback = function () use ($response) {
            echo base64_decode($response->getRawResponse());
        };

        return $this->streamedResponse($callback, 200, ["Content-type" => "application/pdf"]);
    }
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);
    }
271472
public function run(Request $request) {
		$file = $request->files->get('file');

		try {
			// validate: upload progress
			if (!$file->isValid()) {
				throw new FileException($file->getErrorMessage());
			}

			// validate: mime type
			$mimeTypes = ['image/png', 'image/jpeg', 'image/jpg', 'video/mp4', 'video/quicktime'];
			if (!in_array($file->getClientMimeType(), $mimeTypes)) {
				throw new FileException('No matching mime type');
			}

			// validate: extension
			$exts = ['png', 'jpg', 'jpeg', 'mp4', 'mov'];
			if (!in_array($file->getClientOriginalExtension(), $exts)) {
				throw new FileException('No matching extension');
			}

			// move uploaded file
			$slugifier = new Slugify();
			$fileName = $file->getClientOriginalName();
			$fileName = str_replace('.' . $file->getClientOriginalExtension(), '', $fileName);
			$fileName = $slugifier->slugify($fileName) . '.' . $file->getClientOriginalExtension();
			$file->move($this->getModule()->getUploadPath()->toString(), $fileName);
			$payload = new Success([
				'filename' => $fileName,
				'url' => $this->getModule()->getUploadUrl() . '/' . urlencode($fileName)
			]);
		} catch (FileException $e) {
			$payload = new Failed(['error' => $e->getMessage()]);
		}

		return $this->responder->run($request, $payload);
	}
365821
public function send(Request $request)
    {
        $response   = new GetResponse();
        $rpbGetReq  = $this->createRpbMessage($request);
        $rpbGetResp = $this->client->send($rpbGetReq, RiakMessageCodes::GET_REQ, RiakMessageCodes::GET_RESP);

        if ( ! $rpbGetResp instanceof RpbGetResp) {
            return $response;
        }

        if ( ! $rpbGetResp->hasContent()) {
            return $response;
        }

        $response->vClock      = $rpbGetResp->getVclock()->get();
        $response->contentList = $this->createContentList($rpbGetResp->getContentList());

        return $response;
    }
182851
public function send(Request $request)
    {
        $response     = new PutResponse();
        $httpRequest  = $this->createHttpRequest($request);
        $httpResponse = $this->client->send($httpRequest);
        $code         = $httpResponse->getStatusCode();

        if ( ! isset($this->validResponseCodes[$code])) {
            throw RiakTransportException::unexpectedStatusCode($code);
        }

        if ($code === 204) {
            return $response;
        }

        $json    = $httpResponse->json();
        $context = isset($json['context']) ? $json['context'] : null;
        $value   = $json['value'];
        $type    = $json['type'];

        $response->type    = $type;
        $response->context = $context;
        $response->value   = $this->opConverter->fromArray($type, $value);

        return $response;
    }
962081
public function dispatch(Request $request)
    {
        // Create the action instance
        $action = $this->resolveAction($request->getHandler());

        return $action->execute($request->getParameters());
    }
765088
public function download($request) {
		if ($request->param('ID')) {
			$object = ExternalContent::getDataObjectFor($request->param('ID'));
			if ($object && $object instanceof ExternalContentItem) {
				$object->streamContent();
			}
		}
	}
222142
protected function createStream(BrowserKitRequest $request)
    {
        $stream = fopen('php://temp', 'a+');
        fwrite($stream, $request->getContent());
        
        return new Stream($stream);
    }
1122069
public function mediaAction(Request $request)
    {
        $providers = $this->get('opifer.media.provider.pool')->getProviders();

        return $this->render('OpiferCmsBundle:CKEditor:media.html.twig', [
            'providers' => $providers,
            'funcNum' => $request->get('CKEditorFuncNum'),
            'CKEditor' => $request->get('CKEditor'),
            'type' => $request->get('type'),
        ]);
    }
574816
public function renderAsync(\Illuminate\Http\Request $request)
    {
        $query = $this->getRepository()->getQuery();
        $totalCount = $query->count();
        $filteredCount = 0;

        if (! is_null($this->distinct)) {
            $filteredCount = $query->distinct()->count($this->getDistinct());
        }

        $this->modifyQuery($query);
        $this->applySearch($query, $request);

        if (is_null($this->distinct)) {
            $countQuery = clone $query;
            $countQuery->getQuery()->orders = null;
            $filteredCount = $countQuery->count();
        }

        $this->applyOffset($query, $request);
        $collection = $query->get();

        return $this->prepareDatatablesStructure($request, $collection, $totalCount, $filteredCount);
    }
71887
public function createAction(Request $request) {
        $entity = new Post();
        $form = $this->createCreateForm($entity);
        $form->handleRequest($request);

        if ($form->isValid()) {
            $em = $this->getDoctrine()->getManager();
            $this->processVideo($entity);
            $em->persist($entity);
            $em->flush();

            return $this->redirect($this->generateUrl('admin_post_show', array('id' => $entity->getId())));
        } else {
            $this->get('session')->getFlashBag()->add(
                    'warning', $this->get('translator')->trans('save_fail')
            );
        }

        return array(
            'entity' => $entity,
            'form' => $form->createView(),
        );
    }
1344116
public function handle(Request $request)
    {
        foreach ($this->staticContentPatterns as $ptn) {
            if (preg_match($ptn, $request->getRequestUri(), $m)) {
                $path = urldecode(parse_url($m[1], PHP_URL_PATH));
                if (!is_file($this->webDir . $path)) {
                    return $this->createDefaultNotFoundResponse($path);
                }
            }
        }
        return null;
    }
1139982
public function send(Request $request)
    {
        $response = new ListResponse();
        $rpbReq   = $this->createRpbMessage($request);
        $socket   = $this->client->emit($rpbReq, RiakMessageCodes::LIST_BUCKETS_REQ);
        $iterator = new ProtoStreamIterator($this->client, $socket, RiakMessageCodes::LIST_BUCKETS_RESP);

        $response->iterator = new ProtoListResponseIterator($iterator);

        return $response;
    }
164276
public function dispatch(\Illuminate\Http\Request $request)
	{
		$this->currentRequest = $request;

		$response = $this->prepareResponse($request, $request);

		return $response;
	}
374973
public static function streamed(callable $callback = null, $status = ResponseHeader::HTTP_OK, $headers = [])
    {
        return new StreamedResponse($callback, $status, $headers);
    }