public function getBaseThemeUrl()
    {
        $themeUrl = $this->getConfig('theme_url');
        if ($themeUrl) {
            return $themeUrl;
        }

        if (isset($_SERVER['SCRIPT_FILENAME']) && ($_SERVER['SCRIPT_FILENAME'] !== 'index.php')) {
            $basePath = dirname($_SERVER['SCRIPT_FILENAME']);
            $basePath = !in_array($basePath, array('.', '/', '\\'), true) ? $basePath . '/' : '/';
            $basePathLength = strlen($basePath);

            if (substr($this->getThemesDir(), 0, $basePathLength) === $basePath) {
                $this->config['theme_url'] = $this->getBaseUrl() . substr($this->getThemesDir(), $basePathLength);
                return $this->config['theme_url'];
            }
        }

        $this->config['theme_url'] = $this->getBaseUrl() . basename($this->getThemesDir()) . '/';
        return $this->config['theme_url'];
    }