Habari\Site::get_path PHP Method

get_path() public static method

'habari' returns the path of Habari 'user' returns one of the following: user user/sites/x.y.z 'theme' returns one of the following: user/themes/theme_name user/sites/x.y.z/themes/theme_dir
public static get_path ( string $name, boolean | string $trail = false ) : mixed
$name string the name of the path to return
$trail boolean | string whether to include a trailing slash, or a string to use as the trailing value. Default: false
return mixed
    public static function get_path($name, $trail = false)
    {
        $path = '';
        switch (strtolower($name)) {
            case 'base':
            case 'habari':
                $path = rtrim(dirname(Site::script_name()), '/\\');
                if (self::$config_urldir != '') {
                    $path .= '/' . self::$config_urldir;
                }
                break;
            case 'user':
                if (Site::is('main')) {
                    $path = 'user';
                } else {
                    $path = ltrim(str_replace(HABARI_PATH, '', Site::get_dir('config')), '/');
                }
                break;
            case 'theme':
                $theme = Themes::get_theme_dir();
                if (file_exists(Site::get_dir('config') . '/themes/' . $theme)) {
                    $path = Site::get_path('user') . '/themes/' . $theme;
                } elseif (file_exists(HABARI_PATH . '/3rdparty/themes/' . $theme)) {
                    $path = Site::get_path('habari') . '/3rdparty/themes/' . $theme;
                } else {
                    $path = Site::get_path('base') . '/user/themes/' . $theme;
                }
                break;
        }
        $path .= Utils::trail($trail);
        // if running Habari in docroot, get_url('base') will return
        // a double slash.  Let's fix that.
        $path = str_replace('//', '/', $path);
        $path = Plugins::filter('site_path_' . $name, $path);
        return $path;
    }