block_installed (line 838)
Check to see if a block is installed.
boolean
block_installed
(ID_TEXT $block)
-
ID_TEXT
$block: The module name
cache_module_installed_status (line 463)
Look up and remember what modules are installed.
void
cache_module_installed_status
()
do_block (line 577)
Get the processed tempcode for the specified block. Please note that you pass multiple parameters in as an array, but single parameters go in as a string or other flat variable.
tempcode
do_block
(ID_TEXT $codename, [?array $map = NULL], [?integer $ttl = NULL])
-
ID_TEXT
$codename: The block name
-
?array
$map: The block parameter map (NULL: no parameters)
-
?integer
$ttl: The TTL to use (NULL: block default)
do_block_get_cache_identifier (line 787)
Takes a string which is a PHP expression over $map (parameter map), and returns a derived identifier.
We see if we have something cached by looking for a matching identifier.
?LONG_TEXT
do_block_get_cache_identifier
(mixed $cache_on, ?array $map)
-
mixed
$cache_on: PHP expression over $map (the parameter map of the block) OR a call_user_func specifier that will return a result (which will be used if cacheing is really very important, even for Hip Hop PHP)
-
?array
$map: The block parameter map (NULL: no parameters)
do_block_hunt_file (line 719)
Get the block object for a given block codename.
mixed
do_block_hunt_file
(ID_TEXT $codename, [?array $map = NULL])
-
ID_TEXT
$codename: The block name
-
?array
$map: The block parameter map (NULL: no parameters)
extract_module_functions (line 900)
Extract code to execute the requested functions with the requested parameters from the module at the given path.
We used to actually load up the module, but it ate all our RAM when we did!
array
extract_module_functions
(PATH $path, array $functions, [?array $params = NULL])
-
PATH
$path: The path to the module
-
array
$functions: Array of functions to be executing
-
?array
$params: A list of parameters to pass to our functions (NULL: none)
find_all_hooks (line 514)
Get an array of all the hook implementations for a hook class.
array
find_all_hooks
(ID_TEXT $type, ID_TEXT $entry)
-
ID_TEXT
$type: The type of hook
-
ID_TEXT
$entry: The hook class to find hook implementations for (e.g. the name of a module)
find_all_modules (line 885)
Get an array of all the modules.
array
find_all_modules
(ID_TEXT $zone)
-
ID_TEXT
$zone: The zone name
find_all_pages (line 873)
Get an array of all the pages of the specified type (module, etc) and extension (for small sites everything will be returned, for larger ones it depends on the show method).
array
find_all_pages
(ID_TEXT $zone, ID_TEXT $type, [string $ext = 'php'], [boolean $keep_ext_on = false], [?TIME $cutoff_time = NULL], [integer $show_method = 0])
-
ID_TEXT
$zone: The zone name
-
ID_TEXT
$type: The type
-
string
$ext: The file extension to limit us to (without a dot)
-
boolean
$keep_ext_on: Whether to leave file extensions on the page name
-
?TIME
$cutoff_time: Only show pages newer than (NULL: no restriction)
-
integer
$show_method: Selection algorithm constant
find_all_pages_wrap (line 854)
Get an array of all the pages everywhere in the zone, limited by the selection algorithm (for small sites everything will be returned, for larger ones it depends on the show method).
array
find_all_pages_wrap
(ID_TEXT $zone, [boolean $keep_ext_on = false], [boolean $consider_redirects = false], [integer $show_method = 0])
-
ID_TEXT
$zone: The zone name
-
boolean
$keep_ext_on: Whether to leave file extensions on the page name
-
boolean
$consider_redirects: Whether to take redirects into account
-
integer
$show_method: Selection algorithm constant
find_all_zones (line 394)
Find the installed zones, up to the first 50 installed
array
find_all_zones
([boolean $search = false], [boolean $get_titles = false], [boolean $force_all = false])
-
boolean
$search: Whether to search the file system and return zones that might not be fully in the system (otherwise will just use the database)
-
boolean
$get_titles: Whether to get titles for the zones as well. Only if !$search
-
boolean
$force_all: Whether to insist on getting all zones (there could be thousands in theory...)
get_comcode_zone (line 258)
Find the zone a comcode page is in.
?ID_TEXT
get_comcode_zone
(ID_TEXT $page_name, [boolean $error = true])
-
ID_TEXT
$page_name: The comcode page name to find
-
boolean
$error: Whether ocPortal should bomb out if the page was not found
get_module_zone (line 174)
Find the zone a page is in.
?ID_TEXT
get_module_zone
(ID_TEXT $module_name, [ID_TEXT $type = 'modules'], [?string $dir2 = NULL], [string $ftype = 'php'], [boolean $error = true])
-
ID_TEXT
$module_name: The page name to find
-
ID_TEXT
$type: The type of the page we are looking for
-
?string
$dir2: The special subcategorisation of page we are looking for (e.g. 'EN' for a comcode page) (NULL: none)
-
string
$ftype: The file extension for the page type
-
boolean
$error: Whether ocPortal should bomb out if the page was not found
get_page_zone (line 277)
Find the zone a page is in.
?ID_TEXT
get_page_zone
(ID_TEXT $page_name, [boolean $error = true])
-
ID_TEXT
$page_name: The page name to find
-
boolean
$error: Whether ocPortal should bomb out if the page was not found
get_zone_name (line 140)
Get the name of the zone the current page request is coming from.
ID_TEXT
get_zone_name
()
init__zones (line 24)
Standard code module initialisation function.
void
init__zones
()
load_minimodule_page (line 302)
Runs the specified mini-module.
The module result is returned.
tempcode
load_minimodule_page
(PATH $string)
-
PATH
$string: The relative path to the module file
load_module_page (line 329)
Runs the specified module, but also update any stats for the module, and check to see if it needs upgrading or reinstalling.
The module result is returned.
tempcode
load_module_page
(PATH $string, ID_TEXT $codename)
-
PATH
$string: The relative path to the module file
-
ID_TEXT
$codename: The page name to load
module_installed (line 479)
Check to see if a module is installed.
boolean
module_installed
(ID_TEXT $module)
-
ID_TEXT
$module: The module name
zone_black_magic_filterer (line 98)
Consider virtual zone merging, where paths are not necessarily where you'd expect for pages in zones.
PATH
zone_black_magic_filterer
(PATH $path, [boolean $relative = false])
-
PATH
$path: The path, assuming in the obvious place.
-
boolean
$relative: Where the passed path is relative.
_get_block_path (line 822)
Gets the path to a block code file for a block code name
PATH
_get_block_path
(ID_TEXT $block)
-
ID_TEXT
$block: The name of the block
_get_module_path (line 496)
Get the path to a module known to be in a certain zone.
PATH
_get_module_path
(ID_TEXT $zone, ID_TEXT $module)
-
ID_TEXT
$zone: The zone name
-
ID_TEXT
$module: The module name