Esempio n. 1
0
    /**
     * @param \Symfony\Component\HttpFoundation\Request $request
     * @param int $type
     * @param bool $catch
     * @return \Symfony\Component\HttpFoundation\Response
     */
    public function handle(Request $request, $type = self::MASTER_REQUEST, $catch = true)
    {
        $front = $this->app->Front();
        $front->returnResponse(true);
        $front->throwExceptions(!$catch);

        $request->headers->set('Surrogate-Capability', 'shopware="ESI/1.0"');

        $request = $this->createRequest($request);

        if($front->Request() === null) {
            $front->setRequest($request);
            $response = $front->dispatch();
        } else {
            $dispatcher = clone $front->Dispatcher();
            $response = clone $front->Response();
            $response->clearHeaders()
                ->clearRawHeaders()
                ->clearBody();
            $response->setHttpResponseCode(200);
            $request->setDispatched(true);
            $dispatcher->dispatch($request, $response);
        }

        $response = $this->createResponse($response);

        return $response;
    }
Esempio n. 2
0
// Check the database config
if (file_exists('config.php') && strpos(file_get_contents('config.php'), '%db.database%') !== false) {
    header('Content-type: text/html; charset=utf-8', true, 503);

    echo '<h2>Fehler</h2>';
    echo 'Shopware 4 muss zunächst konfiguriert werden. Bitte führen Sie den Installer unter /install/ aus!';

    echo '<h2>Error</h2>';
    echo 'Shopware 4 must be configured first. Please run the installer under /install/!';
    return;
}

set_include_path(
    '.' . PATH_SEPARATOR .
    dirname(__FILE__) . '/engine/Library/' . PATH_SEPARATOR .   // Library
    dirname(__FILE__) . '/engine/' . PATH_SEPARATOR .           // Shopware
    dirname(__FILE__) . '/templates/'                           // Templates
);

include_once 'Enlight/Application.php';
include_once 'Shopware/Application.php';

$environment = getenv('ENV') ? getenv("ENV") : getenv("REDIRECT_ENV");
if (empty($environment)){
    $environment = 'production';
}

$s = new Shopware($environment);

return $s->run();
 /**
  * Constructor method
  *
  * Loads all needed resources for the test.
  */
 public function __construct($env, $config, $container)
 {
     $this->testPath = __DIR__ . '/';
     parent::__construct($env, $config, $container);
 }
 private function initTestNamespace()
 {
     $this->helper->Loader()->registerNamespace('Shopware\\SwagDefaultSort\\Test', __DIR__ . '/');
 }