apidoc
[ class tree: apidoc ] [ index: apidoc ] [ all elements ]

Class: Net_LDAP2_SchemaCache

Source Location: /Net_LDAP2-2.2.0/Net/LDAP2/SchemaCache.interface.php

Class Overview


Interface describing a custom schema cache object


Methods


Inherited Variables

Inherited Methods


Class Details

[line 23]
Interface describing a custom schema cache object

To implement a custom schema cache, one must implement this interface and pass the instanciated object to Net_LDAP2s registerSchemaCache() method.



[ Top ]


Method Detail

loadSchema   [line 39]

Net_LDAP2_Schema|Net_LDAP2_Error|false loadSchema( )

Return the schema object from the cache

Net_LDAP2 will consider anything returned invalid, except a valid Net_LDAP2_Schema object. In case you return a Net_LDAP2_Error, this error will be routed to the return of the $ldap->schema() call. If you return something else, Net_LDAP2 will fetch a fresh Schema object from the LDAP server.

You may want to implement a cache aging mechanism here too.

  • Access: public

[ Top ]

storeSchema   [line 58]

true|Net_LDAP2_Error storeSchema( $schema)

Store a schema object in the cache

This method will be called, if Net_LDAP2 has fetched a fresh schema object from LDAP and wants to init or refresh the cache.

In case of errors you may return a Net_LDAP2_Error which will be routet to the client. Note that doing this prevents, that the schema object fetched from LDAP will be given back to the client, so only return errors if storing of the cache is something crucial (e.g. for doing something else with it). Normaly you dont want to give back errors in which case Net_LDAP2 needs to fetch the schema once per script run and instead use the error returned from loadSchema().

  • Access: public

Parameters:

   $schema   — 

[ Top ]


Documentation generated on Mon, 11 Mar 2019 16:03:55 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.