Exponential 6.0.13 Exponential Enterprise Open Source CMS - PHP Class Reference

Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Private Member Functions | Static Private Member Functions | List of all members
eZCharTransform Class Reference
Internationalization

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

## Public Member Functions
| transform ( $text, $rule, $charset=false, $useCache=true)
| transformByGroup ( $text, $group, $charset=false, $useCache=true)
| cacheFilePath ( $prefix, $suffix, $key)
| setWordSeparator ( $char)

## Static Public Member Functions
static | wordSeparator ()
static | commandUrlCleanupCompat ( $text, $charsetName)
static | commandUrlCleanup ( $text, $charsetName)
static | commandUrlCleanupIRI ( $text, $charsetName)
static | instance ()

## Public Attributes
| $GroupRules
const | CODE_DATE = 1177423380

## 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

## ◆ cachedTransformationPath()

eZCharTransform::cachedTransformationPath | ( |  | ) |
| static private

Returns
  the path of the cached transformation tables.

Definition at line 180 of file ezchartransform.php.

References eZSys\instance().

Referenced by cacheFilePath().

## ◆ cacheFilePath()

eZCharTransform::cacheFilePath | ( |  | $prefix,
|  |  | $suffix,
|  |  | $key
| ) |  |

Get cache file path.

Parameters

  $prefix |
  $suffix |
  $key |

Returns
  cache file path.

Definition at line 250 of file ezchartransform.php.

References cachedTransformationPath(), and eZDir\mkdir().

Referenced by transform(), and transformByGroup().

## ◆ commandUrlCleanup()

static eZCharTransform::commandUrlCleanup | ( |  | $text,
|  |  | $charsetName
| ) |  |
| static

Definition at line 387 of file ezchartransform.php.

References wordSeparator().

Referenced by eZCodeMapper\executeCommandCode().

## ◆ commandUrlCleanupCompat()

static eZCharTransform::commandUrlCleanupCompat | ( |  | $text,
|  |  | $charsetName
| ) |  |
| static

Definition at line 375 of file ezchartransform.php.

Referenced by eZCodeMapper\executeCommandCode().

## ◆ commandUrlCleanupIRI()

static eZCharTransform::commandUrlCleanupIRI | ( |  | $text,
|  |  | $charsetName
| ) |  |
| static

Definition at line 403 of file ezchartransform.php.

References wordSeparator().

Referenced by eZCodeMapper\executeCommandCode().

## ◆ executeCacheFile()

eZCharTransform::executeCacheFile | ( |  | $text,
|  |  | $filepath,
|  |  | $timestamp = `false`
| ) |  |
| protected

Parameters

  $text | The text that should be transformed
  $filepath | The filepath for the cache file
  $timestamp | A 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 269 of file ezchartransform.php.

Referenced by transform(), and transformByGroup().

## ◆ groupCommands()

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 201 of file ezchartransform.php.

References eZDebug\writeError().

Referenced by transformByGroup().

## ◆ instance()

static eZCharTransform::instance | ( |  | ) |
| static

Returns a shared instance of the eZCharTransform class.

Returns
  eZCharTransform

Examples
  /web/vh/ezpublish.se7enx.com/doc/api.exponential.earth/src/exponential/kernel/classes/ezurlaliasml.php.

Definition at line 434 of file ezchartransform.php.

Referenced by eZMatrixDefinition\addColumn(), eZSearchLog\addPhrase(), eZIdentifierType\assignValue(), eZStringType\batchInitializeObjectAttributeData(), eZURLAliasML\convertToAlias(), eZURLAliasML\convertToAliasCompat(), eZMatrixType\fetchClassAttributeHTTPInput(), eZObjectRelationType\fetchObjectAttributeHTTPInput(), eZPackageCreationHandler\initializePackageInformation(), eZExtensionPackageHandler\install(), eZPackage\isValidName(), eZImageAliasHandler\normalizeImageName(), eZPackage\parseDOMTree(), eZCountryType\sortKey(), eZIdentifierType\sortKey(), eZStringType\sortKey(), eZURLAliasML\strtolower(), and eZPackageCreationHandler\validatePackageInformation().

## ◆ setWordSeparator()

eZCharTransform::setWordSeparator | ( |  | $char | ) |

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

Definition at line 370 of file ezchartransform.php.

## ◆ storeCacheFile()

eZCharTransform::storeCacheFile | ( |  | $filepath,
|  |  | $transformationData,
|  |  | $extraCode,
|  |  | $type,
|  |  | $charsetName
| ) |  |
| private

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

Definition at line 293 of file ezchartransform.php.

References varExport().

Referenced by transform(), and transformByGroup().

## ◆ transform()

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

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

Parameters

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

Definition at line 38 of file ezchartransform.php.

References cacheFilePath(), executeCacheFile(), eZSys\ezcrc32(), eZTextCodec\internalCharset(), eZCharsetInfo\realCharsetCode(), and storeCacheFile().

## ◆ transformByGroup()

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

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

Parameters

  $text | The text string to be converted, currently Unicode arrays are not supported
  $group | Which transformation group to use, of which the rules will be applied.
  $charset | Which charset to use when transforming, if `false` it will use current charset (i18n.ini).
  $useCache | If `true` then it will use cache files for the tables, if not it will have to calculate them each time.

Definition at line 98 of file ezchartransform.php.

References cacheFilePath(), executeCacheFile(), eZSys\ezcrc32(), groupCommands(), eZTextCodec\internalCharset(), eZCharsetInfo\realCharsetCode(), and storeCacheFile().

## ◆ varExport()

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 328 of file ezchartransform.php.

Referenced by storeCacheFile().

## ◆ wordSeparator()

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 338 of file ezchartransform.php.

Referenced by commandUrlCleanup(), and commandUrlCleanupIRI().

## Member Data Documentation

## ◆ $GroupRules

eZCharTransform::$GroupRules

Definition at line 21 of file ezchartransform.php.

## ◆ CODE_DATE

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

1. Jan. 2007 - 1170165730

1. Apr. 2007 - 1177423380

Definition at line 28 of file ezchartransform.php.

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

- ezchartransform.php

Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.