cvs: pear /DB/DB sqlite.php
| From: | Lukas Smith | Date: | Fri, 17 Mar 2006 08:37:33 +0000 |
| Subject: | cvs: pear /DB/DB sqlite.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-39143@lists.php.net to get a copy of this message | ||
lsmith Fri Mar 17 08:37:33 2006 UTC
Modified files:
/pear/DB/DB sqlite.php
Log:
- fix bug sqlite:///:memory: trys to open file (bug #6599)
http://cvs.php.net/viewcvs.cgi/pear/DB/DB/sqlite.php?r1=1.109&r2=1.110&diff_format=u
Index: pear/DB/DB/sqlite.php
diff -u pear/DB/DB/sqlite.php:1.109 pear/DB/DB/sqlite.php:1.110
--- pear/DB/DB/sqlite.php:1.109 Thu Mar 10 01:22:48 2005
+++ pear/DB/DB/sqlite.php Fri Mar 17 08:37:33 2006
@@ -21,7 +21,7 @@
* @author Daniel Convissor <danielc@php.net>
* @copyright 1997-2005 The PHP Group
* @license http://www.php.net/license/3_0.txt
PHP License 3.0 3.0
- * @version CVS: $Id: sqlite.php,v 1.109 2005/03/10 01:22:48 danielc Exp $
+ * @version CVS: $Id: sqlite.php,v 1.110 2006/03/17 08:37:33 lsmith Exp $
* @link http://pear.php.net/package/DB
*/
@@ -204,7 +204,11 @@
$this->dbsyntax = $dsn['dbsyntax'];
}
- if ($dsn['database']) {
+ if (!$dsn['database']) {
+ return $this->sqliteRaiseError(DB_ERROR_ACCESS_VIOLATION);
+ }
+
+ if ($dsn['database'] !== ':memory:') {
if (!file_exists($dsn['database'])) {
if (!touch($dsn['database'])) {
return $this->sqliteRaiseError(DB_ERROR_NOT_FOUND);
@@ -229,8 +233,6 @@
if (!is_readable($dsn['database'])) {
return $this->sqliteRaiseError(DB_ERROR_ACCESS_VIOLATION);
}
- } else {
- return $this->sqliteRaiseError(DB_ERROR_ACCESS_VIOLATION);
}
$connect_function = $persistent ? 'sqlite_popen' : 'sqlite_open';