Static Public Member Functions | Public Attributes | Static Public Attributes

Site Class Reference

List of all members.

Static Public Member Functions

static script_name ()
static is ($what)
static get_url ($name, $trail=false)
static get_path ($name, $trail=false)
static get_dir ($name, $trail=false)
static out_url ($url, $trail=false)
static out_path ($path, $trail=false)
static out_dir ($dir, $trail=false)

Public Attributes

const CONFIG_LOCAL = 0
const CONFIG_SUBDIR = 1
const CONFIG_SUBDOMAIN = 2

Static Public Attributes

static $config_path
static $config_dir
static $config_type = Site::CONFIG_LOCAL
static $scriptname
static $habari_url
static $config_urldir

Detailed Description

Habari Site class

Contains functions for getting details about the site directories and URLs.

Definition at line 14 of file site.php.


Member Function Documentation

static Site::get_dir ( name,
trail = false 
) [static]

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

Parameters:
string $name the name of the path item to return
bool|string $trail whether to include a trailing slash, or a string to use as the trailing value. Default: false
Returns:
string Path

Definition at line 296 of file site.php.

Referenced by InstallHandler::act_begin_install(), Theme::dir_to_url(), Themes::get_all(), get_path(), get_url(), Autoload::habari_autoload(), Locale::list_all(), Plugins::list_all(), UserHandler::login_form(), out_dir(), and AdminHandler::setup_admin_theme().

static Site::get_path ( name,
trail = false 
) [static]

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. '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

Parameters:
string $name the name of the path to return
bool|string $trail whether to include a trailing slash, or a string to use as the trailing value. Default: false
Returns:
mixed

Definition at line 244 of file site.php.

Referenced by HabariSilo::action_init(), FeedbackHandler::add_comment(), InstallHandler::ajax_check_sqlite_credentials(), SQLiteConnection::connect(), get_url(), Session::init(), out_path(), Controller::parse_request(), and Pingback::xmlrpc_pingback__ping().

static Site::get_url ( name,
trail = false 
) [static]

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

Parameters:
string $name the name of the URL to return
bool|string $trail whether to include a trailing slash, or a string to use as the trailing value. Default: false
Returns:
string URL

Definition at line 132 of file site.php.

Referenced by InstallHandler::act_begin_install(), UserHandler::act_logout(), UserHandler::act_password_reset(), AtomHandler::act_rsd(), Menus::action_admin_header(), Charcoal::action_block_content_charcoal_menu(), Stack::action_register_stackitems(), AtomHandler::add_posts(), InstallHandler::check_htaccess(), Post::comment_form(), User::commenter(), AtomHandler::create_atom_wrapper(), Theme::dir_to_url(), User::forget(), URL::get(), FormUI::get(), Themes::get_all_data(), get_dir(), URL::get_from_filesystem(), UserHandler::login_form(), and out_url().

static Site::is ( what  )  [static]

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. valid values are "main" and "primary" (synonymous) and "multi" : if ( Site::is('main') ) if ( Site::is('multi') )

Parameters:
string $what The name of the boolean to test
Returns:
bool the result of the check

Definition at line 82 of file site.php.

Referenced by Themes::get_all(), and get_path().

static Site::out_dir ( dir,
trail = false 
) [static]

our_dir echos our a filesystem directory

Parameters:
string $dir the filesystem directory to display
bool $trail whether or not to include a trailing slash, or a string to use as the trailing value. Default: false

Definition at line 414 of file site.php.

static Site::out_path ( path,
trail = false 
) [static]

out_path echos a URL path

Parameters:
string $path the URL path to display
bool $trail whether or not to include a trailing slash, or a string to use as the trailing value. Default: false

Definition at line 404 of file site.php.

static Site::out_url ( url,
trail = false 
) [static]

out_url echos out a URL

Parameters:
string $url the URL to display
bool|string $trail whether or not to include a trailing slash, or a string to use as the trailing value. Default: false

Definition at line 394 of file site.php.

Referenced by HiEngineParser::hi_command().

static Site::script_name (  )  [static]

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']

Definition at line 53 of file site.php.

Referenced by get_path(), and get_url().


Member Data Documentation

Site::$config_path [static]

$config_path Filesystem path to config.php $config_dir Multisite directory to config.php $config_type Installation type (local, subdir, subdomain) $scriptname the name of the currently executing script (index.php) $habari_url fully-qualified URL to the habari directory

Definition at line 33 of file site.php.

const Site::CONFIG_LOCAL = 0

Constants CONFIG_LOCAL Local installation CONFIG_SUBDIR Subdirectory or multisite installation CONFIG_SUBDOMAIN Subdomain installation

Definition at line 22 of file site.php.

Referenced by is(), Locale::list_all(), and Plugins::list_all().


The documentation for this class was generated from the following file: