$ldap = Net_LDAP2::connect($ldap_config);
* // Create the simple file cache object that comes along with Net_LDAP2 * $mySchemaCache_cfg = array( * 'path' => '/tmp/Net_LDAP2_Schema.cache', * 'max_age' => 86400 // max age is 24 hours (in seconds) * ); * $mySchemaCache = new Net_LDAP2_SimpleFileSchemaCache($mySchemaCache_cfg); * $ldap = new Net_LDAP2::connect(...); * $ldap->registerSchemaCache($mySchemaCache); // enable caching * // now each call to $ldap->schema() will get the schema from disk! *
$attributes = array('cn' => 'foo', 'attr2' => array('mv1', 'mv2'));