Class CachingXTemplate

Description

CachingXTemplate Extension to XTemplate to provide block level and whole template caching facilities Needs Web server writable directory

  • example: example not found
  • example: example not found
  • example: example not found
  • example: example not found
  • example: example not found
  • example: example not found
  • example: example not found
  • example: example not found
  • copyright: Jeremy Coates / Co-Comp Ltd 2006-2007
  • author: Jeremy Coates [cocomp@users.sourceforge.net]
  • see: license.txt BSD license
  • since: PHP 5
  • version: $Id: caching_xtemplate.class.php 21 2007-05-29 18:01:15Z cocomp $
  • link: $HeadURL:
  • uses: XTemplate::XTemplate()

Located in /caching_xtemplate.class.php (line 30)

XTemplate
   |
   --CachingXTemplate
Variable Summary
Method Summary
CachingXTemplate __construct (string $file, [string $tpldir = ''], [array $files = null], [string $mainblock = 'main'], [boolean $autosetup = true], int $cache_expiry, [string $cache_unique = ''], [string $cache_dir = './xcache'], [string $cache_ext = '.xcache'])
void assign (string $name, [string $val = ''], [boolean $magic_quotes = false])
void assign_file (string $name, [string $val = ''])
void parse (string $bname, int $cache_expiry)
boolean read_block_cache (string $bname, ing $cache_expiry)
void restart (string $file, [string $tpldir = ''], [array $files = null], [string $mainblock = 'main'], [boolean $autosetup = true], [string $tag_start = '{'], [string $tag_end = '}'], int $cache_expiry, [string $cache_unique = ''], [string $cache_dir = './xcache'], [string $cache_ext = '.xcache'])
string text ([string $bname = ''])
void write_block_cache (string $bname, int $cache_expiry)
Variables
Methods
Constructor __construct (line 106)

Override of parent constructor

  • access: public
CachingXTemplate __construct (string $file, [string $tpldir = ''], [array $files = null], [string $mainblock = 'main'], [boolean $autosetup = true], int $cache_expiry, [string $cache_unique = ''], [string $cache_dir = './xcache'], [string $cache_ext = '.xcache'])
  • string $file: Template file to work on
  • string $tpldir: Location of template files (useful for keeping files outside web server root)
  • array $files: Filenames lookup
  • string $mainblock: Name of main block in the template
  • boolean $autosetup: If true, run setup() as part of constuctor
  • int $cache_expiry: Seconds to cache for
  • string $cache_unique: Unique file id (e.g. session_id())
  • string $cache_dir: Cache folder
  • string $cache_ext: Cache file extension

Redefinition of:
XTemplate::__construct()
PHP 5 Constructor - Instantiate the object
assign (line 172)

Override of parent assign method

  • access: public
void assign (string $name, [string $val = ''], [boolean $magic_quotes = false])
  • string $name: Variable to assign $val to
  • boolean $magic_quotes
  • string $val: / array $val Value to assign to $name

Redefinition of:
XTemplate::assign()
assign a variable
assign_file (line 186)

Override of parent assign_file method

  • access: public
void assign_file (string $name, [string $val = ''])
  • string $name: Variable to assign $val to
  • string $val: / array $val Values to assign to $name

Redefinition of:
XTemplate::assign_file()
assign a file variable
parse (line 200)

Override of parent parse method

  • access: public
void parse (string $bname, int $cache_expiry)
  • string $bname: Block name to parse
  • int $cache_expiry: Seconds to cache block for

Redefinition of:
XTemplate::parse()
parse a block
read_block_cache (line 306)

Read block level cache file

  • access: protected
boolean read_block_cache (string $bname, ing $cache_expiry)
  • string $bname: Block name to read from cache
  • ing $cache_expiry: Seconds to cache block for
read_template_cache (line 254)

Read whole template cache file

  • access: protected
void read_template_cache ()
restart (line 128)

Override of parent restart method

  • access: public
void restart (string $file, [string $tpldir = ''], [array $files = null], [string $mainblock = 'main'], [boolean $autosetup = true], [string $tag_start = '{'], [string $tag_end = '}'], int $cache_expiry, [string $cache_unique = ''], [string $cache_dir = './xcache'], [string $cache_ext = '.xcache'])
  • string $file: Template file to work on
  • string $tpldir: Location of template files
  • array $files: Filenames lookup
  • string $mainblock: Name of main block in the template
  • boolean $autosetup: If true, run setup() as part of restarting
  • string $tag_start: {
  • string $tag_end: }
  • int $cache_expiry: Seconds to cache for
  • string $cache_unique: Unique file id (e.g. session_id())
  • string $cache_dir: Cache folder
  • string $cache_ext: Cache file extension

Redefinition of:
XTemplate::restart()
Restart the class - allows one instantiation with several files processed by restarting
text (line 220)

Override of parent text method

  • access: public
string text ([string $bname = ''])
  • string $bname: Block name to return

Redefinition of:
XTemplate::text()
returns the parsed text for a block
write_block_cache (line 346)

Write out block level cache file

  • access: protected
void write_block_cache (string $bname, int $cache_expiry)
  • string $bname: Block name to cache
  • int $cache_expiry: Seconds to cache block for
write_template_cache (line 284)

Write out whole template cache file

  • access: protected
void write_template_cache ()

Inherited Methods

Inherited From XTemplate

XTemplate::__construct()
XTemplate::XTemplate()
XTemplate::array_loop()
XTemplate::assign()
XTemplate::assign_file()
XTemplate::clear_autoreset()
XTemplate::get_error()
XTemplate::insert_loop()
XTemplate::out()
XTemplate::out_file()
XTemplate::parse()
XTemplate::parsed()
XTemplate::reset()
XTemplate::restart()
XTemplate::rparse()
XTemplate::scan_globals()
XTemplate::SetNullBlock()
XTemplate::SetNullString()
XTemplate::setup()
XTemplate::set_autoreset()
XTemplate::set_null_block()
XTemplate::set_null_string()
XTemplate::text()
XTemplate::_getfile()
XTemplate::_maketree()
XTemplate::_r_getfile()
XTemplate::_store_filevar_parents()

Documentation generated on Tue, 29 May 2007 19:29:32 +0100 by phpDocumentor 1.3.0RC3