Documentation

Memcached extends AbstractAdapter
in package

Memcached cache adapter class

Tags
category

Pop

author

Nick Sagona, III dev@nolainteractive.com

copyright

Copyright (c) 2009-2021 NOLA Interactive, LLC. (http://www.nolainteractive.com)

license

http://www.popphp.org/license New BSD License

version
3.4.0

Table of Contents

$memcached  : Memcached
Memcached object
$ttl  : int
Global time-to-live
$version  : string
Memcached version
__construct()  : mixed
Constructor
addServer()  : Memcached
Get the current version of memcached.
addServers()  : Memcached
Get the current version of memcached.
clear()  : Memcached
Clear all stored values from cache
deleteItem()  : Memcached
Delete a value in cache
destroy()  : Memcached
Destroy cache resource
getItem()  : mixed
Get an item from cache
getItemTtl()  : int
Get the time-to-live for an item in cache
getTtl()  : int
Get the global time-to-live for the cache object
getVersion()  : string
Get the current version of memcached.
hasItem()  : bool
Determine if the item exist in cache
memcached()  : Memcached
Get the memcached object.
saveItem()  : Memcached
Save an item to cache
setTtl()  : AbstractAdapter
Set the global time-to-live for the cache adapter

Properties

$memcached

Memcached object

protected Memcached $memcached = null

$version

Memcached version

protected string $version = null

Methods

__construct()

Constructor

public __construct(int $ttl[, string $host = 'localhost' ][, int $port = 11211 ][, int $weight = 1 ]) : mixed

Instantiate the memcached cache object

Parameters
$ttl : int
$host : string = 'localhost'
$port : int = 11211
$weight : int = 1
Tags
throws
Exception
Return values
mixed

addServer()

Get the current version of memcached.

public addServer(string $host[, int $port = 11211 ][, int $weight = 1 ]) : Memcached
Parameters
$host : string
$port : int = 11211
$weight : int = 1
Return values
Memcached

addServers()

Get the current version of memcached.

public addServers(array<string|int, mixed> $servers) : Memcached
Parameters
$servers : array<string|int, mixed>
Return values
Memcached

getItem()

Get an item from cache

public getItem(string $id) : mixed
Parameters
$id : string
Return values
mixed

getItemTtl()

Get the time-to-live for an item in cache

public getItemTtl(string $id) : int
Parameters
$id : string
Return values
int

getTtl()

Get the global time-to-live for the cache object

public getTtl() : int
Return values
int

getVersion()

Get the current version of memcached.

public getVersion() : string
Return values
string

hasItem()

Determine if the item exist in cache

public hasItem(string $id) : bool
Parameters
$id : string
Return values
bool

memcached()

Get the memcached object.

public memcached() : Memcached
Return values
Memcached

saveItem()

Save an item to cache

public saveItem(string $id, mixed $value[, int $ttl = null ]) : Memcached
Parameters
$id : string
$value : mixed
$ttl : int = null
Return values
Memcached

Search results