Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.0.x will end 8 May 2023 (12 months).
  • Bug fixes for security issues in 4.0.x will end 13 November 2023 (18 months).
  • PHP version: minimum PHP 7.3.0 Note: the minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is also supported.

(no description)

File Size: 311 lines (10 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

HTMLPurifier_DefinitionCache_Serializer:: (13 methods):
  add()
  set()
  replace()
  get()
  remove()
  flush()
  cleanup()
  generateFilePath()
  generateDirectoryPath()
  generateBaseDirectoryPath()
  _write()
  _prepareDir()
  _testPermissions()


Class: HTMLPurifier_DefinitionCache_Serializer  - X-Ref

add($def, $config)   X-Ref

return: int|bool
param: HTMLPurifier_Definition $def
param: HTMLPurifier_Config $config

set($def, $config)   X-Ref

return: int|bool
param: HTMLPurifier_Definition $def
param: HTMLPurifier_Config $config

replace($def, $config)   X-Ref

return: int|bool
param: HTMLPurifier_Definition $def
param: HTMLPurifier_Config $config

get($config)   X-Ref

return: bool|HTMLPurifier_Config
param: HTMLPurifier_Config $config

remove($config)   X-Ref

return: bool
param: HTMLPurifier_Config $config

flush($config)   X-Ref

return: bool
param: HTMLPurifier_Config $config

cleanup($config)   X-Ref

return: bool
param: HTMLPurifier_Config $config

generateFilePath($config)   X-Ref
Generates the file path to the serial file corresponding to
the configuration and definition name

return: string
param: HTMLPurifier_Config $config

generateDirectoryPath($config)   X-Ref
Generates the path to the directory contain this cache's serial files

return: string
param: HTMLPurifier_Config $config

generateBaseDirectoryPath($config)   X-Ref
Generates path to base directory that contains all definition type
serials

return: mixed|string
param: HTMLPurifier_Config $config

_write($file, $data, $config)   X-Ref
Convenience wrapper function for file_put_contents

return: int|bool Number of bytes written if success, or false if failure.
param: string $file File name to write to
param: string $data Data to write into file
param: HTMLPurifier_Config $config

_prepareDir($config)   X-Ref
Prepares the directory that this type stores the serials in

return: bool True if successful
param: HTMLPurifier_Config $config

_testPermissions($dir, $chmod)   X-Ref
Tests permissions on a directory and throws out friendly
error messages and attempts to chmod it itself if possible

return: bool True if directory is writable
param: string $dir Directory path
param: int $chmod Permissions