lib/Pico.php
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'];
    }
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'];
    }
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' ] ; }
Returns the URL of the themes folder of this Pico instance

We assume that the themes folder is a arbitrary deep sub folder of the
script's base path (i.e. the directory {@path "index.php"} is in resp.
the `httpdocs` directory). Usually the script's base path is identical
to {@see Pico::$rootDir}, but this may aberrate when Pico got installed
as a composer dependency. However, ultimately it allows us to use
{@see Pico::getBaseUrl()} as origin of the theme URL. Otherwise Pico
falls back to the basename of {@see Pico::$themesDir} (i.e. assuming
that `Pico::$themesDir` is `foo/bar/baz`, the base URL of the themes
folder will be `baz/`; this ensures BC to Pico < 2.0). Pico's base URL
always gets prepended appropriately.

@return string the URL of the themes folder
Returns the URL of the themes folder of this Pico instance