eZ Publish  [trunk]
eZCharTransform Class Reference

Performs rule based transformation of characters in a string. More...

List of all members.

Public Member Functions

 cacheFilePath ($prefix, $suffix, $key)
 eZCharTransform ()
 setWordSeparator ($char)
 transform ($text, $rule, $charset=false, $useCache=true)
 transformByGroup ($text, $group, $charset=false, $useCache=true)

Static Public Member Functions

static commandUrlCleanup ($text, $charsetName)
static commandUrlCleanupCompat ($text, $charsetName)
static commandUrlCleanupIRI ($text, $charsetName)
static instance ()
 Returns a shared instance of the eZCharTransform class.
static wordSeparator ()

Public Attributes

const CODE_DATE = 1177423380
 The timestamp for when the format of the cache files were last changed.

Protected Member Functions

 executeCacheFile ($text, $filepath, $timestamp=false)

Private Member Functions

 groupCommands ($group)
 storeCacheFile ($filepath, $transformationData, $extraCode, $type, $charsetName)

Static Private Member Functions

 cachedTransformationPath ()
static varExport ($value)

Detailed Description

Performs rule based transformation of characters in a string.

See also:
eZCodeMapper

Definition at line 19 of file ezchartransform.php.


Member Function Documentation

Returns:
the path of the cached transformation tables.

Definition at line 186 of file ezchartransform.php.

Referenced by cacheFilePath().

eZCharTransform::cacheFilePath ( prefix,
suffix,
key 
)

Get cache file path.

Parameters:
$prefix
$suffix
$key
Returns:
cache file path.

Definition at line 256 of file ezchartransform.php.

Referenced by transform(), and transformByGroup().

static eZCharTransform::commandUrlCleanup ( text,
charsetName 
) [static]

Definition at line 393 of file ezchartransform.php.

Referenced by eZCodeMapper\executeCommandCode().

static eZCharTransform::commandUrlCleanupCompat ( text,
charsetName 
) [static]

Definition at line 381 of file ezchartransform.php.

Referenced by eZCodeMapper\executeCommandCode().

static eZCharTransform::commandUrlCleanupIRI ( text,
charsetName 
) [static]

Definition at line 411 of file ezchartransform.php.

Referenced by eZCodeMapper\executeCommandCode().

eZCharTransform::executeCacheFile ( text,
filepath,
timestamp = false 
) [protected]
Parameters:
$textThe text that should be transformed
$filepathThe filepath for the cache file
$timestampA timestamp value which is matched against the cache file, pass for instance the timestamp of the INI file.
Returns:
The restored transformation data or false if there is no cached data.

Definition at line 275 of file ezchartransform.php.

Referenced by transform(), and transformByGroup().

Constructor

Definition at line 32 of file ezchartransform.php.

Referenced by instance().

eZCharTransform::groupCommands ( group) [private]

Finds all commands defined for group $group. The groups and their commands are defined in transform.ini.

Returns:
An array with commands, each entry contains of:
  • command - Name of the command
  • parameters - Array with parameters for command
  • text - Textual representation of the command + parameters

Definition at line 207 of file ezchartransform.php.

Referenced by transformByGroup().

Sets the current word separator, set it to null to use default value.

Definition at line 376 of file ezchartransform.php.

eZCharTransform::storeCacheFile ( filepath,
transformationData,
extraCode,
type,
charsetName 
) [private]

Stores the mapping table $table in the cache file $filepath.

Definition at line 299 of file ezchartransform.php.

Referenced by transform(), and transformByGroup().

eZCharTransform::transform ( text,
rule,
charset = false,
useCache = true 
)

Transforms the text according to the rules defined in $rule using character set $charset.

Parameters:
$textThe text string to be converted, currently Unicode arrays are not supported
$ruleWhich transformation rule to use, can either be a string identifier or an array with identifiers.
$charsetWhich charset to use when transforming, if false it will use current charset (i18n.ini).
$useCacheIf true then it will use cache files for the mapping, if not it will have to calculate them each time.

Definition at line 44 of file ezchartransform.php.

eZCharTransform::transformByGroup ( text,
group,
charset = false,
useCache = true 
)

Transforms the text according to the rules defined in $rule using character set $charset.

Parameters:
$textThe text string to be converted, currently Unicode arrays are not supported
$groupWhich transformation group to use, of which the rules will be applied.
$charsetWhich charset to use when transforming, if false it will use current charset (i18n.ini).
$useCacheIf true then it will use cache files for the tables, if not it will have to calculate them each time.

Definition at line 104 of file ezchartransform.php.

static eZCharTransform::varExport ( value) [static, private]

Creates a text representation of the value $value which can be placed in files and be read back by a PHP parser as it was. The type of the values determines the output, it can be one of the following.

  • boolean, becomes true or false
  • null, becomes null
  • string, adds \ (backslash) to backslashes, double quotes, dollar signs and newlines. Then wraps the whole string in " (double quotes).
  • numeric, displays the value as-is.
  • array, expands all value recursively using this function
  • object, creates a representation of an object creation if the object has serializeData implemented.

Definition at line 334 of file ezchartransform.php.

Referenced by storeCacheFile().

static eZCharTransform::wordSeparator ( ) [static]

Returns the current word separator, if none is found it will read from site.ini URLTranslator/WordSeparator

See also:
setWordSeparator

Definition at line 344 of file ezchartransform.php.

Referenced by commandUrlCleanup(), commandUrlCleanupIRI(), and eZURLAliasFilterAppendNodeID\process().


Member Data Documentation

const eZCharTransform::CODE_DATE = 1177423380

The timestamp for when the format of the cache files were last changed.

This must be updated when the format changes to invalidate existing cache files. 1101288452 30. Jan. 2007 - 1170165730 24. Apr. 2007 - 1177423380

Definition at line 27 of file ezchartransform.php.


The documentation for this class was generated from the following file: