eZPublish  4.5
eZCodeTemplate Class Reference

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

Public Member Functions

 apply ($filePath, $checkOnly=false)
 
 eZCodeTemplate ()
 
 templateFile ($templateName)
 

Static Public Member Functions

 allCodeFiles ()
 

Public Attributes

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

Detailed Description

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

Member Function Documentation

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

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
eZCodeTemplate::eZCodeTemplate ( )

Constructor

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.

Referenced by apply().

Member Data Documentation

eZCodeTemplate::$Templates
const eZCodeTemplate::STATUS_FAILED = 0

There are errors in the template code.

const eZCodeTemplate::STATUS_NO_CHANGE = 2

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

const eZCodeTemplate::STATUS_OK = 1

Code files was succesfully updated.


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