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

  • Access
  • CacheManager
  • DriverList
  • Legacy
  • Overview
  • Namespace
  • Class
  • Tree

Class Access

Provides a standardized cache access

Namespace: Xoops\Core\Cache
Package: Cache
Category: Xoops\Core\Cache
Copyright: 2015 The XOOPS Project https://github.com/XOOPS
License: GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
Author: Richard Griffith richard@geekwright.com
Link: http://xoops.org
Located at oops_lib/Xoops/Core/Cache/Access.php
Methods summary
public
# __construct( Stash\Interfaces\PoolInterface $pool )

__construct

__construct

Parameters

$pool
$pool cache pool to use for this cache instance
public boolean
# write( string|string[] $key, mixed $value, integer|DateTime|null $ttl = null )

Write data for key into cache.

Write data for key into cache.

Parameters

$key
Identifier for the cache item
$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|string[] $key )

Read a key from the cache.

Read a key from the cache.

Parameters

$key
Identifier for the cache item

Returns

mixed
The cached data
public boolean
# delete( string|string[] $key )

Delete a key from the cache.

Delete a key from the cache.

Parameters

$key
Identifier for the cache item

Returns

boolean
True if the value was successfully deleted, false if it didn't exist or couldn't be removed
public mixed
# cacheRead( string|string[] $cacheKey, callable $regenFunction, integer|DateTime|null $ttl = null, mixed $args = null )

cache block wrapper using Invalidation::PRECOMPUTE

cache block wrapper using Invalidation::PRECOMPUTE

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
# garbageCollect( )

Garbage collection - remove all expired and deleted data

Garbage collection - remove all expired and deleted data

public boolean
# clear( )

clear all keys and data from the cache.

clear all keys and data from the cache.

Returns

boolean
True if the cache was successfully cleared, false otherwise
public Stash\Interfaces\PoolInterface
# pool( )

direct access to pool

direct access to pool

WARNING: this is intended for diagnostics and similar advanced uses. Depending on direct access to the pool may break future compatibility.

Returns

Stash\Interfaces\PoolInterface
the current pool
Properties summary
protected Stash\Interfaces\PoolInterface $pool

Cache pools

Cache pools

# null
API documentation generated by ApiGen