$salesChannel = $this->findSalesChannel($request);
if ($salesChannel === null) {
// this class and therefore the "isSalesChannelRequired" method is currently not extendable
// which can cause problems when adding custom paths
throw new SalesChannelMappingException($request->getUri());
}
$absoluteBaseUrl = $this->getSchemeAndHttpHost($request) . $request->getBaseUrl();
$baseUrl = str_replace($absoluteBaseUrl, '', $salesChannel['url']);
$container = $kernel->getContainer();
// transform request to resolve seo urls and detect sales channel
$transformed = $container
->get(RequestTransformerInterface::class)
->transform($request);
$redirect = $container
->get(CanonicalRedirectService::class)
->getRedirect($transformed);
}
public function handle(Request $request, int $type = HttpKernelInterface::MAIN_REQUEST, bool $catch = true): HttpKernelResult
{
try {
return $this->doHandle($request, $type, $catch);
} catch (Exception $e) {
/** @var Params|array{url?: string} $connectionParams */
$connectionParams = self::getConnection()->getParams();
$message = str_replace([$connectionParams['url'] ?? null, $connectionParams['password'] ?? null, $connectionParams['user'] ?? null], '******', $e->getMessage());
$this->httpKernel = $httpKernel;
}
public function handle(Request $request, int $type = self::MAIN_REQUEST, bool $catch = true): Response
{
return $this->httpKernel->handle($request, $type, $catch)->getResponse();
}
public function terminate(Request $request, Response $response): void
{
$this->httpKernel->terminate($request, $response);
$this->request = $request;
}
public function run(): int
{
$response = $this->kernel->handle($this->request);
$response->send();
if ($this->kernel instanceof TerminableInterface) {
$this->kernel->terminate($this->request, $response);
}
$app = $app(...$args);
exit(
$runtime
->getRunner($app)
->run()
);
use Symfony\Component\HttpKernel\HttpKernelInterface;
use Symfony\Component\HttpKernel\TerminableInterface;
$_SERVER['SCRIPT_FILENAME'] = __FILE__;
require_once __DIR__ . '/../vendor/autoload_runtime.php';
if (!file_exists(__DIR__ . '/../.env') && !file_exists(__DIR__ . '/../.env.dist') && !file_exists(__DIR__ . '/../.env.local.php')) {
$_SERVER['APP_RUNTIME_OPTIONS']['disable_dotenv'] = true;
}
SalesChannelMappingException
|
---|
Shopware\Storefront\Framework\Routing\Exception\SalesChannelMappingException: Unable to find a matching sales channel for the request: http://showcase.payrexx.com/shopware6/public/account/login". Please make sure the domain mapping is correct. at /usr/www/users/showcase/shopware6/vendor/shopware/storefront/Framework/Routing/RequestTransformer.php:109 at Shopware\Storefront\Framework\Routing\RequestTransformer->transform() (/usr/www/users/showcase/shopware6/vendor/shopware/core/HttpKernel.php:119) at Shopware\Core\HttpKernel->doHandle() (/usr/www/users/showcase/shopware6/vendor/shopware/core/HttpKernel.php:61) at Shopware\Core\HttpKernel->handle() (/usr/www/users/showcase/shopware6/public/index.php:63) at Symfony\Component\HttpKernel\HttpKernelInterface@anonymous /usr/www/users/showcase/shopware6/public/index.php:53$0->handle() (/usr/www/users/showcase/shopware6/vendor/symfony/runtime/Runner/Symfony/HttpKernelRunner.php:35) at Symfony\Component\Runtime\Runner\Symfony\HttpKernelRunner->run() (/usr/www/users/showcase/shopware6/vendor/autoload_runtime.php:29) at require_once('/usr/www/users/showcase/shopware6/vendor/autoload_runtime.php') (/usr/www/users/showcase/shopware6/public/index.php:12) |