本文整理汇总了PHP中Zend_Ldap_Dn::implodeDn方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Ldap_Dn::implodeDn方法的具体用法?PHP Zend_Ldap_Dn::implodeDn怎么用?PHP Zend_Ldap_Dn::implodeDn使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Ldap_Dn
的用法示例。
在下文中一共展示了Zend_Ldap_Dn::implodeDn方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testImplodeDnWithUtf8Characters
public function testImplodeDnWithUtf8Characters()
{
$expected = 'uid=rogasawara,ou=営業部,o=Airius';
$dnArray = array(array("uid" => "rogasawara"), array("ou" => "営業部"), array("o" => "Airius"));
$dn = Zend_Ldap_Dn::implodeDn($dnArray);
$this->assertEquals($expected, $dn);
}
示例2: copy
/**
* Copies a LDAP entry from one DN to another DN.
*
* @param string|Zend_Ldap_Dn $from
* @param string|Zend_Ldap_Dn $to
* @param boolean $recursively
* @return Zend_Ldap Provides a fluid interface
* @throws Zend_Ldap_Exception
*/
public function copy($from, $to, $recursively = false)
{
$entry = $this->getEntry($from, array(), true);
if ($to instanceof Zend_Ldap_Dn) {
$toDnParts = $to->toArray();
} else {
$toDnParts = Zend_Ldap_Dn::explodeDn($to);
}
$this->add($to, $entry);
if ($recursively === true && $this->countChildren($from) > 0) {
$children = $this->_getChildrenDns($from);
foreach ($children as $c) {
$cDnParts = Zend_Ldap_Dn::explodeDn($c);
$newChildParts = array_merge(array(array_shift($cDnParts)), $toDnParts);
$newChild = Zend_Ldap_Dn::implodeDn($newChildParts);
$this->copy($c, $newChild, true);
}
}
return $this;
}