|
eZ Publish
[4.2]
|
Handles mapping of character codes. More...
Public Member Functions | |
| decodeCommand ($name, $parameters) | |
| error ($text, $position=false) | |
| executeCommandCode (&$text, $command, $charsetName) | |
| eZCodeMapper () | |
| generateCharsetMappingTable ($unicodeTable, $charset) | |
| generateCommandCode ($command, $charsetName) | |
| generateMappingCode ($identifier) | |
| generateSimpleMappingTable ($table, $allowedRanges) | |
| isTranformationLoaded ($name) | |
| loadTransformationFiles ($currentCharset, $transformationGroup) | |
| mapOrdinals ($table, $ordinals) | |
| mappingTable ($identifier) | |
| nonCJKCharsets () | |
| ordinalValues ($table, $list) | |
| parseTransformationFile ($filename, $name) | |
| ruleNames () | |
| warning ($text, $position=false) | |
Public Attributes | |
| $ISOUnicodeCodec | |
| $TransformationFiles | |
| $TransformationTables | |
| const | TYPE_DIRECT = 1 |
| const | TYPE_RANGE = 2 |
| const | TYPE_REPLACE = 3 |
Protected Member Functions | |
| mapExistingCodes ($unicodeMap, $fromCode, $toCode) | |
Private Member Functions | |
| appendDirectMapping (&$block, $identifier, $sourceValue, $destinationValues) | |
| appendReplaceMapping (&$block, $identifier, $sourceValue, $sourceEndValue, $destinationValues) | |
| appendTransposeMapping (&$block, $identifier, $sourceValue, $sourceEndValue, $transposeValue, $addValue, $moduloValue) | |
| expandInheritance ($table) | |
| extractUnicodeValue ($data) | |
| extractUnicodeValues ($data) | |
Handles mapping of character codes.
Definition at line 41 of file ezcodemapper.php.
| eZCodeMapper::appendDirectMapping | ( | &$ | block, |
| $ | identifier, | ||
| $ | sourceValue, | ||
| $ | destinationValues | ||
| ) | [private] |
Appends a mapping from one value to another.
| $block | Current block it is working on |
| $identifier | The current identifier it is working on |
| $sourceValue | The original value |
| $destinationValues | The value it should be mapped to |
Definition at line 864 of file ezcodemapper.php.
Referenced by parseTransformationFile().
| eZCodeMapper::appendReplaceMapping | ( | &$ | block, |
| $ | identifier, | ||
| $ | sourceValue, | ||
| $ | sourceEndValue, | ||
| $ | destinationValues | ||
| ) | [private] |
Appends a mapping for a range of values into a specific value
| $block | Current block it is working on |
| $identifier | The current identifier it is working on |
| $sourceValue | The start of the original value |
| $sourceEndValue | The ned of the original value |
| $destinationValues | The value it should be mapped to |
Definition at line 893 of file ezcodemapper.php.
Referenced by parseTransformationFile().
| eZCodeMapper::appendTransposeMapping | ( | &$ | block, |
| $ | identifier, | ||
| $ | sourceValue, | ||
| $ | sourceEndValue, | ||
| $ | transposeValue, | ||
| $ | addValue, | ||
| $ | moduloValue | ||
| ) | [private] |
Appends a mapping for characters by transposing them up or down.
| $block | Current block it is working on |
| $identifier | The current identifier it is working on |
| $sourceValue | The start of the original value |
| $sourceEndValue | The ned of the original value |
| $transposeValue | How much to transpose the values |
| $addValue | If true the $transposeValue is added to the range if not it is subtracted. |
Definition at line 923 of file ezcodemapper.php.
Referenced by parseTransformationFile().
| eZCodeMapper::decodeCommand | ( | $ | name, |
| $ | parameters | ||
| ) |
Decodes a command into transformation rules.
| $name | Name of the command |
| $parameters | Array of parameters for the command |
Definition at line 1459 of file ezcodemapper.php.
| eZCodeMapper::error | ( | $ | text, |
| $ | position = false |
||
| ) |
Outputs error $text found in parsed file at position $position.
Definition at line 77 of file ezcodemapper.php.
Referenced by parseTransformationFile().
| eZCodeMapper::executeCommandCode | ( | &$ | text, |
| $ | command, | ||
| $ | charsetName | ||
| ) |
Executes custom PHP code for the command $command.
| $charsetName | The name of the charset the text will be in, this can be used to execute different code for different charsets. |
true if the command is supported, false otherwise. Definition at line 1690 of file ezcodemapper.php.
| eZCodeMapper::expandInheritance | ( | $ | table | ) | [private] |
Goes trough all entries in $table and if it finds identifier references it will fetch the table for that identifier and merge in the current one.
Definition at line 1008 of file ezcodemapper.php.
Referenced by generateMappingCode().
| eZCodeMapper::extractUnicodeValue | ( | $ | data | ) | [private] |
Definition at line 945 of file ezcodemapper.php.
Referenced by parseTransformationFile().
| eZCodeMapper::extractUnicodeValues | ( | $ | data | ) | [private] |
Definition at line 976 of file ezcodemapper.php.
Referenced by parseTransformationFile().
| eZCodeMapper::eZCodeMapper | ( | ) |
Constructor
Definition at line 50 of file ezcodemapper.php.
| eZCodeMapper::generateCharsetMappingTable | ( | $ | unicodeTable, |
| $ | charset | ||
| ) |
Generates a mapping table for the character set $charset. This will mapping table will only work for that character set but will be much faster and be fed directly to the strtr() PHP function.
false if something failed. Definition at line 1422 of file ezcodemapper.php.
| eZCodeMapper::generateCommandCode | ( | $ | command, |
| $ | charsetName | ||
| ) |
Generates PHP code for the command $command.
| $charsetName | The name of the charset the text will be in, this can be used to generate different code for different charsets. |
false if not supported. Definition at line 1545 of file ezcodemapper.php.
| eZCodeMapper::generateMappingCode | ( | $ | identifier | ) |
Generates a unicode mapping table for idenfier $idenfier.
| $identifier | Is either a single identifier string or a an array with identifiers. |
Definition at line 1403 of file ezcodemapper.php.
| eZCodeMapper::generateSimpleMappingTable | ( | $ | table, |
| $ | allowedRanges | ||
| ) |
Goes trough the mapping rules in the table $table and generates a simple mapping table which maps from one Unicode value to another (or array of values).
The generation uses backward and forward propagation of the defined mappings to get the proper end result of a given value.
Definition at line 1138 of file ezcodemapper.php.
Referenced by generateMappingCode().
| eZCodeMapper::isTranformationLoaded | ( | $ | name | ) |
true if the transformation file is already loaded. Definition at line 125 of file ezcodemapper.php.
Referenced by loadTransformationFiles().
| eZCodeMapper::loadTransformationFiles | ( | $ | currentCharset, |
| $ | transformationGroup | ||
| ) |
Loads all transformation files defined in transform.ini to the current mapper. It will also load any transformations found in extensions.
| $currentCharset | The name of the current charset in use. The caller must make sure this is not an alias by using eZCharsetInfo::realCharsetCode() |
| $transformationGroup | The transformation group which is currently used or false for none. |
Definition at line 138 of file ezcodemapper.php.
| eZCodeMapper::mapExistingCodes | ( | $ | unicodeMap, |
| $ | fromCode, | ||
| $ | toCode | ||
| ) | [protected] |
Goes trough all to codes in the mapping table $unicodeMap and maps those that match $fromCode into $toCode.
Definition at line 1101 of file ezcodemapper.php.
Referenced by generateSimpleMappingTable().
| eZCodeMapper::mapOrdinals | ( | $ | table, |
| $ | ordinals | ||
| ) |
Goes trough each ordinal in $ordinals and sees if there is mapping for it. If it is the mapping is applied and used as the new ordinal, if the mapping refers to an array it will be mapped recursively.
Definition at line 1074 of file ezcodemapper.php.
Referenced by ordinalValues().
| eZCodeMapper::mappingTable | ( | $ | identifier | ) |
false if it is not found. Definition at line 59 of file ezcodemapper.php.
Referenced by expandInheritance().
| eZCodeMapper::nonCJKCharsets | ( | ) |
Definition at line 1830 of file ezcodemapper.php.
Referenced by executeCommandCode(), and generateCommandCode().
| eZCodeMapper::ordinalValues | ( | $ | table, |
| $ | list | ||
| ) |
Turns the character list $list into an array with ordinal values
| $list | Can be on of these types:
|
Definition at line 1043 of file ezcodemapper.php.
Referenced by generateSimpleMappingTable().
| eZCodeMapper::parseTransformationFile | ( | $ | filename, |
| $ | name | ||
| ) |
Parses the transformation file $filename and appends any rules it finds to the current rule list.
| $name | The name of transformation file as it was requested, ie. without a path |
Definition at line 202 of file ezcodemapper.php.
Referenced by loadTransformationFiles().
| eZCodeMapper::ruleNames | ( | ) |
Definition at line 69 of file ezcodemapper.php.
Referenced by decodeCommand().
| eZCodeMapper::warning | ( | $ | text, |
| $ | position = false |
||
| ) |
Outputs warning $text found in parsed file at position $position.
Definition at line 101 of file ezcodemapper.php.
Referenced by parseTransformationFile().
| eZCodeMapper::$ISOUnicodeCodec |
Definition at line 1849 of file ezcodemapper.php.
| eZCodeMapper::$TransformationFiles |
Definition at line 1848 of file ezcodemapper.php.
| eZCodeMapper::$TransformationTables |
Definition at line 1847 of file ezcodemapper.php.
| const eZCodeMapper::TYPE_DIRECT = 1 |
Definition at line 43 of file ezcodemapper.php.
| const eZCodeMapper::TYPE_RANGE = 2 |
Definition at line 44 of file ezcodemapper.php.
| const eZCodeMapper::TYPE_REPLACE = 3 |
Definition at line 45 of file ezcodemapper.php.