Registry object that contains information about the current context.
More...
|
| register ($name, &$ref) |
| Registers a variable into the context. More...
|
|
& | get ($name, $ignore_error=false) |
| Retrieves a variable reference from the context. More...
|
|
| destroy ($name) |
| Destroys a variable in the context. More...
|
|
| exists ($name) |
| Checks whether or not the variable exists. More...
|
|
| loadArray ($context_array) |
| Loads a series of variables from an associative array. More...
|
|
Registry object that contains information about the current context.
- Warning
- Is a bit buggy when variables are set to null: it thinks they don't exist! So use false instead, please.
- Note
- Since the variables Context deals with may not be objects, references are very important here! Do not remove!
Definition at line 10 of file Context.php.
◆ destroy()
HTMLPurifier_Context::destroy |
( |
|
$name | ) |
|
Destroys a variable in the context.
- Parameters
-
Definition at line 61 of file Context.php.
63 if (!array_key_exists($name, $this->_storage)) {
65 "Attempted to destroy non-existent variable $name",
70 unset($this->_storage[$name]);
◆ exists()
HTMLPurifier_Context::exists |
( |
|
$name | ) |
|
Checks whether or not the variable exists.
- Parameters
-
- Returns
- bool
Definition at line 78 of file Context.php.
80 return array_key_exists($name, $this->_storage);
◆ get()
& HTMLPurifier_Context::get |
( |
|
$name, |
|
|
|
$ignore_error = false |
|
) |
| |
Retrieves a variable reference from the context.
- Parameters
-
string | $name | String name |
bool | $ignore_error | Boolean whether or not to ignore error |
- Returns
- mixed
Definition at line 42 of file Context.php.
44 if (!array_key_exists($name, $this->_storage)) {
47 "Attempted to retrieve non-existent variable $name",
54 return $this->_storage[$name];
◆ loadArray()
HTMLPurifier_Context::loadArray |
( |
|
$context_array | ) |
|
Loads a series of variables from an associative array.
- Parameters
-
array | $context_array | Assoc array of variables to load |
Definition at line 87 of file Context.php.
89 foreach ($context_array as $key => $discard) {
90 $this->
register($key, $context_array[$key]);
◆ register()
HTMLPurifier_Context::register |
( |
|
$name, |
|
|
& |
$ref |
|
) |
| |
Registers a variable into the context.
- Parameters
-
string | $name | String name |
mixed | $ref | Reference to variable to be registered |
Definition at line 24 of file Context.php.
26 if (array_key_exists($name, $this->_storage)) {
28 "Name $name produces collision, cannot re-register",
33 $this->_storage[$name] =& $ref;
◆ $_storage
HTMLPurifier_Context::$_storage = array() |
|
private |
Private array that stores the references.
array
Definition at line 17 of file Context.php.
The documentation for this class was generated from the following file:
- libs/composer/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Context.php