Setup task

@param HTTPRequest $request
503662
public function run($request)
    {
        $name = get_class($this);
        $verbose = $request->getVar('verbose');

        // Set new logger
        $logger = $this
            ->getLoggerFactory()
            ->getOutputLogger($name, $verbose);
        $this->setLogger($logger);
    }
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);
        }
    }
332665
function build(iHttpRequest $request)
    {
        switch (1)
        {
            case ($this->protocol !== null): $request->setProtocol($this->protocol);
            case ($this->method   !== null): $request->setMethod($this->method);
            case ($this->host     !== null): $request->setHost($this->host);
            case ($this->version  !== null): $request->setVersion($this->version);
            case ($this->target   !== null): $request->setTarget($this->target);
            case ($this->headers  !== null): $request->setHeaders($this->headers);
            case ($this->body     !== null): $request->setBody($this->body);
        }
    }
809071
public function execute($request)
    {
        ob_start();
        $logger          = $GLOBALS['logger'];
        $this->_request  = $request;
        $this->_response = new HttpResponse();
        try {
            WebSessionManager::updateActiveSession();
            foreach ($this->_preProcessors as $preProcessor) {
                $preProcessor->process($this->_request);
            }

            $functionToCall = $this->command->getFunction();
            if (empty($functionToCall) === true) {
                $functionToCall = 'default';
            }

            if (!is_callable(array(&$this,'_'.$functionToCall))) {
                $functionToCall = 'error';
            }

            call_user_func(array(&$this,'_'.$functionToCall), $this->_request);
            foreach ($this->_postProcessors as $postProcessor) {
                $postProcessor->process($this->_response);
            }

            ob_end_clean();
            if (empty($this->_response)) {
                $this->_response = new HttpResponse(); 
            }

            if($this->_response->getEncoding() == null) {
                $responseMode = $this->_request->getParam('mode');
                if ($responseMode === 'ui') {
                    $this->_response->setEncoding('html');
                } else if ($responseMode === 'data') {
                    $this->_response->setEncoding('json');
                }
            }
            $this->_response->send();
        } catch (ServiceException $se) {
            $this->_response = new HttpResponse();
            $response->addHeader('HTTP/1.1 400 Bad Request');
            $this->_response->send();
        } catch(BadResponseException $bre) {
            $renderer = new TwigRenderer('500.html');
            if($renderer->exists()) {
                $this->_response = new HttpResponse('none', $renderer);
            } else 
                $this->_response = new HttpResponse();
            $response->addHeader('HTTP/1.1 500 Internal Server Error');
            $this->_response->send();
        }//end try

    }
913593
function assign(Swoole\Request $request)
    {
        $_request = $this->getRequest();
        if (!empty($_request->get))
        {
            $request->get = $_request->get;
        }
        if (!empty($_request->post))
        {
            $request->post = $_request->post;
        }
        if (!empty($_request->files))
        {
            $request->files = $_request->files;
        }
        if (!empty($_request->cookie))
        {
            $request->cookie = $_request->cookie;
        }
        if (!empty($_request->server))
        {
            foreach ($_request->server as $key => $value)
            {
                $request->server[strtoupper($key)] = $value;
            }
            $request->remote_ip = $_request->server['remote_addr'];
        }
        $request->header = $_request->header;
        $request->setGlobal();
    }
346632
public function setRequest(Request $request)
    {
        $this->setParam('request', $request);
        $this->request = $request;
        return $this;
    }
454565
public function init($request)
    {
        if (!class_exists('\OxidEsales\EshopCommunity\Setup\Setup')) {
            throw new \Exception("Shop Setup directory has to be present!");
        }

        $serialNumber = $request->getParameter('serial', false);
        $serialNumber = $serialNumber ? $serialNumber : $this->getDefaultSerial();

        $this->setupDatabase();

        if ($tempDir = $request->getParameter('tempDirectory')) {
            $this->insertConfigValue('string', 'sCompileDir', $tempDir);
        }
        $this->insertConfigValue('int', 'sOnlineLicenseNextCheckTime', time() + 25920000);

        if ($request->getParameter('addDemoData', false)) {
            $this->insertDemoData();
        }

        $this->setConfigurationParameters();

        $this->setSerialNumber($serialNumber);

        $config = $this->getShopConfig();
        $default = property_exists($config, 'turnOnVarnish') ? $config->turnOnVarnish : false;
        if ($request->getParameter('turnOnVarnish', $default)) {
            $this->turnVarnishOn();
        }

        $cache = new Cache();
        $cache->clearTemporaryDirectory();
    }
121834
final public function run(Request $request)
    {
        $this->request = $request;
        $path = $this->request->getUri()->getPath();
        $this->requestedUri = ($path != "/") ? rtrim($path, "/") : "/";
        $this->requestedMethod = strtoupper($this->request->getMethod());
        $this->requestedRepresentation = $this->request->getAccept();
        $this->verifyRequestMethod();
        $route = $this->findRouteFromRequest();
        $this->prepareResponse($route);
    }
176939
public function execute($request)
    {
        RequestNotSupportedException::assertSupports($this, $request);
        $this->logger->info("Ecommpay order #{$request->getFirstModel()->getOrder()->getNumber()} have paid");
        throw new HttpResponse('OK');
    }
425412
public function run(Request $request = NULL)
    {
        if ( !$request ) {
            $request = Request::createFromGlobals();
        }

        $this->getServiceManager()->add(get_class($request), $request);

        // Retrieve the middlewares list
        $httpMiddlewares = $this->config->get('middlewares', []);
        ksort($httpMiddlewares);

        $bus = new Pipe($this->getServiceManager());

        $pipe = $bus->pipe(
            $httpMiddlewares
        );

        $response = $pipe($request);
        $response->send();
    }
1320327
public function setRequest(\OxidEsales\PayPalModule\Model\PayPalRequest\PayPalRequest $request)
    {
        $this->setParameters($request->getData());
    }
642661
public function execute($request)
    {
        /** @var Request $request */
        RequestNotSupportedException::assertSupports($this, $request);

        $model = ArrayObject::ensureArrayObject($request->getModel());

        if ($model['vads_trans_id']) {
            return;
        }

        $model['vads_trans_id'] = $this->api->getTransactionId();
        // Current UTC date time
        $model['vads_trans_date'] = (new \DateTime('now', new \DateTimeZone('UTC')))->format('YmdHis');

        $data = $model->getArrayCopy();

        $this->logRequestData($data);

        $url = $this->api->createRequestUrl($data);

        throw new HttpRedirect($url);
    }
770636
public function setup()
    {
        $this->request = new Request();
        $this->response = new Response();
        $this->env = new Environment();
        $this->mode = $this->env->getMode();
        if (!$this->env->isProduction() || $this->cache == null) {
            $this->cache = new AdapterNull();
        }
        $this->loadPackages();
        $this->loadConfig();
        // @codeCoverageIgnoreStart
        if (array_key_exists('ini.set', $this->config)) {
            foreach ($this->config['ini.set'] as $iniName => $iniValue) {
                ini_set($iniName, $iniValue);
            }
        }
        // @codeCoverageIgnoreEnd
        $this->loadRoutes();
        $this->isSetup = true;
    }
109481
protected function createAlexaRequest($request) {
    	$this->voiceInterface = 'Alexa';

        // Create AlexaRequest from HTTP request
        $this->alexaRequest = new AlexaRequest(
            $request->getBody()->getContents(),
            $this->askApplicationIds,
	        $request->getHeaderLine('Signaturecertchainurl'),
	        $request->getHeaderLine('Signature'),
	        $this->settings['validateTimestamp'],
	        $this->settings['validateCertificate']
        );

        // Update auto initialized translator as Alexa request might contain a locale
        if($this->alexaRequest->getRequest()->getLocale() && in_array('translator', $this->settings['auto_init'])) {
            $this->translator->chooseLocale($this->alexaRequest->getRequest()->getLocale());
        }

		// Create new AlexaResponse
	    $this->alexaResponse = new AlexaResponse;
    }
161329
public function init($request)
    {
        if (($shopId = $request->getParameter('shp')) && (1 < $shopId)) {
            $this->switchToShop($shopId);
        }

        $modulesToActivate = $request->getParameter("modulestoactivate");
        $moduleDirectory = \OxidEsales\Eshop\Core\Registry::getConfig()->getModulesDir();

        $this->prepareModulesForActivation($moduleDirectory);
        foreach ($modulesToActivate as $modulePath) {
            $this->installModule($modulePath);
        }
    }
1199872
protected function doRequest($request)
    {
        // avoid shutting down the Kernel if no request has been performed yet
        // WebTestCase::createClient() boots the Kernel but do not handle a request
        if ($this->hasPerformedRequest && $this->reboot) {
            $this->kernel->shutdown();
        } else {
            $this->hasPerformedRequest = true;
        }

        if ($this->profiler) {
            $this->profiler = false;

            $this->kernel->boot();
            $this->kernel->getContainer()->get('profiler')->enable();
        }

        return parent::doRequest($request);
    }
1201574
public function execute($request)
    {
        RequestNotSupportedException::assertSupports($this, $request);

        $details = ArrayObject::ensureArrayObject($request->getModel());

        if (isset($details['RtnCode']) === false) {
            $request->markNew();

            return;
        }

        if ($details['RtnCode'] === '2') {
            $request->markPending();

            return;
        }

        if ($details['RtnCode'] === '1') {
            if (isset($details['Action']) === true) {
                switch ($details['Action']) {
                    case 'C':
                        $request->markCaptured();
                        break;
                    case 'R':
                        $request->markRefunded();
                        break;
                    case 'E':
                    case 'N':
                        $request->markCanceled();
                        break;
                }

                return;
            } else {
                $request->markCaptured();

                return;
            }
        }

        $request->markFailed();
    }