Exponential Basic 2.4.0.1 Exponential Basic 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 20 of file ezchartransform.php.

## Member Function Documentation

## ◆ cachedTransformationPath()

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

Returns
  the path of the cached transformation tables.

Definition at line 181 of file ezchartransform.php.

References $dir, $sys, and 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 251 of file ezchartransform.php.

References $suffix, cachedTransformationPath(), file_exists(), and eZDir\mkdir().

Referenced by transform(), and transformByGroup().

## ◆ commandUrlCleanup()

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

Definition at line 388 of file ezchartransform.php.

References wordSeparator().

Referenced by eZCodeMapper\executeCommandCode().

## ◆ commandUrlCleanupCompat()

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

Definition at line 376 of file ezchartransform.php.

Referenced by eZCodeMapper\executeCommandCode().

## ◆ commandUrlCleanupIRI()

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

Definition at line 404 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 270 of file ezchartransform.php.

References $ini, $time, $timestamp, and file_exists().

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

References $group, $groups, $ini, and eZDebug\writeError().

Referenced by transformByGroup().

## ◆ instance()

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

Returns a shared instance of the eZCharTransform class.

Returns
  eZCharTransform

Definition at line 435 of file ezchartransform.php.

References $instance.

Referenced by eZContentObjectState\isValid(), and eZContentObjectStateGroup\isValid().

## ◆ setWordSeparator()

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

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

Definition at line 371 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 294 of file ezchartransform.php.

References $dir, $file, and 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 39 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 99 of file ezchartransform.php.

References $group, 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 329 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 339 of file ezchartransform.php.

References $ini, and $separator.

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

## Member Data Documentation

## ◆ $GroupRules

eZCharTransform::$GroupRules

Definition at line 22 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 29 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+.