eZTemplateFileResource Class Reference

Handles filesystem retrieval of templates. More...

List of all members.


Public Methods

 eZTemplateFileResource ($name="file",$servesStaticData=true)
 resourceName ()
 cacheKey ($keyData,$res,$templatePath,&$extraParameters)
 hasCachedProcessTree ($keyData,$uri,$res,$templatePath,&$extraParameters,$timestamp)
 generateProcessCache ($keyData,$uri,$res,$templatePath,&$extraParameters,&$resourceData)
cachedTemplateTree ($keyData,$uri,$res,$templatePath,&$extraParameters,$timestamp)
 setCachedTemplateTree ($keyData,$uri,$res,$templatePath,&$extraParameters,&$root)
 handleResource (&$tpl,&$resourceData,$method,&$extraParameters)

Static Public Methods

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

Private Attributes

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

 TemplateCache
 The cache for templates.


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:".

Definition at line eztemplatefileresource.php.


Constructor & Destructor Documentation

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.

Definition at line eztemplatefileresource.php.

References TemplateCache.


Member Function Documentation

& eZTemplateFileResource::cachedTemplateTree   keyData,
  uri,
  res,
  templatePath,
&$    extraParameters,
  timestamp
 

Returns:
the cached node tree for the selected template.

Definition at line eztemplatefileresource.php.

References eZTemplateTreeCache::restoreCache().

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.

Definition at line eztemplatefileresource.php.

Referenced by setCachedTemplateTree().

eZTemplateFileResource::generateProcessCache   keyData,
  uri,
  res,
  templatePath,
&$    extraParameters,
&$    resourceData
 

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

Definition at line eztemplatefileresource.php.

References eZDebug::writeDebug().

eZTemplateFileResource::handleResource &$    tpl,
&$    resourceData,
  method,
&$    extraParameters
 

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

Definition at line eztemplatefileresource.php.

References handleResourceData().

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.

Definition at line eztemplatefileresource.php.

References eZDebug::writeNotice().

Referenced by handleResource().

eZTemplateFileResource::hasCachedProcessTree   keyData,
  uri,
  res,
  templatePath,
&$    extraParameters,
  timestamp
 

Returns:
the cached node tree for the selected template.

Definition at line eztemplatefileresource.php.

References eZTemplateTreeCache::restoreCache().

eZTemplateFileResource::resourceName  
 

Returns the name of the resource.

Definition at line eztemplatefileresource.php.

References Name.

Referenced by handleResourceData().

eZTemplateFileResource::setCachedTemplateTree   keyData,
  uri,
  res,
  templatePath,
&$    extraParameters,
&$    root
 

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

Definition at line eztemplatefileresource.php.

References eZTemplateTreeCache::storeCache().


Member Data Documentation

eZTemplateFileResource::Name [private]
 

The name of the resource

Definition at line eztemplatefileresource.php.

Referenced by resourceName().


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

Exponential