本文整理汇总了PHP中Zend\Ldap\Dn::explodeDn方法的典型用法代码示例。如果您正苦于以下问题:PHP Dn::explodeDn方法的具体用法?PHP Dn::explodeDn怎么用?PHP Dn::explodeDn使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend\Ldap\Dn
的用法示例。
在下文中一共展示了Dn::explodeDn方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testDnWithMultiValuedRdnRoundTrip
public function testDnWithMultiValuedRdnRoundTrip()
{
$dn1 = 'cn=Surname\\, Firstname+uid=userid,cn=name2,dc=example,dc=org';
$dnArray = Ldap\Dn::explodeDn($dn1);
$dn2 = Ldap\Dn::implodeDn($dnArray);
$this->assertEquals($dn1, $dn2);
}
示例2: copy
/**
* Copies a LDAP entry from one DN to another DN.
*
* @param string|Dn $from
* @param string|Dn $to
* @param boolean $recursively
* @return Ldap Provides a fluid interface
* @throws Exception\LdapException
*/
public function copy($from, $to, $recursively = false)
{
$entry = $this->getEntry($from, array(), true);
if ($to instanceof Dn) {
$toDnParts = $to->toArray();
} else {
$toDnParts = Dn::explodeDn($to);
}
$this->add($to, $entry);
if ($recursively === true && $this->countChildren($from) > 0) {
$children = $this->getChildrenDns($from);
foreach ($children as $c) {
$cDnParts = Dn::explodeDn($c);
$newChildParts = array_merge(array(array_shift($cDnParts)), $toDnParts);
$newChild = Dn::implodeDn($newChildParts);
$this->copy($c, $newChild, true);
}
}
return $this;
}
示例3: testGetDnArray
public function testGetDnArray()
{
$data = $this->createTestArrayData();
$node = Ldap\Node::fromArray($data);
$exA = Ldap\Dn::explodeDn($data['dn']);
$this->assertEquals($exA, $node->getDnArray());
}
示例4: testExplodeDnsProvidedByRFC2253
/**
* @dataProvider rfc2253DnProvider
*/
public function testExplodeDnsProvidedByRFC2253($input, $expected)
{
$dnArray = Ldap\Dn::explodeDn($input);
$this->assertEquals($expected, $dnArray);
}