summaryrefslogtreecommitdiff
path: root/app/php/web/AssetManager.php
blob: 10949173debec8aca19a3b147185461acb54cce5 (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) {
            $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);
    }

}

?>