From 1f30e3dba830d48e12deddb674e0967a1aea1a2a Mon Sep 17 00:00:00 2001 From: Jeroen van Leusden Date: Tue, 8 Jun 2021 15:58:23 +0200 Subject: [PATCH] [PARA-1797] Remove AppAreaListPlugin --- src/Plugin/AppAreaListPlugin.php | 84 -------------------------------- src/etc/di.xml | 10 ++-- 2 files changed, 3 insertions(+), 91 deletions(-) delete mode 100644 src/Plugin/AppAreaListPlugin.php diff --git a/src/Plugin/AppAreaListPlugin.php b/src/Plugin/AppAreaListPlugin.php deleted file mode 100644 index 05af1b4..0000000 --- a/src/Plugin/AppAreaListPlugin.php +++ /dev/null @@ -1,84 +0,0 @@ -request = $request; - $this->storeManager = $storeManager; - $this->storeUrls = $storeUrls; - } - - private static $modifiedOriginalPathInfo = false; - - /** - * @fixme This plugin may no longer be needed with the TrimBaseUrlFromPathInfo plugin - * - * @param AreaList $subject - * @param string $frontName - * - * @return array - */ - public function beforeGetCodeByFrontName(AreaList $subject, $frontName): array - { - $storeCode = $this->storeUrls->getStoreCodeByRequest($this->request); - - try { - /** @var \Magento\Store\Model\Store $store */ - $store = $this->storeManager->getStore($storeCode); - } catch (NoSuchEntityException $e) { - return [$frontName]; - } - - $pathParts = explode('/', ltrim($this->request->getPathInfo(), '/')); - - $baseUrl = rtrim(str_replace(['www.', 'http://', 'https://'], '', $store->getBaseUrl()), '/'); - if (count(explode('/', $baseUrl)) > 1) { - // Push custom path out array - array_shift($pathParts); - } - - $this->request->setPathInfo(implode('/', $pathParts) ?: '/'); - self::$modifiedOriginalPathInfo = implode('/', $pathParts) ?: '/'; - - return [reset($pathParts) ?: '']; - } - - public static function getModifiedOriginalPathInfo() - { - return self::$modifiedOriginalPathInfo; - } -} diff --git a/src/etc/di.xml b/src/etc/di.xml index eda0778..0d752d3 100644 --- a/src/etc/di.xml +++ b/src/etc/di.xml @@ -8,9 +8,6 @@ - - - @@ -18,14 +15,13 @@ + + + Magento\Framework\App\Cache\Type\Config - - - -