Constructor of tempcode
ocp_tempcode
ocp_tempcode
([?array $details = NULL])
-
?array
$details: Pair: Code to preexecute, Initialisation seq-parts (NULL: start as empty)
Attach the specified tempcode to the right of the current tempcode object.
void
attach
(mixed $attach, [boolean $avoid_child_merge = false])
-
mixed
$attach: The tempcode/string to attach
-
boolean
$avoid_child_merge: If we've already merged the children from what we're attaching into the child tree (at bind stage)
Bind the parameter bits, or recursively bind children (doesn't change self, returns a bound tempcode object)
tempcode
bind
(array &$parameters, ID_TEXT $codename)
-
array
&$parameters: Map of parameters to bind parameter bits to
-
ID_TEXT
$codename: The codename of the template this tempcode is from
Decache the object.
void
decache
()
Parses the current tempcode object, then return the parsed string
string
evaluate
([?LANGUAGE_NAME $current_lang = NULL], [mixed $_escape = false], [?integer $up_to = NULL])
-
?LANGUAGE_NAME
$current_lang: The language to evaluate with (NULL: current user's language)
-
mixed
$_escape: Whether to escape the tempcode object (children may be recursively escaped regardless if those children/parents are marked to be)
-
?integer
$up_to: Evaluate at least this much (NULL: evaluate all)
Parse the current tempcode object, then echo it to the browser.
string
evaluate_echo
([?LANGUAGE_NAME $current_lang = NULL], [mixed $_escape = false])
-
?LANGUAGE_NAME
$current_lang: The language to evaluate with (NULL: current users language)
-
mixed
$_escape: Whether to escape the tempcode object (children may be recursively escaped regardless if those children/parents are marked to be)
The opposite of to_assembly - it decodes a tempcode storage representation and turns it into a proper tempcode object.
void
from_assembly
(string &$raw_data)
-
string
&$raw_data: The assembled tempcode
The opposite of to_assembly - it decodes a tempcode storage representation and turns it into a proper tempcode object. This version handles the result of evaled code.
boolean
from_assembly_executed
(PATH $file, array $forced_reload_details)
-
PATH
$file: The file to load
-
array
$forced_reload_details: List of parameters for a forced reload if required
Scan this Tempcode for anything that needs to be symbol-preprocessed
void
handle_symbol_preprocessing
()
Find whether the current tempcode object is definitely blank, by doing a very quick check.
boolean
is_definitely_empty
()
Find whether the current tempcode object is blank or not.
boolean
is_empty
()
Tests to see if something would evaluate to blank or not
boolean
is_really_empty
()
Find whether a variable within this Tempcode is parameterless.
boolean
parameterless
(integer $at)
-
integer
$at: Offset to the variable
Parse a single symbol from an input stream and append it.
void
parse_from
(string &$code, integer &$pos, integer &$len)
-
string
&$code: Code string (input stream)
-
integer
&$pos: Start position of input string
-
integer
&$len: End position of input string
Replace the named parameter with a specific value. Hardly used, but still important.
void
singular_bind
(string $parameter, tempcode $value)
-
string
$parameter: Named parameter
-
tempcode
$value: Specific value
Assemble the current tempcode object into a single serialised (compiled) tempcode storage representation (parameters and certain symbols and not evaluated). The output of the function is language-tied.
string
to_assembly
()
Recursively mark all parameters in this Tempcode as escaped. This is needed when loading from cache, as escape tainting data would have been lost.
void
_mark_all_as_escaped
()
PHP magic function to handle serialisation.
array
__sleep
()