Documentation

Memcached extends AbstractAdapter
in package

Memcached cache adapter class

Tags
category

Pop

author

Nick Sagona, III dev@nolainteractive.com

copyright

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

license

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

version
4.0.0

Table of Contents

Properties

$memcached  : Memcached|null
Memcached object
$ttl  : int
Global time-to-live
$version  : string|null
Memcached version

Methods

__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|null
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|null $memcached = null

$version

Memcached version

protected string|null $version = null

Methods

__construct()

Constructor

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

Instantiate the memcached cache object

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

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

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|null
Return values
string|null

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|null $ttl = null ]) : Memcached
Parameters
$id : string
$value : mixed
$ttl : int|null = null
Return values
Memcached

        
On this page

Search results