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 1.3 API

  • Overview
  • Tree
  • Deprecated
  • Version:
    • 1.3
      • 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

Classes

  • AclBase
  • AclBehavior
  • AclComponent
  • AclNode
  • AclShell
  • Aco
  • AcoAction
  • AjaxHelper
  • ApcEngine
  • ApiShell
  • App
  • AppController
  • AppHelper
  • AppModel
  • Aro
  • AuthComponent
  • BakeShell
  • BakeTask
  • BehaviorCollection
  • Cache
  • CacheEngine
  • CacheHelper
  • CakeErrorController
  • CakeLog
  • CakeRoute
  • CakeSchema
  • CakeSession
  • CakeSocket
  • ClassRegistry
  • Component
  • Configure
  • ConnectionManager
  • ConsoleShell
  • ContainableBehavior
  • Controller
  • ControllerTask
  • CookieComponent
  • DataSource
  • DbAcl
  • DbConfigTask
  • DboMssql
  • DboMysql
  • DboMysqlBase
  • DboMysqli
  • DboOracle
  • DboPostgres
  • DboSource
  • DboSqlite
  • Debugger
  • EmailComponent
  • ErrorHandler
  • ExtractTask
  • File
  • FileEngine
  • FileLog
  • FixtureTask
  • Folder
  • FormHelper
  • Helper
  • HtmlHelper
  • HttpSocket
  • I18n
  • I18nModel
  • I18nShell
  • Inflector
  • IniAcl
  • JavascriptHelper
  • JqueryEngineHelper
  • JsBaseEngineHelper
  • JsHelper
  • L10n
  • MagicDb
  • MagicFileResource
  • MediaView
  • MemcacheEngine
  • Model
  • ModelBehavior
  • ModelTask
  • MootoolsEngineHelper
  • Multibyte
  • NumberHelper
  • Object
  • Overloadable
  • Overloadable2
  • PagesController
  • PaginatorHelper
  • Permission
  • PluginShortRoute
  • PluginTask
  • ProjectTask
  • PrototypeEngineHelper
  • RequestHandlerComponent
  • Router
  • RssHelper
  • Sanitize
  • Scaffold
  • ScaffoldView
  • SchemaShell
  • Security
  • SecurityComponent
  • SessionComponent
  • SessionHelper
  • Set
  • Shell
  • String
  • TemplateTask
  • TestSuiteShell
  • TestTask
  • TextHelper
  • ThemeView
  • TimeHelper
  • TranslateBehavior
  • TreeBehavior
  • Validation
  • View
  • ViewTask
  • XcacheEngine
  • Xml
  • XmlElement
  • XmlHelper
  • XmlManager
  • XmlNode
  • XmlTextNode

Functions

  • mb_encode_mimeheader
  • mb_stripos
  • mb_stristr
  • mb_strlen
  • mb_strpos
  • mb_strrchr
  • mb_strrichr
  • mb_strripos
  • mb_strrpos
  • mb_strstr
  • mb_strtolower
  • mb_strtoupper
  • mb_substr
  • mb_substr_count

Class MemcacheEngine

Memcache storage engine for cache. Memcache has some limitations in the amount of control you have over expire times far in the future. See MemcacheEngine::write() for more information.

CacheEngine
Extended by MemcacheEngine
Package: cake\cake\libs\cache
Copyright: Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
License: License (http://www.opensource.org/licenses/mit-license.php)
Location: cache/memcache.php

Properties summary

  • $__Memcache public
    Memcache
    Memcache wrapper.
  • $settings public
    array
    Settings

Method Summary

  • _parseServerString() public

    Parses the server address into the host/port. Handles both IPv6 and IPv4 addresses and Unix sockets

  • clear() public
    Delete all keys from the cache
  • connect() public
    Connects to a server in connection pool
  • decrement() public
    Decrements the value of an integer cached key
  • delete() public
    Delete a key from the cache
  • 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. When using memcache as your cache engine remember that the Memcache pecl extension does not support cache expiry times greater than 30 days in the future. Any duration greater than 30 days will be treated as never expiring.

Method Detail

_parseServerString() public ¶

_parseServerString( string $server )

Parses the server address into the host/port. Handles both IPv6 and IPv4 addresses and Unix sockets

Parameters
string $server
The server address string.
Returns
array
Array containing host, port

clear() public ¶

clear( )

Delete all keys from the cache

Returns
boolean
True if the cache was succesfully cleared, false otherwise
Overrides
CacheEngine::clear()

connect() public ¶

connect( string $host , integer $port = 11211 )

Connects to a server in connection pool

Parameters
string $host
host ip address or name
integer $port optional 11211
Server port
Returns
boolean
True if memcache server was connected

decrement() public ¶

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

Decrements the value of an integer cached key

Parameters
string $key
Identifier for the data
integer $offset optional 1
How much to substract
integer $duration ,…
How long to cache the data, in seconds
Returns
New
decremented value, false otherwise
Overrides
CacheEngine::decrement()

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 succesfully deleted, false if it didn't exist or couldn't be removed
Overrides
CacheEngine::delete()

increment() public ¶

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

Increments the value of an integer cached key

Parameters
string $key
Identifier for the data
integer $offset optional 1
How much to increment
integer $duration ,…
How long to cache the data, in seconds
Returns
New
incremented value, false otherwise
Overrides
CacheEngine::increment()

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()
$setting 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
Overrides
CacheEngine::read()

write() public ¶

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

Write data for key into cache. When using memcache as your cache engine remember that the Memcache pecl extension does not support cache expiry times greater than 30 days in the future. Any duration greater than 30 days will be treated as never expiring.

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 succesfully cached, false on failure
See
http://php.net/manual/en/memcache.set.php
Overrides
CacheEngine::write()

Methods inherited from CacheEngine

gc() public ¶

gc( )

Garbage collection

Permanently remove all expired and deleted data

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

$__Memcache ¶

public Memcache

Memcache wrapper.

null

$settings ¶

public array

Settings

  • servers = string or array of memcache servers, default => 127.0.0.1. If an array MemcacheEngine will use them as a pool.
    • compress = boolean, default => false
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