本文整理匯總了PHP中Zend_Ldap::getResource方法的典型用法代碼示例。如果您正苦於以下問題:PHP Zend_Ldap::getResource方法的具體用法?PHP Zend_Ldap::getResource怎麽用?PHP Zend_Ldap::getResource使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Zend_Ldap
的用法示例。
在下文中一共展示了Zend_Ldap::getResource方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: _cleanupLdapServer
protected function _cleanupLdapServer()
{
$ldap = $this->_ldap->getResource();
foreach (array_reverse($this->_nodes) as $dn => $entry) {
ldap_delete($ldap, $dn);
}
}
示例2: _cleanupLDAPServer
protected function _cleanupLDAPServer()
{
if (!constant('TESTS_ZEND_LDAP_ONLINE_ENABLED')) {
return;
}
$ldap = $this->_ldap->getResource();
foreach (array_reverse($this->_nodes) as $dn => $entry) {
ldap_delete($ldap, $dn);
}
}
示例3: rewind
/**
* Rewind the Iterator to the first result item
* Implements Iterator
*
* @throws Zend_Ldap_Exception
*/
public function rewind()
{
if (is_resource($this->_resultId)) {
$this->_current = @ldap_first_entry($this->_ldap->getResource(), $this->_resultId);
/** @see Zend_Ldap_Exception */
if ($this->_current === false && $this->_ldap->getLastErrorCode() > Zend_Ldap_Exception::LDAP_SUCCESS) {
throw new Zend_Ldap_Exception($this->_ldap, 'getting first entry');
}
}
}
示例4: _storeCurrentDn
/**
* Stores the current DN
*
* @return void
* @throws Zend_Ldap_Exception
*/
protected function _storeCurrentDn()
{
if (is_resource($this->_current)) {
$this->_currentDn = @ldap_get_dn($this->_ldap->getResource(), $this->_current);
if ($this->_currentDn === false) {
throw new Zend_Ldap_Exception($this->_ldap, 'getting dn');
}
} else {
$this->_currentDn = null;
}
}
示例5: testResourceIsAlwaysReturned
/**
* @group ZF-8259
*/
public function testResourceIsAlwaysReturned()
{
$ldap = new Zend_Ldap($this->_options);
$this->assertNotNull($ldap->getResource());
$this->assertTrue(is_resource($ldap->getResource()));
$this->assertEquals(TESTS_ZEND_LDAP_USERNAME, $ldap->getBoundUser());
}