PHP 클래스 Habari\Site

Contains functions for getting details about the site directories and URLs.
파일 보기 프로젝트 열기: habari/system 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$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