cvs: pear /DB DB.php
| From: | Daniel Convissor | Date: | Mon, 05 Jan 2004 02:16:07 +0000 |
| Subject: | cvs: pear /DB DB.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-15356@lists.php.net to get a copy of this message | ||
danielc Sun Jan 4 21:16:07 2004 EDT
Modified files:
/pear/DB DB.php
Log:
Document existence of URI query string which allows additional options. Tweak URI parsing to
allow 'mode' to be used for the SQLite driver. Document 'mode' option for
SQLite driver.
Index: pear/DB/DB.php
diff -u pear/DB/DB.php:1.30 pear/DB/DB.php:1.31
--- pear/DB/DB.php:1.30 Sun Jan 4 20:54:40 2004
+++ pear/DB/DB.php Sun Jan 4 21:16:07 2004
@@ -17,7 +17,7 @@
// | Tomas V.V.Cox <cox@idecnet.com> |
// +----------------------------------------------------------------------+
//
-// $Id: DB.php,v 1.30 2004/01/05 01:54:40 danielc Exp $
+// $Id: DB.php,v 1.31 2004/01/05 02:16:07 danielc Exp $
//
// Database independent query interface.
//
@@ -193,7 +193,7 @@
* @author Stig Bakken <ssb@php.net>
* @author Tomas V.V.Cox <cox@idecnet.com>
* @since PHP 4.0
- * @version $Id: DB.php,v 1.30 2004/01/05 01:54:40 danielc Exp $
+ * @version $Id: DB.php,v 1.31 2004/01/05 02:16:07 danielc Exp $
* @category Database
*/
@@ -437,14 +437,18 @@
* database: Database to use on the DBMS server
* username: User name for login
* password: Password for login
+ * mode: chmod mode for SQLite databases
+ *
+ * Additional keys can be added by appending a URI query string to the
+ * end of the DSN.
*
* The format of the supplied DSN is in its fullest form:
*
- * phptype(dbsyntax)://username:password@protocol+hostspec/database
+ * phptype(dbsyntax)://username:password@protocol+hostspec/database?option=8&another=true
*
* Most variations are allowed:
*
- * phptype://username:password@protocol+hostspec:110//usr/db_file.db
+ * phptype://username:password@protocol+hostspec:110//usr/db_file.db?mode=0644
* phptype://username:password@hostspec/database_name
* phptype://username:password@hostspec
* phptype://username@hostspec
@@ -565,7 +569,8 @@
}
foreach ($opts as $opt) {
list($key, $value) = explode('=', $opt);
- if (!isset($parsed[$key])) { // don't allow params overwrite
+ if ($key == 'mode' || !isset($parsed[$key])) {
+ // don't allow params overwrite, unless it's "mode"
$parsed[$key] = rawurldecode($value);
}
}