Overview

Namespaces

  • None
  • Xmf
    • Database
    • Module
      • Helper
    • Template
  • Xoops
    • Auth
    • Core
      • Cache
      • Database
        • Logging
        • Schema
      • Exception
      • Handler
        • Scheme
      • Kernel
        • Dtype
        • Handlers
        • Model
      • Lists
      • Locale
        • Punic
      • Service
        • Contract
      • Session
      • Text
        • Sanitizer
          • Extensions
      • Theme
        • Plugins
    • Form
    • Html
    • Locale
    • Module
      • Helper
      • Plugin

Classes

  • Admin
  • Cache
  • Helper
  • Permission
  • Session
  • Overview
  • Namespace
  • Class
  • Tree

Class Cache

Manage cache interaction in a module. Cache key will be prefixed with the module name to segregate it from keys set by other modules or system functions. Cache data is by definition serialized, so any arbitrary data (i.e. array, object) can be stored.

Xmf\Module\Helper\AbstractHelper
Extended by Xmf\Module\Cache
Namespace: Xmf\Module
Package: Xmf
Category: Xmf\Module\Helper\Cache
Copyright: 2011-2013 XOOPS Project (http://xoops.org)
License: GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
Author: trabis lusopoemas@gmail.com
Author: Richard Griffith richard@geekwright.com
Version: Release: 1.0
Since: 1.0
Link: http://xoops.org
Located at oops_lib/Xmf/Module/Cache.php
Methods summary
public
# init( )

Initialize parent::__constuct calls this after verifying module object.

Initialize parent::__constuct calls this after verifying module object.

public boolean
# write( string $key, mixed $value, integer|DateTime|null $ttl = null )

Write a value for a key to the cache

Write a value for a key to the cache

Parameters

$key
Identifier for the data
$value
Data to be cached - anything except a resource
$ttl

Time to live, integer for ttl in seconds, DateTime object to expire at a specific time, or null for

Returns

boolean
True if the data was successfully cached, false on failure
public mixed
# read( string $key )

Read value for a key from the cache

Read value for a key from the cache

Parameters

$key
Identifier for the data

Returns

mixed
value if key was set, false not set or expired
public
# delete( string $key )

Delete a key from the cache

Delete a key from the cache

Parameters

$key
Identifier for the data
public mixed
# cacheRead( string|string[] $cacheKey, callable $regenFunction, integer|DateTime|null $ttl = null, mixed $args = null )

cache block wrapper

cache block wrapper

If the cache read for $key is a miss, call the $regenFunction to update it. With the PRECOMPUTE strategy, it will trigger a miss on a read on one caller before the cache expires, so it will be done in advance.

Parameters

$cacheKey
Identifier for the cache item
$regenFunction
function to generate cached content
$ttl

time to live, number ofseconds as integer, DateTime to expire at a specific time, or null for default

$args
$args variable argument list for $regenFunction

Returns

mixed
public boolean
# clear( )

clear all keys and data from the module's cache. This will do a hierarchical delete on our module specific prefix.

clear all keys and data from the module's cache. This will do a hierarchical delete on our module specific prefix.

Returns

boolean
True if the cache was successfully cleared, false otherwise
Methods inherited from Xmf\Module\Helper\AbstractHelper
__construct(), addLog(), setDebug()
Properties summary
protected string[] $prefix
#
protected Xoops\Core\Cache\Access $cache
#
Properties inherited from Xmf\Module\Helper\AbstractHelper
$debug, $module
API documentation generated by ApiGen