| 1 |
lars |
1 |
<?php
|
|
|
2 |
/**This is included from unit tests to skip the test if DB is not available.
|
|
|
3 |
*
|
|
|
4 |
* LICENSE:
|
|
|
5 |
* This source file is subject to version 2.1 of the LGPL
|
|
|
6 |
* that is bundled with this package in the file LICENSE.
|
|
|
7 |
*
|
|
|
8 |
* COPYRIGHT:
|
|
|
9 |
* Empowered Media
|
|
|
10 |
* http://www.empoweredmedia.com
|
|
|
11 |
* 481 Eighth Avenue Suite 1530
|
|
|
12 |
* New York, NY 10001
|
|
|
13 |
*
|
|
|
14 |
* @copyright Empowered Media 2006
|
|
|
15 |
* @license http://www.gnu.org/copyleft/lesser.html LGPL Version 2.1
|
|
|
16 |
* @author Lukas Feiler <lukas.feiler@lukasfeiler.com>
|
|
|
17 |
* @package XML_Query2XML
|
|
|
18 |
* @version $Id: DB_skipif.php 257863 2008-04-18 23:50:27Z lukasfeiler $
|
|
|
19 |
*/
|
|
|
20 |
|
|
|
21 |
require_once dirname(dirname(__FILE__)) . '/settings.php';
|
|
|
22 |
if (!@include_once 'DB.php') {
|
|
|
23 |
print 'skip could not find DB.php';
|
|
|
24 |
exit;
|
|
|
25 |
} elseif (strpos(DSN, 'sqlite:') === 0) {
|
|
|
26 |
print 'skip PEAR DB does not remove table part of "table.column" format returned by sqlite driver';
|
|
|
27 |
exit;
|
|
|
28 |
} else {
|
|
|
29 |
$db = @DB::connect(DSN);
|
|
|
30 |
if (PEAR::isError($db)) {
|
|
|
31 |
print 'skip could not connect using DSN ' . DSN;
|
|
|
32 |
exit;
|
|
|
33 |
}
|
|
|
34 |
}
|
|
|
35 |
?>
|