當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Net_LDAP2::getLink方法代碼示例

本文整理匯總了PHP中Net_LDAP2::getLink方法的典型用法代碼示例。如果您正苦於以下問題:PHP Net_LDAP2::getLink方法的具體用法?PHP Net_LDAP2::getLink怎麽用?PHP Net_LDAP2::getLink使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Net_LDAP2的用法示例。


在下文中一共展示了Net_LDAP2::getLink方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: __construct

 /**
  * Internal Constructor
  *
  * Constructor of the entry. Sets up the distinguished name and the entries
  * attributes.
  * You should not call this method manually! Use {@link Net_LDAP2_Entry::createFresh()}
  * or {@link Net_LDAP2_Entry::createConnected()} instead!
  *
  * @param Net_LDAP2|ressource|array $ldap Net_LDAP2 object, ldap-link ressource or array of attributes
  * @param string|ressource          $entry Either a DN or a LDAP-Entry ressource
  *
  * @access protected
  * @return none
  */
 public function __construct($ldap, $entry = null)
 {
     parent::__construct('Net_LDAP2_Error');
     // set up entry resource or DN
     if (is_resource($entry)) {
         $this->_entry = $entry;
     } else {
         $this->_dn = $entry;
     }
     // set up LDAP link
     if ($ldap instanceof Net_LDAP2) {
         $this->_ldap = $ldap;
         $this->_link = $ldap->getLink();
     } elseif (is_resource($ldap)) {
         $this->_link = $ldap;
     } elseif (is_array($ldap)) {
         // Special case: here $ldap is an array of attributes,
         // this means, we have no link. This is a "virtual" entry.
         // We just set up the attributes so one can work with the object
         // as expected, but an update() fails unless setLDAP() is called.
         $this->setAttributes($ldap);
     }
     // if this is an entry existing in the directory,
     // then set up as old and fetch attrs
     if (is_resource($this->_entry) && is_resource($this->_link)) {
         $this->_new = false;
         $this->_dn = @ldap_get_dn($this->_link, $this->_entry);
         $this->setAttributes();
         // fetch attributes from server
     }
 }
開發者ID:pear,項目名稱:net_ldap2,代碼行數:45,代碼來源:Entry.php


注:本文中的Net_LDAP2::getLink方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。