caching\MemCacheServer $host

$host public property Memcache server hostname or IP address public string $host = null

caching\MemCacheServer $port

$port public property Memcache server port public integer $port = 11211

caching\MemCacheServer $timeout

$timeout public property Timeout in milliseconds which will be used for connecting to the server. This is used by memcache only. For old versions of memcache that only support specifying timeout in seconds this will be rounded up to full seconds. public integer $timeout = 1000

caching\MemCache setValue()

setValue() protected method Stores a value identified by a key in cache. This is the implementation of the method declared in the parent class. See also \MemcachePool::set(). protected boolean setValue ( $key, $value, $duration )$key string The key identifying the value to be cached $value mixed The value to be cached. $duration integer The number of seconds in which the cached value will expire. 0 means never expire. return boolean True if the value is successfully stored into cac

caching\MemCache setValues()

setValues() protected method Stores multiple key-value pairs in cache. protected array setValues ( $data, $duration )$data array Array where key corresponds to cache key while value is the value stored $duration integer The number of seconds in which the cached values will expire. 0 means never expire. return array Array of failed keys. Always empty in case of using memcached.

caching\MemCacheServer $failureCallback

$failureCallback public property This callback function will run upon encountering an error. The callback is run before fail over is attempted. The function takes two parameters, the $host and the $port of the failed server. This is used by memcache only. public Closure $failureCallback = null

caching\MemCache getValue()

getValue() protected method Retrieves a value from cache with a specified key. This is the implementation of the method declared in the parent class. protected mixed|false getValue ( $key )$key string A unique key identifying the cached value return mixed|false The value stored in cache, false if the value is not in the cache or expired.

caching\MemCache init()

init() public method Initializes this application component. It creates the memcache instance and adds memcache servers. public void init ( )

caching\MemCache getValues()

getValues() protected method Retrieves multiple values from cache with the specified keys. protected array getValues ( $keys )$keys array A list of keys identifying the cached values return array A list of cached values indexed by the keys

caching\MemCache getServers()

getServers() public method Returns the memcache or memcached server configurations. public yii\caching\MemCacheServer[] getServers ( )return yii\caching\MemCacheServer[] List of memcache server configurations.