Horde_Ldap::getLink PHP Метод

    public function getLink()
    {
        if ($this->_config['auto_reconnect']) {
            while (true) {
                /* Return the link handle if we are already connected.
                 * Otherwise try to reconnect. */
                if ($this->_link) {
                    return $this->_link;
                }
                $this->_reconnect();
            }
        }
        return $this->_link;
    }

Usage Example

Пример #1
0
 /**
  * Constructor.
  *
  * @param resource            $search     Search result identifier.
  * @param Horde_Ldap|resource $ldap       Horde_Ldap object or a LDAP link
  *                                        resource
  * @param array               $attributes The searched attribute names,
  *                                        see {@link $_searchedAttrs}.
  */
 public function __construct($search, $ldap, $attributes = array())
 {
     $this->setSearch($search);
     if ($ldap instanceof Horde_Ldap) {
         $this->_ldap = $ldap;
         $this->setLink($this->_ldap->getLink());
     } else {
         $this->setLink($ldap);
     }
     $this->_errorCode = @ldap_errno($this->_link);
     if (is_array($attributes) && !empty($attributes)) {
         $this->_searchedAttrs = $attributes;
     }
 }
All Usage Examples Of Horde_Ldap::getLink