当前位置: 首页>>代码示例>>PHP>>正文


PHP Net_LDAP2::checkLDAPExtension方法代码示例

本文整理汇总了PHP中Net_LDAP2::checkLDAPExtension方法的典型用法代码示例。如果您正苦于以下问题:PHP Net_LDAP2::checkLDAPExtension方法的具体用法?PHP Net_LDAP2::checkLDAPExtension怎么用?PHP Net_LDAP2::checkLDAPExtension使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Net_LDAP2的用法示例。


在下文中一共展示了Net_LDAP2::checkLDAPExtension方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: array

 /**
  * Establishes a working connection
  *
  * @return Net_LDAP2
  */
 public function &connect()
 {
     // Check extension
     if (true !== Net_LDAP2::checkLDAPExtension()) {
         $this->markTestSkipped('PHP LDAP extension not found or not loadable. Skipped Test.');
     }
     // Simple working connect and privilegued bind
     $lcfg = array('host' => $this->ldapcfg['global']['server_address'], 'port' => $this->ldapcfg['global']['server_port'], 'basedn' => $this->ldapcfg['global']['server_base_dn'], 'binddn' => $this->ldapcfg['global']['server_binddn'], 'bindpw' => $this->ldapcfg['global']['server_bindpw'], 'filter' => '(ou=*)');
     $ldap = Net_LDAP2::connect($lcfg);
     $this->assertInstanceOf('Net_LDAP2', $ldap, 'Connect failed but was supposed to work. Check credentials and host address. If those are correct, file a bug!');
     return $ldap;
 }
开发者ID:gregoryR,项目名称:Net_LDAP2,代码行数:17,代码来源:Net_LDAP2_EntryTest.php

示例2: testStartTLS

 /**
  * testStartTLS() if server supports it
  */
 public function testStartTLS()
 {
     // Check extension
     if (true !== Net_LDAP2::checkLDAPExtension()) {
         $this->markTestSkipped('PHP LDAP extension not found or not loadable. Skipped Test.');
     }
     if (!$this->ldapcfg) {
         $this->markTestSkipped('No ldapconfig.ini found. Skipping test!');
     } elseif ($this->ldapcfg['global']['server_cap_tls'] == true) {
         // Simple working connect and privilegued bind
         $lcfg = array('host' => $this->ldapcfg['global']['server_address'], 'port' => $this->ldapcfg['global']['server_port'], 'binddn' => $this->ldapcfg['global']['server_binddn'] . ',' . $this->ldapcfg['global']['server_binddn'], 'bindpw' => $this->ldapcfg['global']['server_bindpw'], 'starttls' => true);
         $ldap = Net_LDAP2::connect();
         $this->assertInstanceOf('Net_LDAP2', $ldap, 'Connect failed but was supposed to work. Check credentials and host address. If those are correct, file a bug!');
     } else {
         $this->markTestSkipped('Server does not support TLS (see ldapconfig.ini). Skipping test.');
     }
 }
开发者ID:gregoryR,项目名称:Net_LDAP2,代码行数:20,代码来源:Net_LDAP2Test.php


注:本文中的Net_LDAP2::checkLDAPExtension方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。