Class Encoder
Provides encoding of arbitrary data. Encoders are commonly used to enable transparent data processing, such as escaping of HTML CDATA, password hashing, conversion of data streams. Additionally, encoder instances can be chained together to provide complex data conversion schemes.
- Core\Object implements Core\Chainable
- Core\Set implements Core\Accessor
- Core\Set\Mutable implements Core\Mutator
- Core\Field implements Core\Inquiry
- Core\Encoder
Direct known subclasses
Core\Encoder\Driver\base64
,
Core\Encoder\Driver\base64s
,
Core\Encoder\Driver\integer
,
Core\Encoder\Driver\md5
,
Core\Encoder\Driver\md5sum
,
Core\Encoder\Driver\passthrough
,
Core\Encoder\Driver\qp
,
Core\Encoder\Driver\rawurl
,
Core\Encoder\Driver\serialize
,
Core\Encoder\Driver\sha1
,
Core\Encoder\Driver\sha1sum
,
Core\Encoder\Driver\smd5
,
Core\Encoder\Driver\boolean
,
Core\Encoder\Driver\split
,
Core\Encoder\Driver\ssha
,
Core\Encoder\Driver\taggedhash
,
Core\Encoder\Driver\url
,
Core\Encoder\Driver\uu
,
Core\Encoder\Driver\charset
,
Core\Encoder\Driver\crc32
,
Core\Encoder\Driver\decimal
,
Core\Encoder\Driver\delegate
,
Core\Encoder\Driver\escape
,
Core\Encoder\Driver\hash
,
Core\Encoder\Driver\html
Indirect known subclasses
Core\Encoder\Driver\clear
,
Core\Encoder\Driver\sha
,
Core\Encoder\Driver\xml
Namespace: Core
Package: Core\Encoder
Since: 3.0
Requires: PHP 5.3
Version: 1.1
Located at Encoder.inc.php
Methods summary
public
|
|
public static
|
|
public
mixed
|
|
public
boolean
|
#
chain(
Chains another object to this encoder instance. |
public
|
|
public
|
|
public
string
|
#
encode( string $data )
Passes arbitrary data through the full encoder chain of this instance and returns the encoded data. |
public
|
|
public
string
|
#
getDataForUndefinedKey( string $key )
Returns a value from an attached data source automatically encoded by this encoder chain via KDC access. |
public
|
|
public
|
#
resolveDecoderChain( )
Returns an array of decoder URI instances that allow reversal of the full encoder chain of this instance. |
public
boolean
|
#
reversible( )
Tests, whether this encoding is reversible. This includes tests on the existence of all drivers for an appropriate decoder chain. |
public
boolean
|
#
verify( string $input, string $output )
Verifies that this encoder applied to given input data yields the given output data. |
abstract protected
string
|
Methods inherited from Core\Field
getDataForKey()
,
getDataForKeys()
,
issetDataForKey()
,
offsetExists()
,
offsetGet()
,
offsetSet()
,
offsetUnset()
Methods inherited from Core\Set\Mutable
Methods inherited from Core\Object
__autocreateFactory()
,
__call()
,
__processParameters()
,
__toString()
,
attachMethod()
,
getValueForKey()
,
getValueForKeyPath()
,
getValueForUndefinedKey()
,
hash()
,
issetValueForKey()
,
setValueForKey()
,
setValueForKeyPath()
,
setValueForUndefinedKey()
,
uuid()
Constants summary
string |
SuccessorParameter
URI string of encoding successor that is automatically instantiated and chained to the instance during initialisation. Allows description of full encoder chains by a single URI. |
#
'successor'
|
Constants inherited from Core\Object
AnyParameterType
,
AutochainParameterType
,
AutocreateParameterType
,
BooleanParameterType
,
CharParameterType
,
EnumParameterType
,
IntegerParameterType
,
RealParameterType
,
StringParameterType
,
UserParameterType
Properties summary
protected
array
|
$_v_parameters
Hash of parsed parameters from URI during initialisation. |
|
protected
|
$_v_successor
Subsequent (chained) encoder layer. Defaults to |
|
protected
|
$_v_uri
Reference to URI instance from factory. |
Properties inherited from Core\Field
Magic properties
public read-only
|
$dataSource
Attached data source. Defaults to |
public read-only
array
|
$parameters
Hash of parsed parameters from URI during initialisation. |
public read-only
|
$successor
Subsequent (chained) encoder layer. Defaults to |
public read-only
|
$uri
Reference to URI instance from factory. |