concrete/src/Http/Middleware/ThumbnailMiddleware.php
public function process(Request $request, DelegateInterface $frame)
    {
        $response = $frame->next($request);

        if ($response && $this->app->isInstalled() && $this->config->get('concrete.misc.basic_thumbnailer_generation_strategy') == 'now') {
            $responseStatusCode = (int) $response->getStatusCode();
            if ($responseStatusCode === 200 || $responseStatusCode === 404) {
                $database = $this->tryGetConnection();
                if ($database !== null) {
                    if ($responseStatusCode === 404) {
                        $searchThumbnailPath = $request->getRequestUri();
                    } else {
                        $searchThumbnailPath = null;
                    }
                    $thumbnail = $this->getThumbnailToGenerate($database, $searchThumbnailPath);
                    if ($thumbnail !== null) {
                        $this->markThumbnailAsBuilt($database, $thumbnail);
                        if ($this->generateThumbnail($thumbnail)) {
                            if ($this->couldBeTheRequestedThumbnail($thumbnail, $searchThumbnailPath)) {
                                $response = $this->buildRedirectToThumbnailResponse($request);
                            }
                        }
                    }
                }
            }
        }

        return $response;
    }
public function process(Request $request, DelegateInterface $frame)
    {
        $response = $frame->next($request);

        if ($response && $this->app->isInstalled() && $this->config->get('concrete.misc.basic_thumbnailer_generation_strategy') == 'now') {
            $responseStatusCode = (int) $response->getStatusCode();
            if ($responseStatusCode === 200 || $responseStatusCode === 404) {
                $database = $this->tryGetConnection();
                if ($database !== null) {
                    if ($responseStatusCode === 404) {
                        $searchThumbnailPath = $request->getRequestUri();
                    } else {
                        $searchThumbnailPath = null;
                    }
                    $thumbnail = $this->getThumbnailToGenerate($database, $searchThumbnailPath);
                    if ($thumbnail !== null) {
                        $this->markThumbnailAsBuilt($database, $thumbnail);
                        if ($this->generateThumbnail($thumbnail)) {
                            if ($this->couldBeTheRequestedThumbnail($thumbnail, $searchThumbnailPath)) {
                                $response = $this->buildRedirectToThumbnailResponse($request);
                            }
                        }
                    }
                }
            }
        }

        return $response;
    }
public function process ( Request $ request , DelegateInterface $ frame ) { $ response = $ frame -> next ( $ request ) ; if ( $ response && $ this -> app -> isInstalled ( ) && $ this -> config -> get ( 'concrete.misc.basic_thumbnailer_generation_strategy' ) == 'now' ) { $ responseStatusCode = ( int ) $ response -> getStatusCode ( ) ; if ( $ responseStatusCode === 200 || $ responseStatusCode === 404 ) { $ database = $ this -> tryGetConnection ( ) ; if ( $ database !== null ) { if ( $ responseStatusCode === 404 ) { $ searchThumbnailPath = $ request -> getRequestUri ( ) ; } else { $ searchThumbnailPath = null ; } $ thumbnail = $ this -> getThumbnailToGenerate ( $ database , $ searchThumbnailPath ) ; if ( $ thumbnail !== null ) { $ this -> markThumbnailAsBuilt ( $ database , $ thumbnail ) ; if ( $ this -> generateThumbnail ( $ thumbnail ) ) { if ( $ this -> couldBeTheRequestedThumbnail ( $ thumbnail , $ searchThumbnailPath ) ) { $ response = $ this -> buildRedirectToThumbnailResponse ( $ request ) ; } } } } } } return $ response ; }
Process the request and return a response.

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

@return \Symfony\Component\HttpFoundation\Response
Process the request and return a response .