1
0
mirror of https://github.com/laravel/valet.git synced 2026-02-07 01:00:09 +01:00

Add support for versions path in URLs added in Magento 2.1.3

This commit is contained in:
Joe Constant
2017-01-12 15:12:43 -07:00
committed by Adam Wathan
parent 953d828afd
commit bbf7a45f5f

View File

@@ -35,6 +35,7 @@ public function isStaticFile($sitePath, $siteName, $uri)
{
$this->checkMageMode($sitePath);
$uri = $this->handleForVersions($uri);
$route = parse_url(substr($uri, 1))['path'];
$pub = '';
@@ -72,6 +73,17 @@ public function isStaticFile($sitePath, $siteName, $uri)
return false;
}
/**
* Rewrite URLs that look like "versions12345/" to remove
* the versions12345/ part
*
* @param string $route
*/
private function handleForVersions($route)
{
return preg_replace('/version\d*\//', '', $route);
}
/**
* Determine the current MAGE_MODE
*