cvs: pear /XML_Query2XML/tests/XML_Query2XML/PDO db_init.php skipif.php
| From: | Lukas Feiler | Date: | Sun, 30 Sep 2007 06:58:25 +0000 |
| Subject: | cvs: pear /XML_Query2XML/tests/XML_Query2XML/PDO db_init.php skipif.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-48725@lists.php.net to get a copy of this message | ||
lukasfeiler Sun Sep 30 06:58:25 2007 UTC
Modified files:
/pear/XML_Query2XML/tests/XML_Query2XML/PDO db_init.php skipif.php
Log:
make this work on linux
http://cvs.php.net/viewvc.cgi/pear/XML_Query2XML/tests/XML_Query2XML/PDO/db_init.php?r1=1.2&r2=1.3&diff_format=u
Index: pear/XML_Query2XML/tests/XML_Query2XML/PDO/db_init.php
diff -u pear/XML_Query2XML/tests/XML_Query2XML/PDO/db_init.php:1.2
pear/XML_Query2XML/tests/XML_Query2XML/PDO/db_init.php:1.3
--- pear/XML_Query2XML/tests/XML_Query2XML/PDO/db_init.php:1.2 Sun Sep 23 00:16:04 2007
+++ pear/XML_Query2XML/tests/XML_Query2XML/PDO/db_init.php Sun Sep 30 06:58:25 2007
@@ -15,7 +15,7 @@
* @license http://www.gnu.org/copyleft/lesser.html LGPL
Version 2.1
* @author Lukas Feiler <lukas.feiler@lukasfeiler.com>
* @package XML_Query2XML
-* @version $Id: db_init.php,v 1.2 2007/09/23 00:16:04 lukasfeiler Exp $
+* @version $Id: db_init.php,v 1.3 2007/09/30 06:58:25 lukasfeiler Exp $
*/
class MyPDOStatement extends PDOStatement
@@ -72,7 +72,9 @@
if ($protocol == 'sqlite') {
$protocol .= '2';
}
- $address = ltrim($address, '/');
+ if (strpos($address, '/C:\\') === 0) {
+ $address = ltrim($address, '/');
+ }
$db = new PDO($protocol . ':' . $address);
$db->setAttribute(PDO::ATTR_STATEMENT_CLASS, array('MyPDOStatement', array()));
} else {
http://cvs.php.net/viewvc.cgi/pear/XML_Query2XML/tests/XML_Query2XML/PDO/skipif.php?r1=1.1&r2=1.2&diff_format=u
Index: pear/XML_Query2XML/tests/XML_Query2XML/PDO/skipif.php
diff -u pear/XML_Query2XML/tests/XML_Query2XML/PDO/skipif.php:1.1
pear/XML_Query2XML/tests/XML_Query2XML/PDO/skipif.php:1.2
--- pear/XML_Query2XML/tests/XML_Query2XML/PDO/skipif.php:1.1 Mon Sep 3 08:01:41 2007
+++ pear/XML_Query2XML/tests/XML_Query2XML/PDO/skipif.php Sun Sep 30 06:58:25 2007
@@ -15,7 +15,7 @@
* @license http://www.gnu.org/copyleft/lesser.html LGPL
Version 2.1
* @author Lukas Feiler <lukas.feiler@lukasfeiler.com>
* @package XML_Query2XML
-* @version $Id: skipif.php,v 1.1 2007/09/03 08:01:41 lukasfeiler Exp $
+* @version $Id: skipif.php,v 1.2 2007/09/30 06:58:25 lukasfeiler Exp $
*/
if (!class_exists('PDO')) {
@@ -29,8 +29,15 @@
if ($protocol == 'sqlite') {
$protocol .= '2';
}
- $address = ltrim($address, '/');
- $db = new PDO($protocol . ':' . $address);
+ if (strpos($address, '/C:\\') === 0) {
+ $address = ltrim($address, '/');
+ }
+ try {
+ $db = new PDO($protocol . ':' . $address);
+ } catch (PDOException $e) {
+ print 'skip could not connect using DSN ' . DSN . ': ' .
$e->getMessage();
+ exit;
+ }
} else {
list($credentials, $address) = split('@', $address);
if (strpos($credentials, ':') === false) {