__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
<?php
/**
* Configuration definition, defines directives and their defaults.
*/
class HTMLPurifier_ConfigSchema
{
/**
* Defaults of the directives and namespaces.
* @type array
* @note This shares the exact same structure as HTMLPurifier_Config::$conf
*/
public $defaults = array();
/**
* The default property list. Do not edit this property list.
* @type array
*/
public $defaultPlist;
/**
* Definition of the directives.
* The structure of this is:
*
* array(
* 'Namespace' => array(
* 'Directive' => new stdClass(),
* )
* )
*
* The stdClass may have the following properties:
*
* - If isAlias isn't set:
* - type: Integer type of directive, see HTMLPurifier_VarParser for definitions
* - allow_null: If set, this directive allows null values
* - aliases: If set, an associative array of value aliases to real values
* - allowed: If set, a lookup array of allowed (string) values
* - If isAlias is set:
* - namespace: Namespace this directive aliases to
* - name: Directive name this directive aliases to
*
* In certain degenerate cases, stdClass will actually be an integer. In
* that case, the value is equivalent to an stdClass with the type
* property set to the integer. If the integer is negative, type is
* equal to the absolute value of integer, and allow_null is true.
*
* This class is friendly with HTMLPurifier_Config. If you need introspection
* about the schema, you're better of using the ConfigSchema_Interchange,
* which uses more memory but has much richer information.
* @type array
*/
public $info = array();
/**
* Application-wide singleton
* @type HTMLPurifier_ConfigSchema
*/
protected static $singleton;
public function __construct()
{
$this->defaultPlist = new HTMLPurifier_PropertyList();
}
/**
* Unserializes the default ConfigSchema.
* @return HTMLPurifier_ConfigSchema
*/
public static function makeFromSerial()
{
$contents = file_get_contents(HTMLPURIFIER_PREFIX . '/HTMLPurifier/ConfigSchema/schema.ser');
$r = unserialize($contents);
if (!$r) {
$hash = sha1($contents);
trigger_error("Unserialization of configuration schema failed, sha1 of file was $hash", E_USER_ERROR);
}
return $r;
}
/**
* Retrieves an instance of the application-wide configuration definition.
* @param HTMLPurifier_ConfigSchema $prototype
* @return HTMLPurifier_ConfigSchema
*/
public static function instance($prototype = null)
{
if ($prototype !== null) {
HTMLPurifier_ConfigSchema::$singleton = $prototype;
} elseif (HTMLPurifier_ConfigSchema::$singleton === null || $prototype === true) {
HTMLPurifier_ConfigSchema::$singleton = HTMLPurifier_ConfigSchema::makeFromSerial();
}
return HTMLPurifier_ConfigSchema::$singleton;
}
/**
* Defines a directive for configuration
* @warning Will fail of directive's namespace is defined.
* @warning This method's signature is slightly different from the legacy
* define() static method! Beware!
* @param string $key Name of directive
* @param mixed $default Default value of directive
* @param string $type Allowed type of the directive. See
* HTMLPurifier_VarParser::$types for allowed values
* @param bool $allow_null Whether or not to allow null values
*/
public function add($key, $default, $type, $allow_null)
{
$obj = new stdClass();
$obj->type = is_int($type) ? $type : HTMLPurifier_VarParser::$types[$type];
if ($allow_null) {
$obj->allow_null = true;
}
$this->info[$key] = $obj;
$this->defaults[$key] = $default;
$this->defaultPlist->set($key, $default);
}
/**
* Defines a directive value alias.
*
* Directive value aliases are convenient for developers because it lets
* them set a directive to several values and get the same result.
* @param string $key Name of Directive
* @param array $aliases Hash of aliased values to the real alias
*/
public function addValueAliases($key, $aliases)
{
if (!isset($this->info[$key]->aliases)) {
$this->info[$key]->aliases = array();
}
foreach ($aliases as $alias => $real) {
$this->info[$key]->aliases[$alias] = $real;
}
}
/**
* Defines a set of allowed values for a directive.
* @warning This is slightly different from the corresponding static
* method definition.
* @param string $key Name of directive
* @param array $allowed Lookup array of allowed values
*/
public function addAllowedValues($key, $allowed)
{
$this->info[$key]->allowed = $allowed;
}
/**
* Defines a directive alias for backwards compatibility
* @param string $key Directive that will be aliased
* @param string $new_key Directive that the alias will be to
*/
public function addAlias($key, $new_key)
{
$obj = new stdClass;
$obj->key = $new_key;
$obj->isAlias = true;
$this->info[$key] = $obj;
}
/**
* Replaces any stdClass that only has the type property with type integer.
*/
public function postProcess()
{
foreach ($this->info as $key => $v) {
if (count((array) $v) == 1) {
$this->info[$key] = $v->type;
} elseif (count((array) $v) == 2 && isset($v->allow_null)) {
$this->info[$key] = -$v->type;
}
}
}
}
// vim: et sw=4 sts=4
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| AttrDef | Folder | 0777 |
|
|
| AttrTransform | Folder | 0777 |
|
|
| ChildDef | Folder | 0777 |
|
|
| ConfigSchema | Folder | 0777 |
|
|
| DefinitionCache | Folder | 0777 |
|
|
| EntityLookup | Folder | 0777 |
|
|
| Filter | Folder | 0777 |
|
|
| HTMLModule | Folder | 0777 |
|
|
| Injector | Folder | 0777 |
|
|
| Language | Folder | 0777 |
|
|
| Lexer | Folder | 0777 |
|
|
| Node | Folder | 0777 |
|
|
| Printer | Folder | 0777 |
|
|
| Strategy | Folder | 0777 |
|
|
| TagTransform | Folder | 0777 |
|
|
| Token | Folder | 0777 |
|
|
| URIFilter | Folder | 0777 |
|
|
| URIScheme | Folder | 0777 |
|
|
| VarParser | Folder | 0777 |
|
|
| Arborize.php | File | 2.49 KB | 0777 |
|
| AttrCollections.php | File | 4.75 KB | 0777 |
|
| AttrDef.php | File | 5.07 KB | 0777 |
|
| AttrTransform.php | File | 1.94 KB | 0777 |
|
| AttrTypes.php | File | 3.67 KB | 0777 |
|
| AttrValidator.php | File | 6.42 KB | 0777 |
|
| Bootstrap.php | File | 2.64 KB | 0777 |
|
| CSSDefinition.php | File | 19.59 KB | 0777 |
|
| ChildDef.php | File | 1.52 KB | 0777 |
|
| Config.php | File | 30.96 KB | 0777 |
|
| ConfigSchema.php | File | 5.76 KB | 0777 |
|
| ContentSets.php | File | 5.51 KB | 0777 |
|
| Context.php | File | 2.57 KB | 0777 |
|
| Definition.php | File | 1.33 KB | 0777 |
|
| DefinitionCache.php | File | 3.82 KB | 0777 |
|
| DefinitionCacheFactory.php | File | 3.12 KB | 0777 |
|
| Doctype.php | File | 1.54 KB | 0777 |
|
| DoctypeRegistry.php | File | 4.13 KB | 0777 |
|
| ElementDef.php | File | 7.35 KB | 0777 |
|
| Encoder.php | File | 25.19 KB | 0777 |
|
| EntityLookup.php | File | 1.39 KB | 0777 |
|
| EntityParser.php | File | 9.75 KB | 0777 |
|
| ErrorCollector.php | File | 7.45 KB | 0777 |
|
| ErrorStruct.php | File | 1.85 KB | 0777 |
|
| Exception.php | File | 177 B | 0777 |
|
| Filter.php | File | 1.59 KB | 0777 |
|
| Generator.php | File | 10.01 KB | 0777 |
|
| HTMLDefinition.php | File | 17.33 KB | 0777 |
|
| HTMLModule.php | File | 9.96 KB | 0777 |
|
| HTMLModuleManager.php | File | 15.57 KB | 0777 |
|
| IDAccumulator.php | File | 1.61 KB | 0777 |
|
| Injector.php | File | 8.79 KB | 0777 |
|
| Language.php | File | 5.92 KB | 0777 |
|
| LanguageFactory.php | File | 6.46 KB | 0777 |
|
| Length.php | File | 3.8 KB | 0777 |
|
| Lexer.php | File | 13.21 KB | 0777 |
|
| Node.php | File | 1.25 KB | 0777 |
|
| PercentEncoder.php | File | 3.48 KB | 0777 |
|
| Printer.php | File | 5.76 KB | 0777 |
|
| PropertyList.php | File | 2.72 KB | 0777 |
|
| PropertyListIterator.php | File | 894 B | 0777 |
|
| Queue.php | File | 1.51 KB | 0777 |
|
| Strategy.php | File | 762 B | 0777 |
|
| StringHash.php | File | 1.07 KB | 0777 |
|
| StringHashParser.php | File | 3.56 KB | 0777 |
|
| TagTransform.php | File | 1.07 KB | 0777 |
|
| Token.php | File | 2.17 KB | 0777 |
|
| TokenFactory.php | File | 3.03 KB | 0777 |
|
| URI.php | File | 10.35 KB | 0777 |
|
| URIDefinition.php | File | 3.35 KB | 0777 |
|
| URIFilter.php | File | 2.31 KB | 0777 |
|
| URIParser.php | File | 2.24 KB | 0777 |
|
| URIScheme.php | File | 3.4 KB | 0777 |
|
| URISchemeRegistry.php | File | 2.35 KB | 0777 |
|
| UnitConverter.php | File | 9.91 KB | 0777 |
|
| VarParser.php | File | 5.85 KB | 0777 |
|
| VarParserException.php | File | 157 B | 0777 |
|
| Zipper.php | File | 4.34 KB | 0777 |
|