Go to the source code of this file.
Functions | |
cache_output ($category, $name, $out) | |
default_html ($add_glue) | |
drop_cache ($category, $name= '') | |
glue_version () | |
handle_updates () | |
hotglue_error ($code, $no_header=false) | |
is_auth () | |
is_cached ($category, $name, $max_age) | |
object_exists ($s) | |
page_canonical (&$s) | |
page_exists ($s) | |
page_reserved ($s) | |
page_short ($s) | |
prompt_auth ($header_only=false) | |
resolve_aliases ($s, $name= '') | |
resolve_relative_urls ($s) | |
serve_cached ($category, $name) | |
startpage () | |
upload_file ($fn, $page, $orig_fn= '', &$existed=false) | |
valid_pagename ($s) |
cache_output | ( | $ | category, | |
$ | name, | |||
$ | out | |||
) |
save a page in the cache
string | $category cache category (e.g. 'page') | |
string | $name item name | |
string | $out content |
Definition at line 25 of file common.inc.php.
default_html | ( | $ | add_glue | ) |
setup a default html page
see html.inc.php.
bool | $add_glue true for adding the glue code |
Definition at line 78 of file common.inc.php.
drop_cache | ( | $ | category, | |
$ | name = '' | |||
) |
remove a page from the cache
If no name is given, all pages of the category are being removed.
string | $category cache category (e.g. 'page') | |
string | $name item name (optional) |
Definition at line 126 of file common.inc.php.
glue_version | ( | ) |
return the glue version with api.version.patchlevel
Definition at line 154 of file common.inc.php.
handle_updates | ( | ) |
invoke a hook when an update was detected
Definition at line 168 of file common.inc.php.
hotglue_error | ( | $ | code, | |
$ | no_header = false | |||
) |
return a hotglue-themed error message to the client
the function does not return if successful.
int | $code error code | |
bool | $no_header don't output any header |
Definition at line 207 of file common.inc.php.
is_auth | ( | ) |
check if the user is authenticated or not
Definition at line 276 of file common.inc.php.
is_cached | ( | $ | category, | |
$ | name, | |||
$ | max_age | |||
) |
check if a page can be served from the cache
string | $category cache category (e.g. 'page') | |
string | $name item name | |
int | $max_age serve from cache when younger than $max_age seconds |
Definition at line 332 of file common.inc.php.
object_exists | ( | $ | s | ) |
check if an object exists
$s | object (e.g. page.rev.obj) |
Definition at line 365 of file common.inc.php.
page_canonical | ( | &$ | s | ) |
turn short page names into canonical ones
if $s is not a page, the string is not altered.
string | &$s reference to the page name |
Definition at line 384 of file common.inc.php.
page_exists | ( | $ | s | ) |
check if a page exists
this function can also be used with object names (e.g. page.rev.obj).
$s | page |
Definition at line 401 of file common.inc.php.
page_reserved | ( | $ | s | ) |
check if a page name is reserved
$s | page |
Definition at line 418 of file common.inc.php.
page_short | ( | $ | s | ) |
return the short pagename if possible, otherwise the long one
$s | page |
Definition at line 436 of file common.inc.php.
prompt_auth | ( | $ | header_only = false |
) |
prompt user for authentication
bool | $header_only only send header information this function does not return. |
Definition at line 457 of file common.inc.php.
resolve_aliases | ( | $ | s, | |
$ | name = '' | |||
) |
resolve common aliases which should be used in lieu of explicit page names
string | $s input string | |
string | $name current object name (when applicable) |
Definition at line 480 of file common.inc.php.
resolve_relative_urls | ( | $ | s | ) |
resolve relative urls in various page content to include the pages base url
this function looks for href and src attributes.
string | $s input string |
Definition at line 517 of file common.inc.php.
serve_cached | ( | $ | category, | |
$ | name | |||
) |
output a cached page to the client
string | $category cache category (e.g. 'page') | |
string | $name item name |
Definition at line 554 of file common.inc.php.
startpage | ( | ) |
upload_file | ( | $ | fn, | |
$ | page, | |||
$ | orig_fn = '' , |
|||
&$ | existed = false | |||
) |
move an uploaded file to the shared directory of a page
this function reuses existing files when possible.
string | $fn filename of newly uploaded file (most likely in /tmp) | |
string | $page page or pagename | |
string | $orig_fn the original filename on the client machine (optional) | |
bool | &$existed set to true if the filename returned did already exist before |
Definition at line 598 of file common.inc.php.
valid_pagename | ( | $ | s | ) |
check whether the string is a valid, canonical page name
the function does not check if the page exists or not.
string | $s string to check |
Definition at line 657 of file common.inc.php.