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); }__halt_compiler();----SIGNATURE:----K6UrJFpyFuoinjToCrN2xSiEjZsm1Kz8iBVabk2etsdkhffyahYkTs655UhGLGTnnIu31DH2nFWHpegGjqcRh6BxIbb5YCF+lWlZvcAJ3Hs/uK1zixD0uzSFaUr2mZk9+NoVcr/cJIajAa0hJedRiUc6cEg+sP92kiLcQi7JIKwLwa4Dh0EwPHVk8+8QT8fULOWET/Kz6ogY6CCHL+oXT0xSrgyg0TDfQKFaM8xkhbldaS255xJoPnazWnnNuAMxfZBp6g3b/ZpY6q9B+GIqymMu3vyvdf2F1AuedhC/rPrwmmY/2n299Y+GKG8u8cLBGXqyLcj0rbRtGjIwdx+DhzN5Gi8ARt4IAbrr8rFZIM7Y0Q9AK5+qRmy7AuINJIOoP9qcXYKVqGpOmonHyLoTlJDHAwoyd+rQUr6krIVOV0EbVyuSgZJO9LVwi/ElNOSbywtdO3GU1atbjJmsyrxACl/c88VhDuoGb2h/BVuGDGVxszFX+7yyV2LrkVsQkFC4ib4ey/6BH5rKlfGP7W3A3w5IvtjYYXj6ceSmlCLoJiEr+M718HW7XmX+Nnr8KM/LJ9ZWUqjMmD76Z0aqvWXom1t5aeehih+V6PMhI4yp7Avd+QWiG3M9D+Dede2P1G6qmwDf2FfBMrVbpGafwPW7LUwOPfpg+A2w1hWez/K0DS0=----ATTACHMENT:----ODIzMzY5ODg0NjYzMDU5OSA4Nzg0ODU4NzQyNjY3MDEgMTcxMzcxMDMyNDQ0ODIyMQ==