| 1 |
lars |
1 |
<?php
|
|
|
2 |
|
|
|
3 |
/**
|
|
|
4 |
* Sets the include_path, error_reporting and PATH_SEPARATOR for tests
|
|
|
5 |
* in the DB/tests directory
|
|
|
6 |
*
|
|
|
7 |
* PHP versions 4 and 5
|
|
|
8 |
*
|
|
|
9 |
* LICENSE: This source file is subject to version 3.0 of the PHP license
|
|
|
10 |
* that is available through the world-wide-web at the following URI:
|
|
|
11 |
* http://www.php.net/license/3_0.txt. If you did not receive a copy of
|
|
|
12 |
* the PHP License and are unable to obtain it through the web, please
|
|
|
13 |
* send a note to license@php.net so we can mail you a copy immediately.
|
|
|
14 |
*
|
|
|
15 |
* @category Database
|
|
|
16 |
* @package DB
|
|
|
17 |
* @author Daniel Convissor <danielc@php.net>
|
|
|
18 |
* @copyright 1997-2005 The PHP Group
|
|
|
19 |
* @license http://www.php.net/license/3_0.txt PHP License 3.0
|
|
|
20 |
* @version $Id: include.inc,v 1.5 2005/02/03 05:49:44 danielc Exp $
|
|
|
21 |
* @link http://pear.php.net/package/DB
|
|
|
22 |
*/
|
|
|
23 |
|
|
|
24 |
error_reporting(E_ALL);
|
|
|
25 |
|
|
|
26 |
if (!defined('PATH_SEPARATOR')) {
|
|
|
27 |
if (stristr(PHP_OS, 'WIN')) {
|
|
|
28 |
/**
|
|
|
29 |
* Define the path separator for windows
|
|
|
30 |
*/
|
|
|
31 |
define('PATH_SEPARATOR', ';');
|
|
|
32 |
} else {
|
|
|
33 |
/**
|
|
|
34 |
* Define the path separator for other systems
|
|
|
35 |
*/
|
|
|
36 |
define('PATH_SEPARATOR', ':');
|
|
|
37 |
}
|
|
|
38 |
}
|
|
|
39 |
|
|
|
40 |
/*
|
|
|
41 |
* If the path to your PEAR installation is found in the left hand
|
|
|
42 |
* portion of the if() expression below, that means this file has
|
|
|
43 |
* come from the PEAR installer. Therefore, let's use the
|
|
|
44 |
* installed version of DB, which should be found via the
|
|
|
45 |
* computer's default include_path. Add '.' to the include_path
|
|
|
46 |
* to ensure '.' is in there.
|
|
|
47 |
*
|
|
|
48 |
* If the path has not been substituted in the if() expression,
|
|
|
49 |
* this file has likely come from a CVS checkout or a .tar file.
|
|
|
50 |
* Therefore, we'll assume the tests should use the version of
|
|
|
51 |
* DB that has come from there as well.
|
|
|
52 |
*/
|
|
|
53 |
if ('@include_path@' != '@'.'include_path'.'@') {
|
|
|
54 |
ini_set('include_path', ini_get('include_path')
|
|
|
55 |
. PATH_SEPARATOR . '.'
|
|
|
56 |
);
|
|
|
57 |
} else {
|
|
|
58 |
ini_set('include_path', realpath(dirname(__FILE__) . '/..')
|
|
|
59 |
. PATH_SEPARATOR . '.' . PATH_SEPARATOR
|
|
|
60 |
. ini_get('include_path')
|
|
|
61 |
);
|
|
|
62 |
}
|