eZPublish  3.8
eZTemplateFileResource Class Reference

Handles filesystem retrieval of templates. More...

+ Inheritance diagram for eZTemplateFileResource:

Public Member Functions

 cachedTemplateTree ($keyData, $uri, $res, $templatePath, &$extraParameters, $timestamp)
 
 cacheKey ($keyData, $res, $templatePath, &$extraParameters)
 
 canCompileTemplate (&$tpl, &$resourceData, &$extraParameters)
 
 compileTemplate (&$tpl, $keyData, $uri, $res, $templatePath, &$extraParameters, &$resourceData)
 
 executeCompiledTemplate (&$tpl, &$textElements, $keyData, $uri, $resourceData, $templatePath, &$extraParameters, $timestamp, $rootNamespace, $currentNamespace)
 
 eZTemplateFileResource ($name="file", $servesStaticData=true)
 
 handleResource (&$tpl, &$resourceData, $method, &$extraParameters)
 
 hasCachedProcessTree ($keyData, $uri, $res, $templatePath, &$extraParameters, $timestamp)
 
 hasCompiledTemplate ($keyData, $uri, &$resourceData, $templatePath, &$extraParameters, $timestamp)
 
 resourceName ()
 
 servesStaticData ()
 
 setCachedTemplateTree ($keyData, $uri, $res, $templatePath, &$extraParameters, &$root)
 
 templateNodeTransformation ($functionName, &$node, &$tpl, &$resourceData, $parameters, $namespaceValue)
 

Static Public Member Functions

 handleResourceData (&$tpl, &$handler, &$resourceData, $method, &$extraParameters)
 

Private Attributes

 $Name
 The name of the resource. More...
 
 $ServesStaticData
 True if the data served from this resource is static, ie it can be cached properly. More...
 
 $TemplateCache
 The cache for templates. More...
 

Detailed Description

Handles filesystem retrieval of templates.

Templates are loaded from the disk and returned to the template system. The name of the resource is "file:".

Member Function Documentation

eZTemplateFileResource::cachedTemplateTree (   $keyData,
  $uri,
  $res,
  $templatePath,
$extraParameters,
  $timestamp 
)
Returns
the cached node tree for the selected template.
eZTemplateFileResource::cacheKey (   $keyData,
  $res,
  $templatePath,
$extraParameters 
)

Generates a unique key string from the input data and returns it. The key will be used for storing cached data and retrieving cache files. When implementing file resource handlers this key must be reimplemented if the current code does not generate correct keys. However most file based resource handlers can simple reuse this class.

Default implementation returns an md5 of the $keyData.

Referenced by cachedTemplateTree(), compileTemplate(), executeCompiledTemplate(), hasCachedProcessTree(), hasCompiledTemplate(), and setCachedTemplateTree().

eZTemplateFileResource::canCompileTemplate ( $tpl,
$resourceData,
$extraParameters 
)
Returns
true if a compiled template can be generated for this request.
eZTemplateFileResource::compileTemplate ( $tpl,
  $keyData,
  $uri,
  $res,
  $templatePath,
$extraParameters,
$resourceData 
)

Sets the cached node tree for the selected template to $root.

eZTemplateFileResource::executeCompiledTemplate ( $tpl,
$textElements,
  $keyData,
  $uri,
  $resourceData,
  $templatePath,
$extraParameters,
  $timestamp,
  $rootNamespace,
  $currentNamespace 
)

Sets the cached node tree for the selected template to $root.

eZTemplateFileResource::eZTemplateFileResource (   $name = "file",
  $servesStaticData = true 
)

Initializes with a default resource name "file". Also sets whether the resource servers static data files, this is needed for the cache system.

Referenced by eZTemplateDesignResource\eZTemplateDesignResource().

eZTemplateFileResource::handleResource ( $tpl,
$resourceData,
  $method,
$extraParameters 
)

Loads the template file if it exists, also sets the modification timestamp. Returns true if the file exists.

eZTemplateFileResource::handleResourceData ( $tpl,
$handler,
$resourceData,
  $method,
$extraParameters 
)
static

Reusable function for handling file based loading. Call this with the resource handler object in $handler. It will load the template file and handle any charsets conversion if necessary. It will also handle tree node caching if one is found.

Referenced by handleResource(), and eZTemplateDesignResource\handleResource().

eZTemplateFileResource::hasCachedProcessTree (   $keyData,
  $uri,
  $res,
  $templatePath,
$extraParameters,
  $timestamp 
)
Returns
the cached node tree for the selected template.
eZTemplateFileResource::hasCompiledTemplate (   $keyData,
  $uri,
$resourceData,
  $templatePath,
$extraParameters,
  $timestamp 
)
Returns
true if a compiled template exists for the current request.
eZTemplateFileResource::resourceName ( )

Returns the name of the resource.

eZTemplateFileResource::servesStaticData ( )
eZTemplateFileResource::setCachedTemplateTree (   $keyData,
  $uri,
  $res,
  $templatePath,
$extraParameters,
$root 
)

Sets the cached node tree for the selected template to $root.

eZTemplateFileResource::templateNodeTransformation (   $functionName,
$node,
$tpl,
$resourceData,
  $parameters,
  $namespaceValue 
)

Member Data Documentation

eZTemplateFileResource::$Name
private

The name of the resource.

Referenced by resourceName().

eZTemplateFileResource::$ServesStaticData
private

True if the data served from this resource is static, ie it can be cached properly.

Referenced by servesStaticData().

eZTemplateFileResource::$TemplateCache
private

The cache for templates.


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