CakePHP
  • Documentation
    • Book
    • API
    • Videos
    • Reporting Security Issues
    • Privacy Policy
    • Logos & Trademarks
  • Business Solutions
  • Swag
  • Road Trip
  • Team
  • Community
    • Community
    • Get Involved
    • Issues (GitHub)
    • Bakery
    • Featured Resources
    • Training
    • Meetups
    • My CakePHP
    • CakeFest
    • Newsletter
    • Linkedin
    • YouTube
    • Facebook
    • Twitter
    • Mastodon
    • Help & Support
    • Forum
    • Stack Overflow
    • Slack
    • Paid Support
CakePHP

C CakePHP 2.2 API

  • Overview
  • Tree
  • Deprecated
  • Version:
    • 2.2
      • 4.2
      • 4.1
      • 4.0
      • 3.9
      • 3.8
      • 3.7
      • 3.6
      • 3.5
      • 3.4
      • 3.3
      • 3.2
      • 3.1
      • 3.0
      • 2.10
      • 2.9
      • 2.8
      • 2.7
      • 2.6
      • 2.5
      • 2.4
      • 2.3
      • 2.2
      • 2.1
      • 2.0
      • 1.3
      • 1.2

Packages

  • Cake
    • Cache
      • Engine
    • Configure
    • Console
      • Command
        • Task
    • Controller
      • Component
        • Acl
        • Auth
    • Core
    • Error
    • Event
    • I18n
    • Log
      • Engine
    • Model
      • Behavior
      • Datasource
        • Database
        • Session
      • Validator
    • Network
      • Email
      • Http
    • Routing
      • Filter
      • Route
    • TestSuite
      • Coverage
      • Fixture
      • Reporter
    • Utility
    • View
      • Helper

Classes

  • ApcEngine
  • FileEngine
  • MemcacheEngine
  • RedisEngine
  • WincacheEngine
  • XcacheEngine

Class RedisEngine

Redis storage engine for cache.

CacheEngine
Extended by RedisEngine
Package: Cake\Cache\Engine
Copyright: Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
License: License (http://www.opensource.org/licenses/mit-license.php)
Location: Cake/Cache/Engine/RedisEngine.php

Properties summary

  • $_Redis protected
    Redis
    Redis wrapper.
  • $settings public
    array
    Settings

Inherited Properties

  • _groupPrefix

Method Summary

  • __destruct() public
    Disconnects from the redis server
  • _connect() protected
    Connects to a Redis server
  • clear() public
    Delete all keys from the cache
  • clearGroup() public

    Increments the group value to simulate deletion of all keys under a group old values will remain in storage until they expire.

  • decrement() public
    Decrements the value of an integer cached key
  • delete() public
    Delete a key from the cache
  • groups() public

    Returns the group value for each of the configured groups If the group initial value was not found, then it initializes the group accordingly.

  • increment() public
    Increments the value of an integer cached key
  • init() public
    Initialize the Cache Engine
  • read() public
    Read a key from the cache
  • write() public
    Write data for key into cache.

Method Detail

__destruct() public ¶

__destruct( )

Disconnects from the redis server

Returns
voind

_connect() protected ¶

_connect( )

Connects to a Redis server

Returns
boolean
True if Redis server was connected

clear() public ¶

clear( boolean $check )

Delete all keys from the cache

Parameters
boolean $check
Returns
boolean
True if the cache was successfully cleared, false otherwise

clearGroup() public ¶

clearGroup( string $group )

Increments the group value to simulate deletion of all keys under a group old values will remain in storage until they expire.

Parameters
string $group
$groups name of the group to be cleared
Returns
boolean
success
Overrides
CacheEngine::clearGroup()

decrement() public ¶

decrement( string $key , integer $offset = 1 )

Decrements the value of an integer cached key

Parameters
string $key
Identifier for the data
integer $offset optional 1
How much to subtract
Returns
New
decremented value, false otherwise
Throws
CacheException
when you try to decrement with compress = true

delete() public ¶

delete( string $key )

Delete a key from the cache

Parameters
string $key
Identifier for the data
Returns
boolean
True if the value was successfully deleted, false if it didn't exist or couldn't be removed

groups() public ¶

groups( )

Returns the group value for each of the configured groups If the group initial value was not found, then it initializes the group accordingly.

Returns
array
Overrides
CacheEngine::groups()

increment() public ¶

increment( string $key , integer $offset = 1 )

Increments the value of an integer cached key

Parameters
string $key
Identifier for the data
integer $offset optional 1
How much to increment
Returns
New
incremented value, false otherwise
Throws
CacheException
when you try to increment with compress = true

init() public ¶

init( array $settings = array() )

Initialize the Cache Engine

Called automatically by the cache frontend To reinitialize the settings call Cache::engine('EngineName', [optional] settings = array());

Parameters
array $settings optional array()
array of setting for the engine
Returns
boolean
True if the engine has been successfully initialized, false if not
Overrides
CacheEngine::init()

read() public ¶

read( string $key )

Read a key from the cache

Parameters
string $key
Identifier for the data
Returns
mixed
The cached data, or false if the data doesn't exist, has expired, or if there was an error fetching it

write() public ¶

write( string $key , mixed $value , integer $duration )

Write data for key into cache.

Parameters
string $key
Identifier for the data
mixed $value
Data to be cached
integer $duration
How long to cache the data, in seconds
Returns
boolean
True if the data was successfully cached, false on failure

Methods inherited from CacheEngine

gc() public ¶

gc( integer $expires = null )

Garbage collection

Permanently remove all expired and deleted data

Parameters
integer $expires optional null
[optional] An expires timestamp, invalidataing all data before.

key() public ¶

key( string $key )

Generates a safe key for use with cache engine storage engines.

Parameters
string $key
the key passed over
Returns
mixed
string $key or false

settings() public ¶

settings( )

Cache Engine settings

Returns
array
settings

Properties detail

$_Redis ¶

protected Redis

Redis wrapper.

null

$settings ¶

public array

Settings

  • server = string url or ip to the Redis server host
    • port = integer port number to the Redis server (default: 6379)
    • timeout = float timeout in seconds (default: 0)
    • persistent = bool Connects to the Redis server with a persistent connection (default: true)
array()
OpenHub
Rackspace
Rackspace
  • Business Solutions
  • Showcase
  • Documentation
  • Book
  • API
  • Videos
  • Reporting Security Issues
  • Privacy Policy
  • Logos & Trademarks
  • Community
  • Get Involved
  • Issues (GitHub)
  • Bakery
  • Featured Resources
  • Training
  • Meetups
  • My CakePHP
  • CakeFest
  • Newsletter
  • Linkedin
  • YouTube
  • Facebook
  • Twitter
  • Mastodon
  • Help & Support
  • Forum
  • Stack Overflow
  • Slack
  • Paid Support

Generated using CakePHP API Docs