Notice: Over the next few months, we're reorganizing the App Engine documentation site to make it easier to find content and better align with the rest of Google Cloud products. The same content will be available, but the navigation will now match the rest of the Cloud products. If you have feedback or questions as you navigate the site, click Send Feedback.

As PHP version 5.5 is no longer supported by the community, we strongly recommend new apps use the PHP 7+ runtime.

\google\appengine\ext\session\MemcacheContainer

FINAL

Remove direct interaction with Memcache object for ease of mocking in tests.

Methods

__construct

__construct()

Initialises a Memcache instance

close

close() : boolean

Closes the Memcache instance.

Returns

boolean

true if successful, false otherwise

get

get(string $key) : string

Finds the value associated with input key, from Memcache.

Parameters

Name Description

$key

string

Input key from which to find value

Returns

string

value associated with input key

set

set(string $key, string $value, integer $expire) : boolean

Inserts a key value pair, with expiry time, into Memcache.

Parameters

Name Description

$key

string

Input key to associate with the value

$value

string

Input value to be stored

$expire

integer

Time until the pair can be garbage collected

Returns

boolean

true if successful, false otherwise

delete

delete(string $key) : boolean

Removes the key value pair, keyed with the input variable.

Parameters

Name Description

$key

string

Input key to remove key value pair

Returns

boolean

true if successful, false otherwise