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.1 API

  • Overview
  • Tree
  • Deprecated
  • Version:
    • 2.1
      • 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
    • Network
      • Email
      • Http
    • Routing
      • Route
    • TestSuite
      • Coverage
      • Fixture
      • Reporter
    • Utility
    • View
      • Helper

Classes

  • Cache
  • CacheEngine

Class CacheEngine

Storage engine for CakePHP caching

Direct Subclasses
  • ApcEngine
  • FileEngine
  • MemcacheEngine
  • WincacheEngine
  • XcacheEngine
Abstract
Package: Cake\Cache
Copyright: Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
License: License (http://www.opensource.org/licenses/mit-license.php)
Location: Cake/Cache/CacheEngine.php

Properties summary

  • $settings public
    array
    Settings of current engine instance

Method Summary

  • clear() abstract public
    Delete all keys from the cache
  • decrement() abstract public
    Decrement a number under the key and return decremented value
  • delete() abstract public
    Delete a key from the cache
  • gc() public
    Garbage collection
  • increment() abstract public
    Increment a number under the key and return incremented value
  • init() public
    Initialize the cache engine
  • key() public
    Generates a safe key for use with cache engine storage engines.
  • read() abstract public
    Read a key from the cache
  • settings() public
    Cache Engine settings
  • write() abstract public
    Write value for a key into cache

Method Detail

clear() abstract public ¶

clear( boolean $check )

Delete all keys from the cache

Parameters
boolean $check
if true will check expiration, otherwise delete all
Returns
boolean
True if the cache was successfully cleared, false otherwise

decrement() abstract public ¶

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

Decrement a number under the key and return decremented value

Parameters
string $key
Identifier for the data
integer $offset optional 1
How much to subtract
Returns
New
incremented value, false otherwise

delete() abstract 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

gc() public ¶

gc( )

Garbage collection

Permanently remove all expired and deleted data

increment() abstract public ¶

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

Increment a number under the key and return incremented value

Parameters
string $key
Identifier for the data
integer $offset optional 1
How much to add
Returns
New
incremented value, false otherwise

init() public ¶

init( array $settings = array() )

Initialize the cache engine

Called automatically by the cache frontend

Parameters
array $settings optional array()
Associative array of parameters for the engine
Returns
boolean
True if the engine has been successfully initialized, false if not

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

read() abstract 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

settings() public ¶

settings( )

Cache Engine settings

Returns
array
settings

write() abstract public ¶

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

Write value for a key into cache

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

Properties detail

$settings ¶

public array

Settings of current engine instance

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