Bootstrap class that contains meta-functionality for HTML Purifier such as the autoload function.
More...
Bootstrap class that contains meta-functionality for HTML Purifier such as the autoload function.
- Note
- This class may be used without any other files from HTML Purifier.
Definition at line 30 of file Bootstrap.php.
◆ autoload()
static HTMLPurifier_Bootstrap::autoload |
( |
|
$class | ) |
|
|
static |
Autoload function for HTML Purifier.
- Parameters
-
string | $class | Class to load |
- Returns
- bool
Definition at line 38 of file Bootstrap.php.
References getPath().
Referenced by __autoload().
49 require_once HTMLPURIFIER_PREFIX .
'/' . $file;
static getPath($class)
Returns the path for a specific class.
◆ getPath()
static HTMLPurifier_Bootstrap::getPath |
( |
|
$class | ) |
|
|
static |
Returns the path for a specific class.
- Parameters
-
string | $class | Class path to get |
- Returns
- string
Definition at line 58 of file Bootstrap.php.
References $code.
Referenced by autoload().
60 if (strncmp(
'HTMLPurifier', $class, 12) !== 0) {
64 if (strncmp(
'HTMLPurifier_Language_', $class, 22) === 0) {
65 $code = str_replace(
'_',
'-', substr($class, 22));
66 $file =
'HTMLPurifier/Language/classes/' .
$code .
'.php';
68 $file = str_replace(
'_',
'/', $class) .
'.php';
70 if (!file_exists(HTMLPURIFIER_PREFIX .
'/' . $file)) {
◆ registerAutoload()
static HTMLPurifier_Bootstrap::registerAutoload |
( |
| ) |
|
|
static |
"Pre-registers" our autoloader on the SPL stack.
Definition at line 79 of file Bootstrap.php.
References $compat.
81 $autoload = array(
'HTMLPurifier_Bootstrap',
'autoload');
82 if (($funcs = spl_autoload_functions()) ===
false) {
83 spl_autoload_register($autoload);
84 } elseif (function_exists(
'spl_autoload_unregister')) {
85 if (version_compare(PHP_VERSION,
'5.3.0',
'>=')) {
87 spl_autoload_register($autoload,
true,
true);
89 $buggy = version_compare(PHP_VERSION,
'5.2.11',
'<');
90 $compat = version_compare(PHP_VERSION,
'5.1.2',
'<=') &&
91 version_compare(PHP_VERSION,
'5.1.0',
'>=');
92 foreach ($funcs as $func) {
93 if ($buggy && is_array($func)) {
97 if (!$reflector->isStatic()) {
99 'HTML Purifier autoloader registrar is not compatible 100 with non-static object methods due to PHP Bug #44144; 101 Please do not use HTMLPurifier.autoload.php (or any 102 file that includes this file); instead, place the code: 103 spl_autoload_register(array(\'HTMLPurifier_Bootstrap\', \'autoload\')) 104 after your own autoloaders.' 110 $func = implode(
'::', $func);
113 spl_autoload_unregister($func);
115 spl_autoload_register($autoload);
116 foreach ($funcs as $func) {
117 spl_autoload_register($func);
The documentation for this class was generated from the following file:
- libs/composer/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Bootstrap.php