本文整理汇总了PHP中Zend_Ldap_Converter类的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Ldap_Converter类的具体用法?PHP Zend_Ldap_Converter怎么用?PHP Zend_Ldap_Converter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Zend_Ldap_Converter类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: testHex2asc
public function testHex2asc()
{
$expected = '';
for ($i = 0; $i < 127; $i++) {
$expected .= chr($i);
}
$str = '\\00\\01\\02\\03\\04\\05\\06\\07\\08\\09\\0a\\0b\\0c\\0d\\0e\\0f\\10\\11\\12\\13\\14\\15\\16\\17\\18\\19\\1a\\1b' . '\\1c\\1d\\1e\\1f !"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefg' . 'hijklmnopqrstuvwxyz{|}~';
$this->assertEquals($expected, Zend_Ldap_Converter::hex32ToAsc($str));
}
开发者ID:netvlies,项目名称:zf,代码行数:9,代码来源:ConverterTest.php
示例2: unescapeValue
/**
* Undoes the conversion done by {@link escapeValue()}.
*
* Any escape sequence starting with a baskslash - hexpair or special character -
* will be transformed back to the corresponding character.
* @see Net_LDAP2_Util::escape_dn_value() from Benedikt Hallinger <[email protected]>
* @link http://pear.php.net/package/Net_LDAP2
* @author Benedikt Hallinger <[email protected]>
*
* @param string|array $values Array of DN Values
* @return array Same as $values, but unescaped
*/
public static function unescapeValue($values = array())
{
/**
* @see Zend_Ldap_Converter
*/
require_once 'Zend/Ldap/Converter.php';
if (!is_array($values)) {
$values = array($values);
}
foreach ($values as $key => $val) {
// strip slashes from special chars
$val = str_replace(array('\\\\', '\\,', '\\+', '\\"', '\\<', '\\>', '\\;', '\\#', '\\='), array('\\', ',', '+', '"', '<', '>', ';', '#', '='), $val);
$values[$key] = Zend_Ldap_Converter::hex32ToAsc($val);
}
return count($values) == 1 ? $values[0] : $values;
}
开发者ID:conectapb,项目名称:sysagroweb,代码行数:28,代码来源:Dn.php
示例3: unescapeValue
/**
* Undoes the conversion done by {@link escapeValue()}.
*
* Converts any sequences of a backslash followed by two hex digits into the corresponding character.
* @see Net_LDAP2_Util::escape_filter_value() from Benedikt Hallinger <[email protected]>
* @link http://pear.php.net/package/Net_LDAP2
* @author Benedikt Hallinger <[email protected]>
*
* @param string|array $values Array of values to escape
* @return array Array $values, but unescaped
*/
public static function unescapeValue($values = array())
{
/**
* @see Zend_Ldap_Converter
*/
require_once 'Zend/Ldap/Converter.php';
if (!is_array($values)) {
$values = array($values);
}
foreach ($values as $key => $value) {
// Translate hex code into ascii
$values[$key] = Zend_Ldap_Converter::hex32ToAsc($value);
}
return count($values) == 1 ? $values[0] : $values;
}
开发者ID:ramonornela,项目名称:Zebra,代码行数:26,代码来源:Abstract.php
示例4: _valueFromLdapDateTime
/**
* @param string|DateTime $value
* @return integer|null
*/
private static function _valueFromLdapDateTime($value)
{
if ($value instanceof DateTime) {
return $value->format('U');
} else {
if (is_string($value)) {
try {
return Zend_Ldap_Converter::fromLdapDateTime($value, false)->format('U');
} catch (InvalidArgumentException $e) {
return null;
}
} else {
return null;
}
}
}
开发者ID:kobmaki,项目名称:icingaweb2,代码行数:20,代码来源:Attribute.php
示例5: testFromLdap
/**
* @dataProvider fromLdapProvider
*/
public function testFromLdap($expect, $value, $type, $dateTimeAsUtc)
{
$this->assertSame($expect, Zend_Ldap_Converter::fromLdap($value, $type, $dateTimeAsUtc));
}
开发者ID:jsnshrmn,项目名称:Suma,代码行数:7,代码来源:ConverterTest.php
示例6: testFromLdapDateTimeThrowsException
/**
* @expectedException InvalidArgumentException
* @dataProvider fromLdapDateTimeException
*/
public function testFromLdapDateTimeThrowsException($value)
{
Zend_Ldap_Converter::fromLdapDatetime($value);
}
开发者ID:epixa,项目名称:Zend-Framework-v1-Mirror,代码行数:8,代码来源:ConverterTest.php
注:本文中的Zend_Ldap_Converter类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论