scottmac Thu May 7 16:50:54 2009 UTC Modified files: /php-src/ext/sqlite3 sqlite3.c Log: Some unicode updates for sqlite3 http://cvs.php.net/viewvc.cgi/php-src/ext/sqlite3/sqlite3.c?r1=1.38&r2=1.39&diff_format=u Index: php-src/ext/sqlite3/sqlite3.c diff -u php-src/ext/sqlite3/sqlite3.c:1.38 php-src/ext/sqlite3/sqlite3.c:1.39 --- php-src/ext/sqlite3/sqlite3.c:1.38 Mon Apr 27 18:15:54 2009 +++ php-src/ext/sqlite3/sqlite3.c Thu May 7 16:50:54 2009 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: sqlite3.c,v 1.38 2009/04/27 18:15:54 scottmac Exp $ */ +/* $Id: sqlite3.c,v 1.39 2009/05/07 16:50:54 scottmac Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -94,7 +94,8 @@ { php_sqlite3_db_object *db_obj; zval *object = getThis(); - char *filename, *encryption_key, *fullpath; + zstr filename; + char *encryption_key, *fullpath; zend_uchar filename_type; int filename_len, encryption_key_len = 0; long flags = SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE; @@ -116,17 +117,17 @@ } if (filename_type == IS_UNICODE) { - if (php_stream_path_encode(NULL, &filename, &filename_len, (UChar *)filename, filename_len, REPORT_ERRORS, FG(default_context)) == FAILURE) { + if (php_stream_path_encode(NULL, &filename.s, &filename_len, filename.u, filename_len, REPORT_ERRORS, FG(default_context)) == FAILURE) { zend_throw_exception(zend_exception_get_default(TSRMLS_C), "Unable to decode filepath", 0 TSRMLS_CC); return; } } - if (strncmp(filename, ":memory:", 8) != 0) { - if (!(fullpath = expand_filepath(filename, NULL TSRMLS_CC))) { + if (strncmp(filename.s, ":memory:", 8) != 0) { + if (!(fullpath = expand_filepath(filename.s, NULL TSRMLS_CC))) { zend_throw_exception(zend_exception_get_default(TSRMLS_C), "Unable to expand filepath", 0 TSRMLS_CC); if (filename_type == IS_UNICODE) { - efree(filename); + efree(filename.s); } return; } @@ -134,17 +135,17 @@ if (php_check_open_basedir(fullpath TSRMLS_CC)) { zend_throw_exception_ex(zend_exception_get_default(TSRMLS_C), 0 TSRMLS_CC, "open_basedir prohibits opening %s", fullpath); if (filename_type == IS_UNICODE) { - efree(filename); + efree(filename.s); } efree(fullpath); return; } } else { - fullpath = estrdup(filename); + fullpath = estrdup(filename.s); } if (filename_type == IS_UNICODE) { - efree(filename); + efree(filename.s); } #if SQLITE_VERSION_NUMBER >= 3005000 @@ -1264,7 +1265,7 @@ } /* }}} */ -/* {{{ proto bool SQLite3Stmt::bindParam(int parameter_number, mixed parameter [, int type]) +/* {{{ proto bool SQLite3Stmt::bindParam(mixed parameter_number, mixed parameter [, int type]) U Bind Paramater to a stmt variable. */ PHP_METHOD(sqlite3stmt, bindParam) { @@ -1295,7 +1296,7 @@ } /* }}} */ -/* {{{ proto bool SQLite3Stmt::bindValue(inte parameter_number, mixed parameter [, int type]) +/* {{{ proto bool SQLite3Stmt::bindValue(mixed parameter_number, mixed parameter [, int type]) U Bind Value of a parameter to a stmt variable. */ PHP_METHOD(sqlite3stmt, bindValue) { @@ -1654,7 +1655,7 @@ } /* }}} */ -/* {{{ proto int SQLite3Result::__construct() +/* {{{ proto int SQLite3Result::__construct() U __constructor for SQLite3Result. */ PHP_METHOD(sqlite3result, __construct) {
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php