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 |
Contains functions for getting details about the site directories and URLs.
Definition at line 13 of file site.php.
| 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
| string | the name of the path item to return | |
| bool | whether to include a trailing slash. Default: No |
Definition at line 287 of file site.php.
Referenced by InstallHandler::act_begin_install(), Charcoal::add_template_vars(), AdminCommentsHandler::ajax_comments(), AdminDashboardHandler::ajax_dashboard(), AdminGroupsHandler::ajax_groups(), AdminPostsHandler::ajax_posts(), AdminTagsHandler::ajax_tags(), Themes::get_all(), get_path(), FormContainer::get_theme(), get_url(), HabariLocale::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. '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
| string | the name of the path to return | |
| bool | whether to include a trailing slash. Default: No |
Definition at line 240 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(), URL::parse(), 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 'system' returns http://www.habariproject.org/system 'scripts' returns http://www.habariproject.org/scripts '3rdparty' returns http://www.habariproject.org/3rdparty 'hostname' returns www.habariproject.org
| string | the name of the URL to return | |
| bool | whether to include a trailing slash. Default: No |
Definition at line 127 of file site.php.
Referenced by InstallHandler::act_begin_install(), UserHandler::act_login(), UserHandler::act_logout(), UserHandler::act_password_reset(), AtomHandler::act_rsd(), Charcoal::action_block_content_charcoal_menu(), K2::action_block_content_k2_menu(), AtomHandler::add_posts(), K2::add_template_vars(), InstallHandler::check_htaccess(), Post::comment_form(), User::commenter(), AtomHandler::create_atom_wrapper(), User::forget(), URL::get(), FormUI::get(), Themes::get_all_data(), get_dir(), URL::get_from_filesystem(), get_path(), out_url(), AdminHandler::setup_admin_theme(), and AdminHandler::setup_stacks().
| 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') )
| string | The name of the boolean to test |
Definition at line 81 of file site.php.
Referenced by Themes::get_all(), and get_path().
| static Site::out_dir | ( | $ | dir, | |
| $ | trail = false | |||
| ) | [static] |
| static Site::out_path | ( | $ | path, | |
| $ | trail = false | |||
| ) | [static] |
| static Site::out_url | ( | $ | url, | |
| $ | trail = false | |||
| ) | [static] |
out_url echos out a URL
| string | the URL to display | |
| bool | whether or not to include a trailing slash. Default: No |
Definition at line 377 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 52 of file site.php.
Referenced by get_path(), and get_url().
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
| const Site::CONFIG_LOCAL = 0 |
Constants CONFIG_LOCAL Local installation CONFIG_SUBDIR Subdirectory or multisite installation CONFIG_SUBDOMAIN Subdomain installation
Definition at line 21 of file site.php.
Referenced by is(), HabariLocale::list_all(), and Plugins::list_all().
1.7.1