scottmac Tue Sep 30 11:14:48 2008 UTC
Modified files: (Branch: PHP_5_3)
/php-src/ext/sqlite3 sqlite3.c
/php-src/ext/sqlite3/tests sqlite3_23_escape_string.phpt
Log:
MFH: SQLite3::escapeString can be static as it doesn't rely on an instance of
SQLite
http://cvs.php.net/viewvc.cgi/php-src/ext/sqlite3/sqlite3.c?r1=1.1.2.11&r2=1.1.2.12&diff_format=u
Index: php-src/ext/sqlite3/sqlite3.c
diff -u php-src/ext/sqlite3/sqlite3.c:1.1.2.11
php-src/ext/sqlite3/sqlite3.c:1.1.2.12
--- php-src/ext/sqlite3/sqlite3.c:1.1.2.11 Mon Sep 15 00:55:37 2008
+++ php-src/ext/sqlite3/sqlite3.c Tue Sep 30 11:14:48 2008
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: sqlite3.c,v 1.1.2.11 2008/09/15 00:55:37 scottmac Exp $ */
+/* $Id: sqlite3.c,v 1.1.2.12 2008/09/30 11:14:48 scottmac Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -1478,7 +1478,7 @@
PHP_ME(sqlite3, lastErrorMsg,
arginfo_sqlite3_lasterrormsg, ZEND_ACC_PUBLIC)
PHP_ME(sqlite3, loadExtension,
arginfo_sqlite3_loadextension, ZEND_ACC_PUBLIC)
PHP_ME(sqlite3, changes,
arginfo_sqlite3_changes, ZEND_ACC_PUBLIC)
- PHP_ME(sqlite3, escapeString,
arginfo_sqlite3_escapestring, ZEND_ACC_PUBLIC)
+ PHP_ME(sqlite3, escapeString,
arginfo_sqlite3_escapestring, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
PHP_ME(sqlite3, prepare,
arginfo_sqlite3_prepare, ZEND_ACC_PUBLIC)
PHP_ME(sqlite3, query,
arginfo_sqlite3_query, ZEND_ACC_PUBLIC)
PHP_ME(sqlite3, querySingle,
arginfo_sqlite3_querysingle, ZEND_ACC_PUBLIC)
http://cvs.php.net/viewvc.cgi/php-src/ext/sqlite3/tests/sqlite3_23_escape_string.phpt?r1=1.1.2.2&r2=1.1.2.3&diff_format=u
Index: php-src/ext/sqlite3/tests/sqlite3_23_escape_string.phpt
diff -u php-src/ext/sqlite3/tests/sqlite3_23_escape_string.phpt:1.1.2.2
php-src/ext/sqlite3/tests/sqlite3_23_escape_string.phpt:1.1.2.3
--- php-src/ext/sqlite3/tests/sqlite3_23_escape_string.phpt:1.1.2.2 Sun Jul
27 00:05:36 2008
+++ php-src/ext/sqlite3/tests/sqlite3_23_escape_string.phpt Tue Sep 30
11:14:48 2008
@@ -12,7 +12,7 @@
var_dump($db->exec('CREATE TABLE test (time INTEGER, id STRING)'));
echo "INSERT into table\n";
-var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", '" .
$db->escapeString("test''%") . "')"));
+var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", '" .
SQLite3::escapeString("test''%") . "')"));
var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ",
'b')"));
echo "SELECTING results\n";
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php