[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/sqlite3/sqlite3.c trunk/ext/sqlite3/sqlite3.c

2011-05-10 Thread Adam Harvey
aharvey  Tue, 10 May 2011 08:14:55 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=310877

Log:
Fix bug #54692 (SQLite3::open() Return Value) by correcting the SQLite3::open()
prototype.

Bug: http://bugs.php.net/54692 (Assigned) SQLite3::open() Return Value
  
Changed paths:
U   php/php-src/branches/PHP_5_3/ext/sqlite3/sqlite3.c
U   php/php-src/trunk/ext/sqlite3/sqlite3.c

Modified: php/php-src/branches/PHP_5_3/ext/sqlite3/sqlite3.c
===
--- php/php-src/branches/PHP_5_3/ext/sqlite3/sqlite3.c  2011-05-10 07:15:22 UTC 
(rev 310876)
+++ php/php-src/branches/PHP_5_3/ext/sqlite3/sqlite3.c  2011-05-10 08:14:55 UTC 
(rev 310877)
@@ -89,7 +89,7 @@
 zend_class_entry *php_sqlite3_stmt_entry;
 zend_class_entry *php_sqlite3_result_entry;

-/* {{{ proto bool SQLite3::open(String filename [, int Flags [, string 
Encryption Key]])
+/* {{{ proto void SQLite3::open(String filename [, int Flags [, string 
Encryption Key]])
Opens a SQLite 3 Database, if the build includes encryption then it will 
attempt to use the key. */
 PHP_METHOD(sqlite3, open)
 {

Modified: php/php-src/trunk/ext/sqlite3/sqlite3.c
===
--- php/php-src/trunk/ext/sqlite3/sqlite3.c 2011-05-10 07:15:22 UTC (rev 
310876)
+++ php/php-src/trunk/ext/sqlite3/sqlite3.c 2011-05-10 08:14:55 UTC (rev 
310877)
@@ -89,7 +89,7 @@
 zend_class_entry *php_sqlite3_stmt_entry;
 zend_class_entry *php_sqlite3_result_entry;

-/* {{{ proto bool SQLite3::open(String filename [, int Flags [, string 
Encryption Key]])
+/* {{{ proto void SQLite3::open(String filename [, int Flags [, string 
Encryption Key]])
Opens a SQLite 3 Database, if the build includes encryption then it will 
attempt to use the key. */
 PHP_METHOD(sqlite3, open)
 {

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/sqlite3/sqlite3.c trunk/ext/sqlite3/sqlite3.c

2011-01-03 Thread Scott MacVicar
scottmac Mon, 03 Jan 2011 19:15:36 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=307037

Log:
Fix error with initialisation flag being set too early. If encryption is 
enabled and fails to decrypt a crash can occur.

Also fix a WS error.

Changed paths:
U   php/php-src/branches/PHP_5_3/ext/sqlite3/sqlite3.c
U   php/php-src/trunk/ext/sqlite3/sqlite3.c

Modified: php/php-src/branches/PHP_5_3/ext/sqlite3/sqlite3.c
===
--- php/php-src/branches/PHP_5_3/ext/sqlite3/sqlite3.c  2011-01-03 18:47:46 UTC 
(rev 307036)
+++ php/php-src/branches/PHP_5_3/ext/sqlite3/sqlite3.c  2011-01-03 19:15:36 UTC 
(rev 307037)
@@ -40,7 +40,7 @@
 static PHP_GINIT_FUNCTION(sqlite3);
 static int php_sqlite3_authorizer(void *autharg, int access_type, const char 
*arg3, const char *arg4, const char *arg5, const char *arg6);
 static void sqlite3_param_dtor(void *data);
-static int php_sqlite3_compare_stmt_zval_free( php_sqlite3_free_list 
**free_list, zval *statement );
+static int php_sqlite3_compare_stmt_zval_free(php_sqlite3_free_list 
**free_list, zval *statement);

 /* {{{ Error Handler
 */
@@ -152,8 +152,6 @@
return;
}

-   db_obj-initialised = 1;
-
 #if SQLITE_HAS_CODEC
if (encryption_key_len  0) {
if (sqlite3_key(db_obj-db, encryption_key, encryption_key_len) 
!= SQLITE_OK) {
@@ -163,6 +161,8 @@
}
 #endif

+   db_obj-initialised = 1;
+
 #if PHP_API_VERSION  20100412
if (PG(safe_mode) || (PG(open_basedir)  *PG(open_basedir))) {
 #else

Modified: php/php-src/trunk/ext/sqlite3/sqlite3.c
===
--- php/php-src/trunk/ext/sqlite3/sqlite3.c 2011-01-03 18:47:46 UTC (rev 
307036)
+++ php/php-src/trunk/ext/sqlite3/sqlite3.c 2011-01-03 19:15:36 UTC (rev 
307037)
@@ -40,7 +40,7 @@
 static PHP_GINIT_FUNCTION(sqlite3);
 static int php_sqlite3_authorizer(void *autharg, int access_type, const char 
*arg3, const char *arg4, const char *arg5, const char *arg6);
 static void sqlite3_param_dtor(void *data);
-static int php_sqlite3_compare_stmt_zval_free( php_sqlite3_free_list 
**free_list, zval *statement );
+static int php_sqlite3_compare_stmt_zval_free(php_sqlite3_free_list 
**free_list, zval *statement);

 /* {{{ Error Handler
 */
@@ -149,8 +149,6 @@
return;
}

-   db_obj-initialised = 1;
-
 #if SQLITE_HAS_CODEC
if (encryption_key_len  0) {
if (sqlite3_key(db_obj-db, encryption_key, encryption_key_len) 
!= SQLITE_OK) {
@@ -160,6 +158,8 @@
}
 #endif

+   db_obj-initialised = 1;
+
 #if PHP_API_VERSION  20100412
if (PG(safe_mode) || (PG(open_basedir)  *PG(open_basedir))) {
 #else

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php