PHP 클래스 HTMLPurifier_Config, yii

파일 보기 프로젝트 열기: yiisoft/yii 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$autoFinalize Whether or not to automatically finalize the object if a read operation is done.
$chatty (useful when unit testing). This will also compress some errors and exceptions.
$def Reference HTMLPurifier_ConfigSchema for value checking.
$version HTML Purifier's version

보호된 프로퍼티들

프로퍼티 타입 설명
$definitions Indexed array of definitions.
$finalized Whether or not config is finalized.
$parser Parser for variables.
$plist Property list containing configuration directives.
$serial Serial for entire configuration object.
$serials Namespace indexed array of serials for specific namespaces.

공개 메소드들

메소드 설명
__construct ( HTMLPurifier_ConfigSchema $definition, HTMLPurifier_PropertyList $parent = null ) Constructor
autoFinalize ( ) Finalizes configuration only if auto finalize is on and not already finalized
create ( mixed $config, HTMLPurifier_ConfigSchema $schema = null ) : HTMLPurifier_Config Convenience constructor that creates a config object based on a mixed var
createDefault ( ) : HTMLPurifier_Config Convenience constructor that creates a default configuration object.
finalize ( ) Finalizes a configuration object, prohibiting further change
get ( string $key, mixed $a = null ) : mixed Retrieves a value from the configuration.
getAll ( ) Retrieves all directives, organized by namespace
getAllowedDirectivesForForm ( array $allowed, HTMLPurifier_ConfigSchema $schema = null ) : array Returns a list of array(namespace, directive) for all directives that are allowed in a web-form context as per an allowed namespaces/directives list.
getBatch ( string $namespace ) : array Retrieves an array of directives to values from a given namespace
getBatchSerial ( string $namespace ) : string Returns a SHA-1 signature of a segment of the configuration object that uniquely identifies that particular configuration
getCSSDefinition ( boolean $raw = false, boolean $optimized = false ) : HTMLPurifier_CSSDefinition Retrieves object reference to the CSS definition
getDefinition ( string $type, boolean $raw = false, boolean $optimized = false ) : HTMLPurifier_Definition Retrieves a definition
getHTMLDefinition ( boolean $raw = false, boolean $optimized = false ) : HTMLPurifier_HTMLDefinition Retrieves object reference to the HTML definition.
getSerial ( ) : string Returns a SHA-1 signature for the entire configuration object that uniquely identifies that particular configuration
getURIDefinition ( boolean $raw = false, boolean $optimized = false ) : HTMLPurifier_URIDefinition Retrieves object reference to the URI definition
inherit ( HTMLPurifier_Config $config ) : HTMLPurifier_Config Creates a new config object that inherits from a previous one.
isFinalized ( string | boolean $error = false ) : boolean Checks whether or not the configuration object is finalized.
loadArray ( array $config_array ) Loads configuration values from an array with the following structure: Namespace.Directive => Value
loadArrayFromForm ( array $array, string | boolean $index = false, array | boolean $allowed = true, boolean $mq_fix = true, HTMLPurifier_ConfigSchema $schema = null ) : mixed Loads configuration values from $_GET/$_POST that were posted via ConfigForm
loadIni ( string $filename ) Loads configuration values from an ini file
maybeGetRawCSSDefinition ( ) : HTMLPurifier_CSSDefinition
maybeGetRawDefinition ( $name )
maybeGetRawHTMLDefinition ( ) : HTMLPurifier_HTMLDefinition
maybeGetRawURIDefinition ( ) : HTMLPurifier_URIDefinition
mergeArrayFromForm ( array $array, string | boolean $index = false, array | boolean $allowed = true, boolean $mq_fix = true ) Merges in configuration values from $_GET/$_POST to object. NOT STATIC.
prepareArrayFromForm ( array $array, string | boolean $index = false, array | boolean $allowed = true, boolean $mq_fix = true, HTMLPurifier_ConfigSchema $schema = null ) : array Prepares an array from a form into something usable for the more strict parts of HTMLPurifier_Config
serialize ( ) : string Returns a serialized form of the configuration object that can be reconstituted.
set ( string $key, mixed $value, mixed $a = null ) Sets a value to configuration.

보호된 메소드들

메소드 설명
triggerError ( string $msg, integer $no ) Produces a nicely formatted error message by supplying the stack frame information OUTSIDE of HTMLPurifier_Config.

비공개 메소드들

메소드 설명
_listify ( array $lookup ) : string Convenience function for error reporting
initDefinition ( string $type ) : HTMLPurifier_CSSDefinition | HTMLPurifier_HTMLDefinition | HTMLPurifier_URIDefinition Initialise definition

메소드 상세

__construct() 공개 메소드

Constructor
public __construct ( HTMLPurifier_ConfigSchema $definition, HTMLPurifier_PropertyList $parent = null )
$definition HTMLPurifier_ConfigSchema ConfigSchema that defines what directives are allowed.
$parent HTMLPurifier_PropertyList

autoFinalize() 공개 메소드

Finalizes configuration only if auto finalize is on and not already finalized
public autoFinalize ( )

create() 공개 정적인 메소드

Convenience constructor that creates a config object based on a mixed var
public static create ( mixed $config, HTMLPurifier_ConfigSchema $schema = null ) : HTMLPurifier_Config
$config mixed Variable that defines the state of the config object. Can be: a HTMLPurifier_Config() object, an array of directives based on loadArray(), or a string filename of an ini file.
$schema HTMLPurifier_ConfigSchema Schema object
리턴 HTMLPurifier_Config Configured object

createDefault() 공개 정적인 메소드

Convenience constructor that creates a default configuration object.
public static createDefault ( ) : HTMLPurifier_Config
리턴 HTMLPurifier_Config default object.

finalize() 공개 메소드

Finalizes a configuration object, prohibiting further change
public finalize ( )

get() 공개 메소드

Retrieves a value from the configuration.
public get ( string $key, mixed $a = null ) : mixed
$key string String key
$a mixed
리턴 mixed

getAll() 공개 메소드

Retrieves all directives, organized by namespace
public getAll ( )

getAllowedDirectivesForForm() 공개 정적인 메소드

Returns a list of array(namespace, directive) for all directives that are allowed in a web-form context as per an allowed namespaces/directives list.
public static getAllowedDirectivesForForm ( array $allowed, HTMLPurifier_ConfigSchema $schema = null ) : array
$allowed array List of allowed namespaces/directives
$schema HTMLPurifier_ConfigSchema Schema to use, if not global copy
리턴 array

getBatch() 공개 메소드

Retrieves an array of directives to values from a given namespace
public getBatch ( string $namespace ) : array
$namespace string String namespace
리턴 array

getBatchSerial() 공개 메소드

Returns a SHA-1 signature of a segment of the configuration object that uniquely identifies that particular configuration
public getBatchSerial ( string $namespace ) : string
$namespace string Namespace to get serial for
리턴 string

getCSSDefinition() 공개 메소드

Retrieves object reference to the CSS definition
public getCSSDefinition ( boolean $raw = false, boolean $optimized = false ) : HTMLPurifier_CSSDefinition
$raw boolean Return a copy that has not been setup yet. Must be called before it's been setup, otherwise won't work.
$optimized boolean If true, this method may return null, to indicate that a cached version of the modified definition object is available and no further edits are necessary. Consider using maybeGetRawCSSDefinition, which is more explicitly named, instead.
리턴 HTMLPurifier_CSSDefinition

getDefinition() 공개 메소드

Retrieves a definition
public getDefinition ( string $type, boolean $raw = false, boolean $optimized = false ) : HTMLPurifier_Definition
$type string Type of definition: HTML, CSS, etc
$raw boolean Whether or not definition should be returned raw
$optimized boolean Only has an effect when $raw is true. Whether or not to return null if the result is already present in the cache. This is off by default for backwards compatibility reasons, but you need to do things this way in order to ensure that caching is done properly. Check out enduser-customize.html for more details. We probably won't ever change this default, as much as the maybe semantics is the "right thing to do."
리턴 HTMLPurifier_Definition

getHTMLDefinition() 공개 메소드

Retrieves object reference to the HTML definition.
public getHTMLDefinition ( boolean $raw = false, boolean $optimized = false ) : HTMLPurifier_HTMLDefinition
$raw boolean Return a copy that has not been setup yet. Must be called before it's been setup, otherwise won't work.
$optimized boolean If true, this method may return null, to indicate that a cached version of the modified definition object is available and no further edits are necessary. Consider using maybeGetRawHTMLDefinition, which is more explicitly named, instead.
리턴 HTMLPurifier_HTMLDefinition

getSerial() 공개 메소드

Returns a SHA-1 signature for the entire configuration object that uniquely identifies that particular configuration
public getSerial ( ) : string
리턴 string

getURIDefinition() 공개 메소드

Retrieves object reference to the URI definition
public getURIDefinition ( boolean $raw = false, boolean $optimized = false ) : HTMLPurifier_URIDefinition
$raw boolean Return a copy that has not been setup yet. Must be called before it's been setup, otherwise won't work.
$optimized boolean If true, this method may return null, to indicate that a cached version of the modified definition object is available and no further edits are necessary. Consider using maybeGetRawURIDefinition, which is more explicitly named, instead.
리턴 HTMLPurifier_URIDefinition

inherit() 공개 정적인 메소드

Creates a new config object that inherits from a previous one.
public static inherit ( HTMLPurifier_Config $config ) : HTMLPurifier_Config
$config HTMLPurifier_Config Configuration object to inherit from.
리턴 HTMLPurifier_Config object with $config as its parent.

isFinalized() 공개 메소드

Checks whether or not the configuration object is finalized.
public isFinalized ( string | boolean $error = false ) : boolean
$error string | boolean String error message, or false for no error
리턴 boolean

loadArray() 공개 메소드

Loads configuration values from an array with the following structure: Namespace.Directive => Value
public loadArray ( array $config_array )
$config_array array Configuration associative array

loadArrayFromForm() 공개 정적인 메소드

Loads configuration values from $_GET/$_POST that were posted via ConfigForm
public static loadArrayFromForm ( array $array, string | boolean $index = false, array | boolean $allowed = true, boolean $mq_fix = true, HTMLPurifier_ConfigSchema $schema = null ) : mixed
$array array $_GET or $_POST array to import
$index string | boolean Index/name that the config variables are in
$allowed array | boolean List of allowed namespaces/directives
$mq_fix boolean Boolean whether or not to enable magic quotes fix
$schema HTMLPurifier_ConfigSchema Schema to use, if not global copy
리턴 mixed

loadIni() 공개 메소드

Loads configuration values from an ini file
public loadIni ( string $filename )
$filename string Name of ini file

maybeGetRawCSSDefinition() 공개 메소드

public maybeGetRawCSSDefinition ( ) : HTMLPurifier_CSSDefinition
리턴 HTMLPurifier_CSSDefinition

maybeGetRawDefinition() 공개 메소드

public maybeGetRawDefinition ( $name )

maybeGetRawHTMLDefinition() 공개 메소드

public maybeGetRawHTMLDefinition ( ) : HTMLPurifier_HTMLDefinition
리턴 HTMLPurifier_HTMLDefinition

maybeGetRawURIDefinition() 공개 메소드

public maybeGetRawURIDefinition ( ) : HTMLPurifier_URIDefinition
리턴 HTMLPurifier_URIDefinition

mergeArrayFromForm() 공개 메소드

Merges in configuration values from $_GET/$_POST to object. NOT STATIC.
public mergeArrayFromForm ( array $array, string | boolean $index = false, array | boolean $allowed = true, boolean $mq_fix = true )
$array array $_GET or $_POST array to import
$index string | boolean Index/name that the config variables are in
$allowed array | boolean List of allowed namespaces/directives
$mq_fix boolean Boolean whether or not to enable magic quotes fix

prepareArrayFromForm() 공개 정적인 메소드

Prepares an array from a form into something usable for the more strict parts of HTMLPurifier_Config
public static prepareArrayFromForm ( array $array, string | boolean $index = false, array | boolean $allowed = true, boolean $mq_fix = true, HTMLPurifier_ConfigSchema $schema = null ) : array
$array array $_GET or $_POST array to import
$index string | boolean Index/name that the config variables are in
$allowed array | boolean List of allowed namespaces/directives
$mq_fix boolean Boolean whether or not to enable magic quotes fix
$schema HTMLPurifier_ConfigSchema Schema to use, if not global copy
리턴 array

serialize() 공개 메소드

Returns a serialized form of the configuration object that can be reconstituted.
public serialize ( ) : string
리턴 string

set() 공개 메소드

Sets a value to configuration.
public set ( string $key, mixed $value, mixed $a = null )
$key string key
$value mixed value
$a mixed

triggerError() 보호된 메소드

Produces a nicely formatted error message by supplying the stack frame information OUTSIDE of HTMLPurifier_Config.
protected triggerError ( string $msg, integer $no )
$msg string An error message
$no integer An error number

프로퍼티 상세

$autoFinalize 공개적으로 프로퍼티

Whether or not to automatically finalize the object if a read operation is done.
public $autoFinalize

$chatty 공개적으로 프로퍼티

(useful when unit testing). This will also compress some errors and exceptions.
public $chatty

$def 공개적으로 프로퍼티

Reference HTMLPurifier_ConfigSchema for value checking.
public $def

$definitions 보호되어 있는 프로퍼티

Indexed array of definitions.
protected $definitions

$finalized 보호되어 있는 프로퍼티

Whether or not config is finalized.
protected $finalized

$parser 보호되어 있는 프로퍼티

Parser for variables.
protected $parser

$plist 보호되어 있는 프로퍼티

Property list containing configuration directives.
protected $plist

$serial 보호되어 있는 프로퍼티

Serial for entire configuration object.
protected $serial

$serials 보호되어 있는 프로퍼티

Namespace indexed array of serials for specific namespaces.
또한 보기: getSerial() for more info.
protected $serials

$version 공개적으로 프로퍼티

HTML Purifier's version
public $version