| 1 |
lars |
1 |
<?php
|
|
|
2 |
/* vim: set expandtab tabstop=4 shiftwidth=4: */
|
|
|
3 |
/**
|
|
|
4 |
* File containing the Net_LDAP2_SchemaCache interface class.
|
|
|
5 |
*
|
|
|
6 |
* PHP version 5
|
|
|
7 |
*
|
|
|
8 |
* @category Net
|
|
|
9 |
* @package Net_LDAP2
|
|
|
10 |
* @author Benedikt Hallinger <beni@php.net>
|
|
|
11 |
* @copyright 2009 Benedikt Hallinger
|
|
|
12 |
* @license http://www.gnu.org/licenses/lgpl-3.0.txt LGPLv3
|
|
|
13 |
* @version SVN: $Id: SchemaCache.interface.php 286718 2009-08-03 07:30:49Z beni $
|
|
|
14 |
* @link http://pear.php.net/package/Net_LDAP2/
|
|
|
15 |
*/
|
|
|
16 |
|
|
|
17 |
/**
|
|
|
18 |
* Interface describing a custom schema cache object
|
|
|
19 |
*
|
|
|
20 |
* To implement a custom schema cache, one must implement this interface and
|
|
|
21 |
* pass the instanciated object to Net_LDAP2s registerSchemaCache() method.
|
|
|
22 |
*/
|
|
|
23 |
interface Net_LDAP2_SchemaCache
|
|
|
24 |
{
|
|
|
25 |
/**
|
|
|
26 |
* Return the schema object from the cache
|
|
|
27 |
*
|
|
|
28 |
* Net_LDAP2 will consider anything returned invalid, except
|
|
|
29 |
* a valid Net_LDAP2_Schema object.
|
|
|
30 |
* In case you return a Net_LDAP2_Error, this error will be routed
|
|
|
31 |
* to the return of the $ldap->schema() call.
|
|
|
32 |
* If you return something else, Net_LDAP2 will
|
|
|
33 |
* fetch a fresh Schema object from the LDAP server.
|
|
|
34 |
*
|
|
|
35 |
* You may want to implement a cache aging mechanism here too.
|
|
|
36 |
*
|
|
|
37 |
* @return Net_LDAP2_Schema|Net_LDAP2_Error|false
|
|
|
38 |
*/
|
|
|
39 |
public function loadSchema();
|
|
|
40 |
|
|
|
41 |
/**
|
|
|
42 |
* Store a schema object in the cache
|
|
|
43 |
*
|
|
|
44 |
* This method will be called, if Net_LDAP2 has fetched a fresh
|
|
|
45 |
* schema object from LDAP and wants to init or refresh the cache.
|
|
|
46 |
*
|
|
|
47 |
* In case of errors you may return a Net_LDAP2_Error which will
|
|
|
48 |
* be routet to the client.
|
|
|
49 |
* Note that doing this prevents, that the schema object fetched from LDAP
|
|
|
50 |
* will be given back to the client, so only return errors if storing
|
|
|
51 |
* of the cache is something crucial (e.g. for doing something else with it).
|
|
|
52 |
* Normaly you dont want to give back errors in which case Net_LDAP2 needs to
|
|
|
53 |
* fetch the schema once per script run and instead use the error
|
|
|
54 |
* returned from loadSchema().
|
|
|
55 |
*
|
|
|
56 |
* @return true|Net_LDAP2_Error
|
|
|
57 |
*/
|
|
|
58 |
public function storeSchema($schema);
|
|
|
59 |
}
|