コード例 #1
0
ファイル: LDAP2.php プロジェクト: yozhi/YetiForceCRM
 /**
  * Gets a rootDSE object
  *
  * This either fetches a fresh rootDSE object or returns it from
  * the internal cache for performance reasons, if possible.
  *
  * @param array $attrs Array of attributes to search for
  *
  * @access public
  * @return Net_LDAP2_Error|Net_LDAP2_RootDSE Net_LDAP2_Error or Net_LDAP2_RootDSE object
  */
 public function &rootDse($attrs = null)
 {
     if ($attrs !== null && !is_array($attrs)) {
         return PEAR::raiseError('Parameter $attr is expected to be an array!');
     }
     $attrs_signature = serialize($attrs);
     // see if we need to fetch a fresh object, or if we already
     // requested this object with the same attributes
     if (true || !array_key_exists($attrs_signature, $this->_rootDSE_cache)) {
         $rootdse =& Net_LDAP2_RootDSE::fetch($this, $attrs);
         if ($rootdse instanceof Net_LDAP2_Error) {
             return $rootdse;
         }
         // search was ok, store rootDSE in cache
         $this->_rootDSE_cache[$attrs_signature] = $rootdse;
     }
     return $this->_rootDSE_cache[$attrs_signature];
 }
コード例 #2
0
ファイル: LDAP2.php プロジェクト: Trideon/gigolo
 /**
  * Gets a rootDSE object
  *
  * @param array $attrs Array of attributes to search for
  *
  * @access public
  * @author Jan Wagner <*****@*****.**>
  * @return Net_LDAP2_Error|Net_LDAP2_RootDSE Net_LDAP2_Error or Net_LDAP2_RootDSE object
  */
 public function &rootDse($attrs = null)
 {
     $rootDSE =& Net_LDAP2_RootDSE::fetch($this, $attrs);
     return $rootDSE;
 }