首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

Memcached (class)

Introduction

(PECL memcached >= 0.1.0)

Represents a connection to a set of memcached servers.

Class synopsis

Memcached {

public __construct ( string $persistent_id )

代码语言:javascript
复制
public bool add ( string $key , mixed $value [, int $expiration ] )
代码语言:javascript
复制
public bool addByKey ( string $server_key , string $key , mixed $value [, int $expiration ] )
代码语言:javascript
复制
public bool addServer ( string $host , int $port [, int $weight = 0 ] )
代码语言:javascript
复制
public bool addServers ( array $servers )
代码语言:javascript
复制
public bool append ( string $key , string $value )
代码语言:javascript
复制
public bool appendByKey ( string $server_key , string $key , string $value )
代码语言:javascript
复制
public bool cas ( float $cas_token , string $key , mixed $value [, int $expiration ] )
代码语言:javascript
复制
public bool casByKey ( float $cas_token , string $server_key , string $key , mixed $value [, int $expiration ] )
代码语言:javascript
复制
public int decrement ( string $key [, int $offset = 1 [, int $initial_value = 0 [, int $expiry = 0 ]]] )
代码语言:javascript
复制
public int decrementByKey ( string $server_key , string $key [, int $offset = 1 [, int $initial_value = 0 [, int $expiry = 0 ]]] )
代码语言:javascript
复制
public bool delete ( string $key [, int $time = 0 ] )
代码语言:javascript
复制
public bool deleteByKey ( string $server_key , string $key [, int $time = 0 ] )
代码语言:javascript
复制
public array deleteMulti ( array $keys [, int $time = 0 ] )
代码语言:javascript
复制
public bool deleteMultiByKey ( string $server_key , array $keys [, int $time = 0 ] )
代码语言:javascript
复制
public array fetch ( void )
代码语言:javascript
复制
public array fetchAll ( void )
代码语言:javascript
复制
public bool flush ([ int $delay = 0 ] )
代码语言:javascript
复制
public mixed get ( string $key [, callable $cache_cb [, int $$flags ]] )
代码语言:javascript
复制
public array getAllKeys ( void )
代码语言:javascript
复制
public mixed getByKey ( string $server_key , string $key [, callable $cache_cb [, int $flags ]] )
代码语言:javascript
复制
public bool getDelayed ( array $keys [, bool $with_cas [, callable $value_cb ]] )
代码语言:javascript
复制
public bool getDelayedByKey ( string $server_key , array $keys [, bool $with_cas [, callable $value_cb ]] )
代码语言:javascript
复制
public mixed getMulti ( array $keys [, int $flags ] )
代码语言:javascript
复制
public array getMultiByKey ( string $server_key , array $keys [, int $flags ] )
代码语言:javascript
复制
public mixed getOption ( int $option )
代码语言:javascript
复制
public int getResultCode ( void )
代码语言:javascript
复制
public string getResultMessage ( void )
代码语言:javascript
复制
public array getServerByKey ( string $server_key )
代码语言:javascript
复制
public array getServerList ( void )
代码语言:javascript
复制
public array getStats ( void )
代码语言:javascript
复制
public array getVersion ( void )
代码语言:javascript
复制
public int increment ( string $key [, int $offset = 1 [, int $initial_value = 0 [, int $expiry = 0 ]]] )
代码语言:javascript
复制
public int incrementByKey ( string $server_key , string $key [, int $offset = 1 [, int $initial_value = 0 [, int $expiry = 0 ]]] )
代码语言:javascript
复制
public bool isPersistent ( void )
代码语言:javascript
复制
public bool isPristine ( void )
代码语言:javascript
复制
public bool prepend ( string $key , string $value )
代码语言:javascript
复制
public bool prependByKey ( string $server_key , string $key , string $value )
代码语言:javascript
复制
public bool quit ( void )
代码语言:javascript
复制
public bool replace ( string $key , mixed $value [, int $expiration ] )
代码语言:javascript
复制
public bool replaceByKey ( string $server_key , string $key , mixed $value [, int $expiration ] )
代码语言:javascript
复制
public bool resetServerList ( void )
代码语言:javascript
复制
public bool set ( string $key , mixed $value [, int $expiration ] )
代码语言:javascript
复制
public bool setByKey ( string $server_key , string $key , mixed $value [, int $expiration ] )
代码语言:javascript
复制
public bool setMulti ( array $items [, int $expiration ] )
代码语言:javascript
复制
public bool setMultiByKey ( string $server_key , array $items [, int $expiration ] )
代码语言:javascript
复制
public bool setOption ( int $option , mixed $value )
代码语言:javascript
复制
public bool setOptions ( array $options )
代码语言:javascript
复制
public void setSaslAuthData ( string $username , string $password )
代码语言:javascript
复制
public bool touch ( string $key , int $expiration )
代码语言:javascript
复制
public bool touchByKey ( string $server_key , string $key , int $expiration )

}

Table of Contents

  • Memcached::add — Add an item under a new key
  • Memcached::addByKey — Add an item under a new key on a specific server
  • Memcached::addServer — Add a server to the server pool
  • Memcached::addServers — Add multiple servers to the server pool
  • Memcached::append — Append data to an existing item
  • Memcached::appendByKey — Append data to an existing item on a specific server
  • Memcached::cas — Compare and swap an item
  • Memcached::casByKey — Compare and swap an item on a specific server
  • Memcached::__construct — Create a Memcached instance
  • Memcached::decrement — Decrement numeric item's value
  • Memcached::decrementByKey — Decrement numeric item's value, stored on a specific server
  • Memcached::delete — Delete an item
  • Memcached::deleteByKey — Delete an item from a specific server
  • Memcached::deleteMulti — Delete multiple items
  • Memcached::deleteMultiByKey — Delete multiple items from a specific server
  • Memcached::fetch — Fetch the next result
  • Memcached::fetchAll — Fetch all the remaining results
  • Memcached::flush — Invalidate all items in the cache
  • Memcached::get — Retrieve an item
  • Memcached::getAllKeys — Gets the keys stored on all the servers
  • Memcached::getByKey — Retrieve an item from a specific server
  • Memcached::getDelayed — Request multiple items
  • Memcached::getDelayedByKey — Request multiple items from a specific server
  • Memcached::getMulti — Retrieve multiple items
  • Memcached::getMultiByKey — Retrieve multiple items from a specific server
  • Memcached::getOption — Retrieve a Memcached option value
  • Memcached::getResultCode — Return the result code of the last operation
  • Memcached::getResultMessage — Return the message describing the result of the last operation
  • Memcached::getServerByKey — Map a key to a server
  • Memcached::getServerList — Get the list of the servers in the pool
  • Memcached::getStats — Get server pool statistics
  • Memcached::getVersion — Get server pool version info
  • Memcached::increment — Increment numeric item's value
  • Memcached::incrementByKey — Increment numeric item's value, stored on a specific server
  • Memcached::isPersistent — Check if a persitent connection to memcache is being used
  • Memcached::isPristine — Check if the instance was recently created
  • Memcached::prepend — Prepend data to an existing item
  • Memcached::prependByKey — Prepend data to an existing item on a specific server
  • Memcached::quit — Close any open connections
  • Memcached::replace — Replace the item under an existing key
  • Memcached::replaceByKey — Replace the item under an existing key on a specific server
  • Memcached::resetServerList — Clears all servers from the server list
  • Memcached::set — Store an item
  • Memcached::setByKey — Store an item on a specific server
  • Memcached::setMulti — Store multiple items
  • Memcached::setMultiByKey — Store multiple items on a specific server
  • Memcached::setOption — Set a Memcached option
  • Memcached::setOptions — Set Memcached options
  • Memcached::setSaslAuthData — Set the credentials to use for authentication
  • Memcached::touch — Set a new expiration on an item
  • Memcached::touchByKey — Set a new expiration on an item on a specific server

Memcached::add →

代码语言:txt
复制
 ? 1997–2017 The PHP Documentation Group

Licensed under the Creative Commons Attribution License v3.0 or later.

扫码关注腾讯云开发者

领取腾讯云代金券

http://www.vxiaotou.com