summaryrefslogtreecommitdiff
path: root/app/php/web/AssetManager.php
blob: 72d8ef122da8ebb5f8574c08d4a9286c9e529823 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php

class AssetManager extends TAssetManager {

    public function init($config) {
        if ($this->BaseUrl === NULL && $this->BasePath !== 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);
    }

}

?>