Horde_Ldap::checkLDAPExtension PHP Метод

checkLDAPExtension() публичный статический Метод

If it is not loaded, it tries to load it manually using PHP's dl(). It knows both windows-dll and *nix-so.
public static checkLDAPExtension ( )
    public static function checkLDAPExtension()
    {
        if (!extension_loaded('ldap') && !@dl('ldap.' . PHP_SHLIB_SUFFIX)) {
            throw new Horde_Ldap_Exception('Unable to locate PHP LDAP extension. Please install it before using the Horde_Ldap package.');
        }
    }

Usage Example

Пример #1
0
 /**
  * Constructor.
  *
  * @param Horde_Kolab_Server_Connection $connection The LDAP connection.
  * @param string                        $base_dn    The LDAP server base DN.
  * @param string                        $filter     A global filter to add
  *                                                  to all queries.
  */
 public function __construct(Horde_Kolab_Server_Connection_Interface $connection, $base_dn)
 {
     $this->_conn = $connection;
     $this->_base_dn = $base_dn;
     try {
         Horde_Ldap::checkLDAPExtension();
     } catch (Horde_Ldap_Exception $e) {
         throw new Horde_Kolab_Server_Exception($e->getMessage(), Horde_Kolab_Server_Exception::MISSING_LDAP_EXTENSION, $e);
     }
 }
All Usage Examples Of Horde_Ldap::checkLDAPExtension