Please note that the contents of this offline web site may be out of date. To access the most recent documentation visit the online version .
Note that links that point to online resources are green in color and will open in a new window.
We would love it if you could give us feedback about this material by filling this form (You have to be online to fill it)



google/appengine/ext/session/MemcacheSessionHandler.php

Table of Contents
Copyright 2007 Google Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

\google\appengine\ext\session\MemcacheContainer

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

Methods

method public __construct () : void

Initialises a Memcache instance

method public close () : bool

Closes the Memcache instance.

Returns
Type Description
bool true if successful, false otherwise
method public delete (string $key) : bool

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

Parameters
Name Type Description
$key string

Input key to remove key value pair

Returns
Type Description
bool true if successful, false otherwise
method public get (string $key) : string

Finds the value associated with input key, from Memcache.

Parameters
Name Type Description
$key string

Input key from which to find value

Returns
Type Description
string value associated with input key
method public set (string $key, string $value, int $expire) : bool

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

Parameters
Name Type Description
$key string

Input key to associate with the value

$value string

Input value to be stored

$expire int

Time until the pair can be garbage collected

Returns
Type Description
bool true if successful, false otherwise

\google\appengine\ext\session\MemcacheSessionHandler

Package: Default
A session handler interface using the GAE Memcache API.
Implements

Constants

> V Constant SESSION_PREFIX = '_ah_sess_'

Methods

method public __construct ( \google\appengine\ext\session\MemcacheContainer $memcacheContainer = null) : void

Constructs the session handler instance.

Parameters
Name Type Description
$memcacheContainer \google\appengine\ext\session\MemcacheContainer

Optional, for mocking in tests

method public close () : bool

Closes the session handler.

Returns
Type Description
bool true if successful, false otherwise
method public configure ( \google\appengine\ext\session\MemcacheContainer $memcacheContainer = null) : void
static

Configure the session handler to use the Memcache API.

Parameters
Name Type Description
$memcacheContainer \google\appengine\ext\session\MemcacheContainer

Optional, for mocking in tests

method public destroy (string $id) : bool

Destroy the data associated with a particular session ID.

Parameters
Name Type Description
$id string

Session ID associated with the data to be destroyed

Returns
Type Description
bool true if successful, false otherwise
method public gc (int $maxlifetime) : bool

Garbage collection method - always returns true as this is handled by the Memcache expire function.

Parameters
Name Type Description
$maxlifetime int

Not used

Returns
Type Description
bool true if successful, false otherwise
method public open (string $savePath, string $sessionName) : bool

Opens the session handler.

Parameters
Name Type Description
$savePath string

Not used

$sessionName string

Not ued

Returns
Type Description
bool true if successful, false otherwise
method public read (string $id) : string

Read an element from Memcache with the given ID.

Parameters
Name Type Description
$id string

Session ID associated with the data to be retrieved

Returns
Type Description
string data associated with that ID or bool false on failure
method public write (string $id, string $data) : bool

Write an element to Memcache with the given ID and data.

Parameters
Name Type Description
$id string

Session ID associated with the data to be stored

$data string

Data to be stored

Returns
Type Description
bool true if successful, false otherwise
Documentation was generated by phpDocumentor 2.0.0a12 .