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

Class: Net_LDAP2_SimpleFileSchemaCache

Source Location: /Net_LDAP2-2.2.0/Net/LDAP2/SimpleFileSchemaCache.php

Class Overview


A simple file based schema cacher with cache aging.


Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 24]
A simple file based schema cacher with cache aging.

Once the cache is too old, the loadSchema() method will return false, so Net_LDAP2 will fetch a fresh object from the LDAP server that will overwrite the current (outdated) old cache.



[ Top ]


Class Variables

$config = array(
        'path'    => '/tmp/Net_LDAP_Schema.cache',
        'max_age' => 1200
    )

[line 32]

Internal config of this cache
  • See: Net_LDAP2_SimpleFileSchemaCache()
  • Access: protected

Type:   array


[ Top ]



Method Detail

__construct (Constructor)   [line 46]

Net_LDAP2_SimpleFileSchemaCache __construct( array $cfg)

Initialize the simple cache

Config is as following: path Complete path to the cache file. max_age Maximum age of cache in seconds, 0 means "endlessly".

  • Access: public

Parameters:

array   $cfg   —  Config array

[ Top ]

loadSchema   [line 68]

Net_LDAP2_Schema|Net_LDAP2_Error|false loadSchema( )

Return the schema object from the cache

If file is existent and cache has not expired yet, then the cache is deserialized and returned.

  • Access: public

[ Top ]

storeSchema   [line 93]

true|Net_LDAP2_Error|false storeSchema( mixed $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.

To invalidate the cache and cause Net_LDAP2 to refresh the cache, you can call this method with null or false as value. The next call to $ldap->schema() will then refresh the caches object.

  • Access: public

Parameters:

mixed   $schema   —  The object that should be cached

[ Top ]


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