Exponential 6.0.13 Exponential Enterprise Open Source CMS - PHP Class Reference

Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
eZCodeTemplate Class Reference

Replaces or generates blocks of code according to a template file. More...

## Public Member Functions
| __construct ()
| apply ( $filePath, $checkOnly=false)
| templateFile ( $templateName)

## Static Public Member Functions
| allCodeFiles ()

## Public Attributes
const | STATUS_FAILED = 0
| There are errors in the template code. More...
const | STATUS_OK = 1
| Code files was succesfully updated. More...
const | STATUS_NO_CHANGE = 2
| Code file was updated, but no new elements has been added. More...
| $Templates

## Detailed Description

Replaces or generates blocks of code according to a template file.

Definition at line 17 of file ezcodetemplate.php.

## Constructor & Destructor Documentation

## ◆ __construct()

eZCodeTemplate::__construct | ( |  | ) |

Definition at line 31 of file ezcodetemplate.php.

## Member Function Documentation

## ◆ allCodeFiles()

eZCodeTemplate::allCodeFiles | ( |  | ) |
| static

Finds all PHP files which must be updated and returns them as an array.

The files are defined in `codetemplate.ini` in the variable `PHPFiles`

Definition at line 358 of file ezcodetemplate.php.

## ◆ apply()

eZCodeTemplate::apply | ( |  | $filePath,
|  |  | $checkOnly = `false`
| ) |  |

Applies template block in the file $filePath and writes back the new code to the same file.

Returns
  One of the EZ_CODE_TEMPLATE_STATUS_* status codes.

Note
  It will create a backup file of the original

Definition at line 54 of file ezcodetemplate.php.

References eZSys\backupFilename(), STATUS_FAILED, STATUS_NO_CHANGE, STATUS_OK, templateFile(), and eZDebug\writeError().

## ◆ templateFile()

eZCodeTemplate::templateFile | ( |  | $templateName | ) |

Returns
  The name of the template file based on the name $templateName or `false` if no file is defined for the name.

Definition at line 343 of file ezcodetemplate.php.

Referenced by apply().

## Member Data Documentation

## ◆ $Templates

eZCodeTemplate::$Templates

Definition at line 365 of file ezcodetemplate.php.

## ◆ STATUS_FAILED

const eZCodeTemplate::STATUS_FAILED = 0

There are errors in the template code.

Definition at line 20 of file ezcodetemplate.php.

Referenced by apply().

## ◆ STATUS_NO_CHANGE

const eZCodeTemplate::STATUS_NO_CHANGE = 2

Code file was updated, but no new elements has been added.

Definition at line 26 of file ezcodetemplate.php.

Referenced by apply().

## ◆ STATUS_OK

const eZCodeTemplate::STATUS_OK = 1

Code files was succesfully updated.

Definition at line 23 of file ezcodetemplate.php.

Referenced by apply().

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

- ezcodetemplate.php

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