sterling Tue Jul 1 23:12:06 2003 EDT Modified files: /php-src/ext/sqlite sess_sqlite.c Log: further improve the performance and clean up Index: php-src/ext/sqlite/sess_sqlite.c diff -u php-src/ext/sqlite/sess_sqlite.c:1.8 php-src/ext/sqlite/sess_sqlite.c:1.9 --- php-src/ext/sqlite/sess_sqlite.c:1.8 Tue Jul 1 20:56:32 2003 +++ php-src/ext/sqlite/sess_sqlite.c Tue Jul 1 23:12:06 2003 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: sess_sqlite.c,v 1.8 2003/07/02 00:56:32 sterling Exp $ */ +/* $Id: sess_sqlite.c,v 1.9 2003/07/02 03:12:06 sterling Exp $ */ #include "php.h" @@ -44,7 +44,8 @@ /* TODO: do we need a safe_mode check here? */ db = sqlite_open(save_path, 0666, &errmsg); if (db == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "SQLite: failed to open/create session database `%s' - %s", save_path, errmsg); + php_error_docref(NULL TSRMLS_CC, E_WARNING, + "SQLite: failed to open/create session database `%s' - %s", save_path, errmsg); sqlite_freemem(errmsg); return FAILURE; } @@ -53,13 +54,15 @@ sqlite_busy_timeout(db, 60000); sqlite_exec(db, "PRAGMA default_synchronous = OFF", NULL, NULL, NULL); - + sqlite_exec(db, "PRAGMA count_changes = OFF", NULL, NULL, NULL); + /* This will fail if the table already exists, but that's not a big problem. I'm unclear as to how to check for a table's existence in SQLite -- that would be better here. */ sqlite_exec(db, "CREATE TABLE session_data (" - " sess_id TEXT PRIMARY KEY," - " value TEXT, updated INTEGER " + " sess_id PRIMARY KEY," + " value TEXT, " + " updated INTEGER " ")", NULL, NULL, NULL); PS_SET_MOD_DATA(db);
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php