From 386a447467d7a5d368946fcd97592735bb85683f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rapha=C3=ABl=20Gertz?= Date: Wed, 14 Oct 2020 03:43:20 +0200 Subject: [PATCH] Rename pack_package into path_package --- Asset/PackPackage.php | 56 ------------------------------------------- 1 file changed, 56 deletions(-) delete mode 100644 Asset/PackPackage.php diff --git a/Asset/PackPackage.php b/Asset/PackPackage.php deleted file mode 100644 index 64b345c..0000000 --- a/Asset/PackPackage.php +++ /dev/null @@ -1,56 +0,0 @@ -basePath = '/'; - } else { - if ('/' != $basePath[0]) { - $basePath = '/'.$basePath; - } - - $this->basePath = rtrim($basePath, '/').'/'; - } - } - - /** - * @todo Try retrive public dir from the member function BundleNameBundle::getPublicDir() return value ? - * @xxx see https://symfony.com/doc/current/bundles.html#overridding-the-bundle-directory-structure - * {@inheritdoc} - */ - public function getUrl($path) { - //Match url starting with a bundle name - if (preg_match('%^@([A-Z][a-zA-Z]*?)(?:Bundle/Resources/public)?/(.*)$%', $path, $matches)) { - //Handle empty or without replacement pattern basePath - if (empty($this->basePath) || strpos($this->basePath, '%s') === false) { - //Set path from hardcoded format - $path = '/bundles/'.strtolower($matches[1]).'/'.$matches[2]; - //Proceed with basePath pattern replacement - } else { - //Set path from basePath pattern - //XXX: basePath has a trailing / added by constructor - $path = sprintf($this->basePath, strtolower($matches[1])).$matches[2]; - } - } - - //Return parent getUrl result - return parent::getUrl($path); - } -} -- 2.41.1