| 1 |
lars |
1 |
<?php
|
|
|
2 |
/**
|
|
|
3 |
* This is included from unit tests to skip the test if Net/LDAP.php or the LDAP
|
|
|
4 |
* directory itself is not available.
|
|
|
5 |
*
|
|
|
6 |
* PHP version 5
|
|
|
7 |
*
|
|
|
8 |
* @category XML
|
|
|
9 |
* @package XML_Query2XML
|
|
|
10 |
* @author Lukas Feiler <lukas.feiler@lukasfeiler.com>
|
|
|
11 |
* @copyright 2007 Lukas Feiler
|
|
|
12 |
* @license http://www.gnu.org/copyleft/lesser.html LGPL Version 2.1
|
|
|
13 |
* @version CVS: $Id: skipif.php 257865 2008-04-18 23:52:52Z lukasfeiler $
|
|
|
14 |
* @link http://pear.php.net/package/XML_Query2XML
|
|
|
15 |
* @access private
|
|
|
16 |
*/
|
|
|
17 |
|
|
|
18 |
if (!defined('LDAP_LAYER')) {
|
|
|
19 |
if (getenv('PHP_PEAR_XML_QUERY2XML_TEST_LDAPLAYER') != '') {
|
|
|
20 |
define('LDAP_LAYER', getenv('PHP_PEAR_XML_QUERY2XML_TEST_LDAPLAYER'));
|
|
|
21 |
} else {
|
|
|
22 |
if (@include_once 'Net/LDAP2.php') {
|
|
|
23 |
define('LDAP_LAYER', 'LDAP2');
|
|
|
24 |
} else {
|
|
|
25 |
define('LDAP_LAYER', 'LDAP');
|
|
|
26 |
}
|
|
|
27 |
}
|
|
|
28 |
}
|
|
|
29 |
|
|
|
30 |
|
|
|
31 |
if (LDAP_LAYER == 'LDAP2') {
|
|
|
32 |
if (!@include_once 'Net/LDAP2.php') {
|
|
|
33 |
print 'skip could not find Net/LDAP2.php';
|
|
|
34 |
exit;
|
|
|
35 |
} else {
|
|
|
36 |
include_once dirname(dirname(__FILE__)) . '/settings.php';
|
|
|
37 |
$ldap = Net_LDAP2::connect($ldapConfig);
|
|
|
38 |
if (PEAR::isError($ldap)) {
|
|
|
39 |
print 'skip could not connect to LDAP directory';
|
|
|
40 |
exit;
|
|
|
41 |
}
|
|
|
42 |
}
|
|
|
43 |
} else {
|
|
|
44 |
if (!@include_once 'Net/LDAP.php') {
|
|
|
45 |
print 'skip could not find Net/LDAP.php';
|
|
|
46 |
exit;
|
|
|
47 |
} else {
|
|
|
48 |
include_once dirname(dirname(__FILE__)) . '/settings.php';
|
|
|
49 |
$ldap = Net_LDAP::connect($ldapConfig);
|
|
|
50 |
if (PEAR::isError($ldap)) {
|
|
|
51 |
print 'skip could not connect to LDAP directory';
|
|
|
52 |
exit;
|
|
|
53 |
}
|
|
|
54 |
}
|
|
|
55 |
}
|
|
|
56 |
?>
|