Renders temporary file

@return Response
540421
public function renderTemporaryAction()
    {
        $name = $this->getRequest()->get('name');
        $fileManager = $this->container->get('thrace_media.filemanager');
        $content = $fileManager->getTemporaryFileBlobByName($name);
        
        $response = new Response($content);        
        $response->headers->set('Accept-Ranges', 'bytes');
        $response->headers->set('Content-Length', mb_strlen($content));
        $response->headers->set('Content-Type', $this->getMimeType($content));
        $response->expire();
    
        return $response;
    }
550102
public function render()
    {
        $exception = $this->error;
        $code = $this->_code($exception);
        $method = $this->_method($exception);
        $template = $this->_template($exception, $method, $code);
        $unwrapped = $this->_unwrap($exception);

        if (method_exists($this, $method)) {
            return $this->_customMethod($method, $unwrapped);
        }

        $message = $this->_message($exception, $code);
        $url = $this->controller->getRequest()->getRequestTarget();
        $response = $this->controller->getResponse();

        if ($exception instanceof CakeException) {
            foreach ((array)$exception->responseHeader() as $key => $value) {
                $response = $response->withHeader($key, $value);
            }
        }
        $response = $response->withStatus($code);

        $viewVars = [
            'message' => $message,
            'url' => h($url),
            'error' => $unwrapped,
            'code' => $code,
            '_serialize' => ['message', 'url', 'code']
        ];

        $isDebug = Configure::read('debug');
        if ($isDebug) {
            $viewVars['trace'] = Debugger::formatTrace($unwrapped->getTrace(), [
                'format' => 'array',
                'args' => false
            ]);
            $viewVars['file'] = $exception->getFile() ?: 'null';
            $viewVars['line'] = $exception->getLine() ?: 'null';
            $viewVars['_serialize'][] = 'file';
            $viewVars['_serialize'][] = 'line';
        }
        $this->controller->set($viewVars);

        if ($unwrapped instanceof CakeException && $isDebug) {
            $this->controller->set($unwrapped->getAttributes());
        }
        $this->controller->response = $response;

        return $this->_outputMessage($template);
    }
940151
public function renderAction()
    {
        $redir      = false;
        $params     = $this->params();
        $pathname   = $params->fromRoute( 'pathname' );
        $matches    = array();
        $hasMatch   = preg_match( '#^(.+)/([^/]+)/([0-9x\-]+)/([^/]+)/' .
                                  '([^/]+)/([0-9]+)/([^/\?]+)(\?.*)?$#',
                                  $pathname, $matches );

        if ( ! $hasMatch )
        {
            return $this->error( 400 );
        }

        list( , $this->path,
                $this->method,
                $sizes,
                $this->bgColor,
                $filters,
                $mtime,
                $this->file ) = $matches;

        $sizes = explode( '-', $sizes, 3 );

        if ( count( $sizes ) == 3 )
        {
            $this->crop = true;

            list( $this->width,
                  $this->height ) = explode( 'x', $sizes[2], 2 );
            list( $this->cropLeft,
                  $this->cropTop ) = explode( 'x', $sizes[0], 2 );
            list( $this->cropWidth,
                  $this->cropHeight ) = explode( 'x', $sizes[1], 2 );
        }
        else
        {
            $this->crop = false;

            list( $this->width,
                  $this->height ) = explode( 'x', $sizes[0], 2 );
        }

        $mtime          = (int) $mtime;
        $this->width    = (int) $this->width;
        $this->height   = (int) $this->height;
        $inputPath      = Thumbnail::THUMBNAIL_BASEPATH
                        . '/' . $this->filePath();

        if ( 0 == $this->width &&
             self::MIN_HEIGHT <= $this->height &&
             is_file( $inputPath ) &&
             filesize( $inputPath ) > 0 )
        {
            $inputSizes = getimagesize( $inputPath );

            if ( ! empty( $inputSizes[0] ) && ! empty( $inputSizes[1] ) )
            {
                $this->width = (int) ( $inputSizes[0] * $this->height / $inputSizes[1] );
                $redir = true;
            }
        }

        if ( 0 == $this->height &&
             self::MIN_WIDTH <= $this->width &&
             is_file( $inputPath ) &&
             filesize( $inputPath ) > 0 )
        {
            $inputSizes = getimagesize( $inputPath );

            if ( ! empty( $inputSizes[0] ) && ! empty( $inputSizes[1] ) )
            {
                $this->height = (int) ( $inputSizes[1] * $this->width / $inputSizes[0] );
                $redir = true;
            }
        }

        if ( self::MIN_WIDTH > $this->width )
        {
            $this->width = self::DEFAULT_WIDTH;
            $redir = true;
        }

        if ( self::MIN_HEIGHT > $this->height )
        {
            $this->height = self::DEFAULT_HEIGHT;
            $redir = true;
        }

        if ( ! is_file( $inputPath ) )
        {
            return $this->error( 404 );
        }

        if ( 1 > filesize( $inputPath ) )
        {
            return $this->error( 415 );
        }

        if ( preg_match( '#^image/(x-|vnd.microsoft.)?icon?$#',
                         $this->getMime( $inputPath ) ) )
        {
            return $this->redirect()
                        ->toUrl( '/uploads/' . $this->filePath() );
        }

        if ( $filters == 'none' )
        {
            $this->filters = array();
        }
        else
        {
            $this->filters = explode( '-', $filters );
        }

        if ( ! Image::isResize( $this->method ) )
        {
            $this->method = self::DEFAULT_METHOD;
            $redir = true;
        }

        foreach ( $this->filters as $index => $filter )
        {
            $filter = explode( ',', $filter );

            if ( ! Image::isFilter( $filter[0] ) )
            {
                unset( $this->filters[$index] );
            }
        }

        if ( empty( $this->filters ) )
        {
            $newFilters = 'none';
        }
        else
        {
            $newFilters = implode( '-', $this->filters );
        }

        if ( $filters != $newFilters )
        {
            $redir = true;
        }

        $fmt = filemtime( $inputPath );

        if ( $fmt != $mtime )
        {
            $mtime = $fmt;
            $redir = true;
        }

        if ( $redir )
        {
            return $this->redirect()
                        ->toUrl( $this->outputUri( $mtime ) );
        }

        if ( ! $this->getImage( $inputPath ) )
        {
            return $this->error( 415 );
        }

        if ( $this->crop )
        {
            $this->getImage()
                 ->cropTo(
                     $this->cropLeft,
                     $this->cropTop,
                     $this->cropWidth,
                     $this->cropHeight
                 );
        }

        $this->getImage()
             ->resize(
                 $this->width,
                 $this->height,
                 $this->method,
                 $this->bgColor
             );

        foreach ( $this->filters as $filter )
        {
            $filter = explode( ',', $filter );
            $name = array_shift( $filter );

            $this->getImage()
                 ->filter( $name, $filter );
        }

        $outputPath = $this->outputPath( $mtime );

        if ( ! is_dir( dirname( $outputPath ) ) )
        {
            mkdir( dirname( $outputPath ), 0777, true );
        }

        $this->getImage()
             ->render( $outputPath );

        $response = Readfile::fromFile( $outputPath, Image::typeToMimeType(
            $this->getImage()
                 ->getType()
        ) );

        $this->getEvent()
             ->setResponse( $response );

        return $response;
    }
95864
public function render() {
        $request     = Request::me();
        $namespace   = $this->module->getViewNamespace();
        $appUri      = $request->getApplicationBaseUri();
        $nestedTiles = $this->nestedTiles;
        foreach ($nestedTiles as $tile) {
            $tile->setParent($this);
        }
        $properties  = $this->getMergedProperties();

        if (!defined($namespace.'APP')) {
            define($namespace.'APP', strLeft($appUri, -1));
        }
        if (!defined($namespace.'MODULE')) {
            $moduleUri = $appUri.$this->module->getPrefix();
            define($namespace.'MODULE', strLeft($moduleUri, -1));
        }

        $properties['request' ] = $request;
        $properties['response'] = Response::me();
        $properties['session' ] = $request->isSession() ? $request->getSession() : null;
        $properties['form'    ] = $request->getAttribute(ACTION_FORM_KEY);
        $properties['page'    ] = Page::me();

        if ($this->isPushModelSupport()) {
            $pageValues = Page::me()->values();
            $properties = \array_merge($properties, $pageValues);
        }

        $tileHint = false;
        if (Application::isAdminIP()) {
            $rootDir  = $this->di('config')['app.dir.root'];
            $file     = $this->fileName;
            $file     = strRightFrom($file, $rootDir.DIRECTORY_SEPARATOR, 1, false, $file);
            $file     = 'file="'.str_replace('\\', '/', $file).'"';
            $tile     = $this->name==self::GENERIC_NAME ? '':'tile="'.$this->name.'" ';
            $tileHint = $tile.$file;
            echo ($this->parent ? NL:'').'<!-- #begin: '.$tileHint.' -->'.NL;
        }

        includeFile($this->fileName, $nestedTiles + $properties);

        if ($tileHint) {
            echo NL.'<!-- #end: '.$tileHint.' -->'.NL;
        }
        return $this;
    }
228144
public function outputToBrowser()
    {
        $prevState = SSViewer::config()->uninherited('source_file_comments');
        SSViewer::config()->update('source_file_comments', false);

        $response = Controller::curr()->getResponse();

        if (is_int($this->lastModified)) {
            HTTPCacheControlMiddleware::singleton()->registerModificationDate($this->lastModified);
            $response->addHeader("Last-Modified", gmdate("D, d M Y H:i:s", $this->lastModified) . ' GMT');
        }
        if (!empty($this->etag)) {
            $response->addHeader('ETag', "\"{$this->etag}\"");
        }

        $response->addHeader("Content-Type", "application/rss+xml; charset=utf-8");

        SSViewer::config()->update('source_file_comments', $prevState);
        return $this->renderWith($this->getTemplates());
    }
678097
protected function render()
	{
		if (empty($this->getContent())) {
			$parsed = simplexml_load_string($this->file->getContent(), "SimpleXMLElement", LIBXML_NOCDATA);
			$parsed = json_decode(json_encode($parsed), true);
			$this->setContent(is_array($parsed) ? $parsed : []);
		}
	}
39135
public function render()
    {
        parent::render();

        // assign all member variables to template
        $aClassVars = get_object_vars($this);
        foreach ($aClassVars as $name => $value) {
            $this->_aViewData[$name] = $value;
        }

        $this->_aViewData['sOutputFile'] = $this->_sFilePath;
        $this->_aViewData['sDownloadFile'] = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('sShopURL') . $this->sExportPath . $this->sExportFileName . "." . $this->sExportFileType;

        return $this->_sThisTemplate;
    }
541117
public function getTempPath(): string
    {
        $path = $this->getRuntimePath() . DIRECTORY_SEPARATOR . 'temp';
        FileHelper::createDirectory($path);
        return $path;
    }
127263
public function render()
    {
        extract($this->data, EXTR_SKIP);
        extract(self::$global, EXTR_SKIP);

        try {
            include $this->path;
        } catch (Exception $e) {
            ob_end_clean();
        }

        return ob_get_clean();
    }
119052
public function render()
    {
        $returnValue = (string) '';

        
        
        if(file_exists($this->path) && is_readable($this->path)){
        	
	        extract($this->variables);
	      
	        ob_start();
	        
	        common_Logger::i('including \''.$this->path.'\' into form', array('TAO'));
	        
	       include $this->path;
	        
	        $returnValue = ob_get_contents();
	        
	        ob_end_clean();
	        
	        //clean the extracted variables
	        foreach($this->variables as $key => $name){
	        	unset($$key);
	        }
        	
        }
        
        

        return (string) $returnValue;
    }
625938
public function render()
	{
		$template = $this->getTemplate(true);

		$params = array('template' => $template->template, 'file' => 'index.php', 'directory' => JPATH_THEMES, 'params' => $template->params);

		// Parse the document.
		$document = JFactory::getDocument();
		$document->parse($params);

		// Trigger the onBeforeRender event.
		JPluginHelper::importPlugin('system');
		$this->triggerEvent('onBeforeRender');

		// Render the document.
		$caching = ($this->getCfg('caching') >= 2) ? true : false;
		JResponse::setBody($document->render($caching, $params));

		// Trigger the onAfterRender event.
		$this->triggerEvent('onAfterRender');
	}
711164
public function render()
    {
        // Set the request arguments as GET parameters
        $_GET = $this->getRequestArguments();

        try {
            /** @var \TYPO3\CMS\Extbase\Mvc\Web\Response $response */
            $response = $this->objectManager->get(Response::class);
            $this->request->setOriginalRequestMappingResults($this->validationErrors);
            $this->getControllerInstance()->processRequest($this->request, $response);
            $result = $this->beautify($response->getContent());

            // In case of an error
        } catch (\Exception $e) {
            $result = '<pre class="error"><strong>'.$e->getMessage().'</strong>'.PHP_EOL
                      .$e->getTraceAsString().'</pre>';
        }

        return $result;
    }
1009281
public function render()
	{
		$this->_path = $this->getPath();

		if (! is_readable($this->_path)) {
			Request::setHttpHeader(Request::HEADER_404);
			$this->setFile(static::ERROR_404);
			$this->_path = $this->getPath();

			if (! is_readable($this->_path)) {
				throw new Exception("View file '" . $this->_path . "' doesn't exists");
			}
		}

		$template = self::getTemplateConfig();
		if (! is_array($template) or ! isset($template['type'])) {
			throw new Exception("A template and a template type are required to render the view");
		}

		$this->_type = $template['type'];

		if (isset($template['file'])) {
			$template = APP_PATH
				        . Agl::APP_TEMPLATE_DIR
				        . $template['file']
				        . Agl::PHP_EXT;

			require($template);
		} else {
			require($this->_path);
		}

		$buffer = ob_get_clean();

		Observer::dispatch(Observer::EVENT_VIEW_RENDER_BUFFER_BEFORE, array(
			'view'   => $this,
			'buffer' => &$buffer
		));

		return $this->_prepareRender($buffer);
	}
1175531
public function render()
    {
        $path = $this->resolvePathVariable();
        $content =  "PATH=$path \n". implode(PHP_EOL, $this->getJobs());
        return $content;
    }
233821
public function render()
    {
        if (!is_readable($this->template) || !is_file($this->template)) {
            throw new \RuntimeException('Cannot read template ' . $this->template);
        }

        ob_start();
        include $this->template;
        return ob_get_clean();
    }
906994
public function displayFile()
	{
		//get the stored path of the original
		$path = $this->request->input('path');
		$data = File::get($path);
		$file = new SFile($path);

		$headers = array(
			'Content-Type' => $file->getMimeType(),
			'Content-Length' => $file->getSize(),
			'Content-Disposition' => 'attachment; filename="' . $file->getFilename() . '"'
		);

		return response()->make($data, 200, $headers);
	}
129933
public function render()
    {
        parent::render();

        // security fix so that you cant access files from outside template dir
        $sTplName = basename((string) \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("tpl"));
        if ($sTplName) {
            $sTplName = 'custom/' . $sTplName;
        }

        return $sTplName;
    }