本文整理汇总了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());
}