__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
<?php
/**
* Abstract class representing Definition cache managers that implements
* useful common methods and is a factory.
* @todo Create a separate maintenance file advanced users can use to
* cache their custom HTMLDefinition, which can be loaded
* via a configuration directive
* @todo Implement memcached
*/
abstract class HTMLPurifier_DefinitionCache
{
/**
* @type string
*/
public $type;
/**
* @param string $type Type of definition objects this instance of the
* cache will handle.
*/
public function __construct($type)
{
$this->type = $type;
}
/**
* Generates a unique identifier for a particular configuration
* @param HTMLPurifier_Config $config Instance of HTMLPurifier_Config
* @return string
*/
public function generateKey($config)
{
return $config->version . ',' . // possibly replace with function calls
$config->getBatchSerial($this->type) . ',' .
$config->get($this->type . '.DefinitionRev');
}
/**
* Tests whether or not a key is old with respect to the configuration's
* version and revision number.
* @param string $key Key to test
* @param HTMLPurifier_Config $config Instance of HTMLPurifier_Config to test against
* @return bool
*/
public function isOld($key, $config)
{
if (substr_count($key, ',') < 2) {
return true;
}
list($version, $hash, $revision) = explode(',', $key, 3);
$compare = version_compare($version, $config->version);
// version mismatch, is always old
if ($compare != 0) {
return true;
}
// versions match, ids match, check revision number
if ($hash == $config->getBatchSerial($this->type) &&
$revision < $config->get($this->type . '.DefinitionRev')) {
return true;
}
return false;
}
/**
* Checks if a definition's type jives with the cache's type
* @note Throws an error on failure
* @param HTMLPurifier_Definition $def Definition object to check
* @return bool true if good, false if not
*/
public function checkDefType($def)
{
if ($def->type !== $this->type) {
trigger_error("Cannot use definition of type {$def->type} in cache for {$this->type}");
return false;
}
return true;
}
/**
* Adds a definition object to the cache
* @param HTMLPurifier_Definition $def
* @param HTMLPurifier_Config $config
*/
abstract public function add($def, $config);
/**
* Unconditionally saves a definition object to the cache
* @param HTMLPurifier_Definition $def
* @param HTMLPurifier_Config $config
*/
abstract public function set($def, $config);
/**
* Replace an object in the cache
* @param HTMLPurifier_Definition $def
* @param HTMLPurifier_Config $config
*/
abstract public function replace($def, $config);
/**
* Retrieves a definition object from the cache
* @param HTMLPurifier_Config $config
*/
abstract public function get($config);
/**
* Removes a definition object to the cache
* @param HTMLPurifier_Config $config
*/
abstract public function remove($config);
/**
* Clears all objects from cache
* @param HTMLPurifier_Config $config
*/
abstract public function flush($config);
/**
* Clears all expired (older version or revision) objects from cache
* @note Be careful implementing this method as flush. Flush must
* not interfere with other Definition types, and cleanup()
* should not be repeatedly called by userland code.
* @param HTMLPurifier_Config $config
*/
abstract public function cleanup($config);
}
// 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 |
|