\Zend_Server_Cache

Zend_Server_Cache: cache server definitions

Summary

Methods
Properties
Constants
save()
get()
delete()
No public properties found
No constants found
No protected methods found
$_skipMethods
N/A
No private methods found
No private properties found
N/A

Properties

$_skipMethods

$_skipMethods : array

Type

array — Methods to skip when caching server

Methods

save()

save(string  $filename, \Zend_Server_Interface  $server) : boolean

Cache a file containing the dispatch list.

Serializes the server definition stores the information in $filename.

Returns false on any error (typically, inability to write to file), true on success.

Parameters

string $filename
\Zend_Server_Interface $server

Returns

boolean

get()

get(string  $filename, \Zend_Server_Interface  $server) : boolean

Load server definition from a file

Unserializes a stored server definition from $filename. Returns false if it fails in any way, true on success.

Useful to prevent needing to build the server definition on each request. Sample usage:

if (!Zend_Server_Cache::get($filename, $server)) { require_once 'Some/Service/Class.php'; require_once 'Another/Service/Class.php';

// Attach Some_Service_Class with namespace 'some'
$server->attach('Some_Service_Class', 'some');

// Attach Another_Service_Class with namespace 'another'
$server->attach('Another_Service_Class', 'another');

Zend_Server_Cache::save($filename, $server);

}

$response = $server->handle(); echo $response;

Parameters

string $filename
\Zend_Server_Interface $server

Returns

boolean

delete()

delete(string  $filename) : boolean

Remove a cache file

Parameters

string $filename

Returns

boolean