PHP Класс Habari\Site

Contains functions for getting details about the site directories and URLs.
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$config_dir
$config_path
$config_type
$config_urldir
$habari_url
$scriptname

Открытые методы

Метод Описание
get_dir ( string $name, boolean | string $trail = false ) : string get_dir returns a complete filesystem path to the requested item 'config_file' returns the complete path to the config.php file, including the filename 'config' returns the path of the directory containing config.php 'user' returns the path of the user directory 'theme' returns the path of the site's active theme 'admin_theme' returns the path to the admin directory 'vendor' returns the path to the vendor directory
get_path ( string $name, boolean | string $trail = false ) : mixed get_path returns a relative URL path, without leading protocol or host 'base' returns the URL sub-directory in which Habari is installed, if any.
get_url ( string $name, boolean | string $trail = false ) : string get_url returns a fully-qualified URL 'host' returns http://www.habariproject.org 'habari' returns http://www.habariproject.org/habari, if you have Habari installed into a /habari/ sub-directory 'site' returns http://www.habariproject.org/site if you are installing with a subdirectory path 'user' returns one of the following: http://www.habariproject.org/user http://www.habariproject.org/user/sites/x.y.z 'theme' returns one of the following: http://www.habariproject.org/user/themes/theme_name http://www.habariproject.org/user/sites/x.y.z/themes/theme_name 'admin' returns http://www.habariproject.org/admin 'admin_theme' returns http://www.habariproject.org/system/admin 'login' returns http://www.habariproject.org/auth/login 'logout' returns http://www.habariproject.org/auth/logout 'system' returns http://www.habariproject.org/system 'vendor' returns http://www.habariproject.org/system/vendor 'scripts' returns http://www.habariproject.org/system/vendor '3rdparty' returns http://www.habariproject.org/3rdparty if /3rdparty does not exists, /system/vendor will be returned 'hostname' returns www.habariproject.org
is ( string $what ) : boolean is() returns a boolean value for whether the current site is the primary site, or a multi-site, as determined by the location of the config.php that is in use for this request.
out_dir ( string $dir, boolean $trail = false ) our_dir echos our a filesystem directory
out_path ( string $path, boolean $trail = false ) out_path echos a URL path
out_url ( string $url, boolean | string $trail = false ) out_url echos out a URL
script_name ( ) script_name is a helper function to determine the name of the script not all PHP installations return the same values for $_SERVER['SCRIPT_URL'] and $_SERVER['SCRIPT_NAME']

Приватные методы

Метод Описание
__construct ( ) Constructor This class should not be instantiated

Описание методов

get_dir() публичный статический метод

get_dir returns a complete filesystem path to the requested item 'config_file' returns the complete path to the config.php file, including the filename 'config' returns the path of the directory containing config.php 'user' returns the path of the user directory 'theme' returns the path of the site's active theme 'admin_theme' returns the path to the admin directory 'vendor' returns the path to the vendor directory
public static get_dir ( string $name, boolean | string $trail = false ) : string
$name string the name of the path item to return
$trail boolean | string whether to include a trailing slash, or a string to use as the trailing value. Default: false
Результат string Path

get_path() публичный статический метод

'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
Результат mixed

get_url() публичный статический метод

get_url returns a fully-qualified URL 'host' returns http://www.habariproject.org 'habari' returns http://www.habariproject.org/habari, if you have Habari installed into a /habari/ sub-directory 'site' returns http://www.habariproject.org/site if you are installing with a subdirectory path 'user' returns one of the following: http://www.habariproject.org/user http://www.habariproject.org/user/sites/x.y.z 'theme' returns one of the following: http://www.habariproject.org/user/themes/theme_name http://www.habariproject.org/user/sites/x.y.z/themes/theme_name 'admin' returns http://www.habariproject.org/admin 'admin_theme' returns http://www.habariproject.org/system/admin 'login' returns http://www.habariproject.org/auth/login 'logout' returns http://www.habariproject.org/auth/logout 'system' returns http://www.habariproject.org/system 'vendor' returns http://www.habariproject.org/system/vendor 'scripts' returns http://www.habariproject.org/system/vendor '3rdparty' returns http://www.habariproject.org/3rdparty if /3rdparty does not exists, /system/vendor will be returned 'hostname' returns www.habariproject.org
public static get_url ( string $name, boolean | string $trail = false ) : string
$name string the name of the URL to return
$trail boolean | string whether to include a trailing slash, or a string to use as the trailing value. Default: false
Результат string URL

is() публичный статический метод

valid values are "main" and "primary" (synonymous) and "multi"
public static is ( string $what ) : boolean
$what string The name of the boolean to test
Результат boolean the result of the check

out_dir() публичный статический метод

our_dir echos our a filesystem directory
public static out_dir ( string $dir, boolean $trail = false )
$dir string the filesystem directory to display
$trail boolean whether or not to include a trailing slash, or a string to use as the trailing value. Default: false

out_path() публичный статический метод

out_path echos a URL path
public static out_path ( string $path, boolean $trail = false )
$path string the URL path to display
$trail boolean whether or not to include a trailing slash, or a string to use as the trailing value. Default: false

out_url() публичный статический метод

out_url echos out a URL
public static out_url ( string $url, boolean | string $trail = false )
$url string the URL to display
$trail boolean | string whether or not to include a trailing slash, or a string to use as the trailing value. Default: false

script_name() публичный статический метод

script_name is a helper function to determine the name of the script not all PHP installations return the same values for $_SERVER['SCRIPT_URL'] and $_SERVER['SCRIPT_NAME']
public static script_name ( )

Описание свойств

$config_dir статическое публичное свойство

static public $config_dir

$config_path статическое публичное свойство

static public $config_path

$config_type статическое публичное свойство

static public $config_type

$config_urldir статическое публичное свойство

static public $config_urldir

$habari_url статическое публичное свойство

static public $habari_url

$scriptname статическое публичное свойство

static public $scriptname