/var-www-hotglue/hotglue.org-test/dev/common.inc.php File Reference

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)

Function Documentation

cache_output ( category,
name,
out 
)

save a page in the cache

Parameters:
string $category cache category (e.g. 'page')
string $name item name
string $out content
Returns:
true if successful, false if not

Definition at line 25 of file common.inc.php.

default_html ( add_glue  ) 

setup a default html page

see html.inc.php.

Parameters:
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.

Parameters:
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

Returns:
array (with length three)

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.

Parameters:
int $code error code
bool $no_header don't output any header
Returns:
false if the error code is not supported yet

Definition at line 207 of file common.inc.php.

is_auth (  ) 

check if the user is authenticated or not

Returns:
true if authenticated, false if 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

Parameters:
string $category cache category (e.g. 'page')
string $name item name
int $max_age serve from cache when younger than $max_age seconds
Returns:
bool true if the page can be served from cache, false if not

Definition at line 332 of file common.inc.php.

object_exists ( s  ) 

check if an object exists

Parameters:
$s object (e.g. page.rev.obj)
Returns:
bool

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.

Parameters:
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).

Parameters:
$s page
Returns:
bool

Definition at line 401 of file common.inc.php.

page_reserved ( s  ) 

check if a page name is reserved

Parameters:
$s page
Returns:
bool

Definition at line 418 of file common.inc.php.

page_short ( s  ) 

return the short pagename if possible, otherwise the long one

Parameters:
$s page
Returns:
string

Definition at line 436 of file common.inc.php.

prompt_auth ( header_only = false  ) 

prompt user for authentication

Parameters:
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

Parameters:
string $s input string
string $name current object name (when applicable)
Returns:
string resolved string

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.

Parameters:
string $s input string
Returns:
string resolved string

Definition at line 517 of file common.inc.php.

serve_cached ( category,
name 
)

output a cached page to the client

Parameters:
string $category cache category (e.g. 'page')
string $name item name
Returns:
true if successful, false if not

Definition at line 554 of file common.inc.php.

startpage (  ) 

return the starting page

Returns:
string

Definition at line 572 of file common.inc.php.

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.

Parameters:
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
Returns:
filename inside the shared directory or false in case of error

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.

Parameters:
string $s string to check
Returns:
bool

Definition at line 657 of file common.inc.php.

Generated on Wed Jul 11 19:43:16 2012 for hotglue by  doxygen 1.6.3