From abd4940ea913e9dddc8d143d00fe1003c7bc9b6b Mon Sep 17 00:00:00 2001 From: emkael Date: Tue, 19 Apr 2016 16:08:36 +0200 Subject: * asset manager that derives default asset url from asset base path --- app/php/application.xml | 1 + app/php/caches.xml | 3 --- app/php/components/AssetManager.php | 29 +++++++++++++++++++++++++++++ app/php/components/config.xml | 7 +++++++ 4 files changed, 37 insertions(+), 3 deletions(-) create mode 100644 app/php/components/AssetManager.php create mode 100644 app/php/components/config.xml diff --git a/app/php/application.xml b/app/php/application.xml index ed9ce70..591ee66 100644 --- a/app/php/application.xml +++ b/app/php/application.xml @@ -12,6 +12,7 @@ + diff --git a/app/php/caches.xml b/app/php/caches.xml index 90e3e35..8a88717 100644 --- a/app/php/caches.xml +++ b/app/php/caches.xml @@ -2,8 +2,5 @@ - diff --git a/app/php/components/AssetManager.php b/app/php/components/AssetManager.php new file mode 100644 index 0000000..1094917 --- /dev/null +++ b/app/php/components/AssetManager.php @@ -0,0 +1,29 @@ +BaseUrl === NULL) { + $appWebPath = preg_replace( + '#' . $this->Application->Request->ApplicationUrl . '$#', + '', + $this->Application->Request->ApplicationFilePath + ); + $appBaseUrl = preg_replace( + '#^' . $appWebPath . '#', + '', + dirname($this->Application->Request->ApplicationFilePath) + ); + $this->BaseUrl = $appBaseUrl + . preg_replace( + '#^' . Prado::getPathOfNamespace('Web') . '#', + '', + $this->BasePath + ); + } + parent::init($config); + } + +} + +?> diff --git a/app/php/components/config.xml b/app/php/components/config.xml new file mode 100644 index 0000000..0c28e23 --- /dev/null +++ b/app/php/components/config.xml @@ -0,0 +1,7 @@ + + + + + + -- cgit v1.2.3