Overview

Packages

  • CONTENIDO
  • Core
    • Authentication
    • Backend
    • Cache
    • CEC
    • Chain
    • ContentType
    • Database
    • Debug
    • Exception
    • Frontend
      • Search
      • URI
      • Util
    • GenericDB
      • Model
    • GUI
      • HTML
    • I18N
    • LayoutHandler
    • Log
    • Security
    • Session
    • Util
    • Validation
    • Versioning
    • XML
  • Module
    • ContentSitemapHtml
    • ContentSitemapXml
    • ContentUserForum
    • NavigationTop
    • ScriptCookieDirective
  • mpAutoloaderClassMap
  • None
  • PHP
  • Plugin
    • ContentAllocation
    • CronjobOverview
    • FormAssistant
    • FrontendLogic
    • FrontendUsers
    • Linkchecker
    • ModRewrite
    • Newsletter
    • Repository
      • FrontendNavigation
      • KeywordDensity
    • SIWECOS
    • SmartyWrapper
    • UrlShortener
    • UserForum
    • Workflow
  • PluginManager
  • Setup
    • Form
    • GUI
    • Helper
      • Environment
      • Filesystem
      • MySQL
      • PHP
    • UpgradeJob

Classes

  • cFileCache
  • cOutputCache
  • cOutputCacheHandler
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo

Class cOutputCache

This class contains functions for the CONTENIDO output cache.

Direct known subclasses

cOutputCacheHandler
Package: Core\Cache
Copyright: four for business AG <www.4fb.de>
License: http://www.contenido.org/license/LIZENZ.txt
Author: Murat Purc <murat@purc.de>
Located at classes/cache/class.output.cache.php
Methods summary
public
# __construct( string $cachedir = NULL, string $cachegroup = NULL, string $cacheprefix = NULL )

Constructor to create an instance of this class.

Constructor to create an instance of this class.

Parameters

$cachedir
string
$cachedir [optional] Directory to cache files
$cachegroup
string
$cachegroup [optional] Subdirectory to cache files
$cacheprefix
string
$cacheprefix [optional] Prefixname to add to cached files
public mixed
# enable( boolean $enable = NULL )

Get/Set the flag to enable caching.

Get/Set the flag to enable caching.

Parameters

$enable
boolean
$enable [optional] True to enable caching or false

Returns

mixed
Enable flag or void
public mixed
# debug( boolean $debug )

Get/Set the flag to debug cache object (prints out miss/hit state with execution time).

Get/Set the flag to debug cache object (prints out miss/hit state with execution time).

Parameters

$debug
boolean
$debug True to activate debugging or false.

Returns

mixed
Debug flag or void
public string
# htmlComment( boolean $htmlcomment )

Get/Set flag to print out cache info as html comment.

Get/Set flag to print out cache info as html comment.

Parameters

$htmlcomment
boolean
$htmlcomment True debugging or false.

Returns

string
Htmlcomment flag or void
public mixed
# lifetime( integer $seconds = NULL )

Get/Set caching lifetime in seconds.

Get/Set caching lifetime in seconds.

Parameters

$seconds
integer
$seconds [optional] New Lifetime in seconds

Returns

mixed
Actual lifetime or void
public
# infoTemplate( string $template )

Get/Set template to use on printing the chache info.

Get/Set template to use on printing the chache info.

Parameters

$template
string
$template Template string including the '%s' format definition.
public
# addOption( string $name, string $option )

Add option for caching (e.g. $_GET,$_POST, $_COOKIE, ...).

Add option for caching (e.g. $_GET,$_POST, $_COOKIE, ...).

Used to generate the id for caching.

Parameters

$name
string
$name Name of option
$option
string
$option Value of option (any variable)
public string
# getInfo( )

Returns information cache hit/miss and execution time if caching is enabled.

Returns information cache hit/miss and execution time if caching is enabled.

Returns

string
Information about cache if caching is enabled, otherwise nothing.
protected boolean|string
# _start( )

Starts the cache process.

Starts the cache process.

Returns

boolean|string

Throws

cInvalidArgumentException
public
# start( integer $iPageStartTime = NULL )

Handles PEAR caching.

Handles PEAR caching.

The script will be terminated by calling die(), if any cached content is found.

Parameters

$iPageStartTime
integer
$iPageStartTime [optional] Optional start time, e.g. start time of main script

Throws

cInvalidArgumentException
public
# end( )

Handles ending of PEAR caching.

Handles ending of PEAR caching.

Throws

cInvalidArgumentException
public
# removeFromCache( )

Removes any cached content if exists.

Removes any cached content if exists.

This is nesessary to delete cached articles, if they are changed on backend.

Throws

cInvalidArgumentException
protected
# _initFileCache( )

Creates one-time a instance of PEAR cache output object and also the unique id, if propery $this->_oPearCache is not set.

Creates one-time a instance of PEAR cache output object and also the unique id, if propery $this->_oPearCache is not set.

protected
# _raiseEvent( string $name )

Raises any defined event code by using eval().

Raises any defined event code by using eval().

Parameters

$name
string
$name Name of event to raise
protected float
# _getMicroTime( )

Returns microtime (UNIX timestamp), used to calculate time of execution.

Returns microtime (UNIX timestamp), used to calculate time of execution.

Returns

float
Timestamp
Properties summary
protected cFileCache $_fileCache
#

File cache object.

File cache object.

protected boolean $_bEnableCaching false
#

Flag to activate caching.

Flag to activate caching.

protected boolean $_bDebug false
#

Flag for output of debug informations.

Flag for output of debug informations.

protected boolean $_bHtmlComment false
#

Flag to print html comment including some debug informations.

Flag to print html comment including some debug informations.

protected integer $_iStartTime
#

Start time of caching.

Start time of caching.

protected array $_aIDOptions
#

Option array for generating cache identifier (e.g. $_GET,$_POST, $_COOKIE, ...).

Option array for generating cache identifier (e.g. $_GET,$_POST, $_COOKIE, ...).

protected array $_aCacheOptions
#

Option array for pear caching.

Option array for pear caching.

protected array $_aEventCode
#

Handler array to store code, beeing executed on some hooks. We have actually two hooks:

  • 'beforeoutput': code to execute before doing the output
  • 'afteroutput' code to execute after output

Handler array to store code, beeing executed on some hooks. We have actually two hooks:

  • 'beforeoutput': code to execute before doing the output
  • 'afteroutput' code to execute after output
protected string $_sID
#

Unique identifier for caching.

Unique identifier for caching.

protected string $_sDir 'cache/'
#

Directory to store cached output.

Directory to store cached output.

protected string $_sGroup 'default'
#

Subdirectory to store cached output.

Subdirectory to store cached output.

protected string $_sPrefix 'cache_output_'
#

Substring to add as prefix to cache-filename.

Substring to add as prefix to cache-filename.

protected integer $_iLifetime 3600
#

Default lifetime of cached files.

Default lifetime of cached files.

protected string $_sDebugMsg ''
#

Used to store debug message.

Used to store debug message.

protected string $_sDebugTpl '<div>%s</div>'
#

HTML code template used for debug message.

HTML code template used for debug message.

protected string $_sHtmlCommentTpl ' <!-- CACHESTATE: %s TIME: %s VALID UNTIL: %s --> '
#

HTML comment template used for generating some debug infos.

HTML comment template used for generating some debug infos.

CMS CONTENIDO 4.10.1 API documentation generated by ApiGen 2.8.0