[PHP-CVS] cvs: php-src /ext/standard http.c
pollita Sat Sep 6 02:57:41 2003 EDT Modified files: /php-src/ext/standard http.c Log: Fix segfault on uninitialized zval, skip NULL/Resource types, fix integer value handling, and process doubles/bools more efficiently. Index: php-src/ext/standard/http.c diff -u php-src/ext/standard/http.c:1.2 php-src/ext/standard/http.c:1.3 --- php-src/ext/standard/http.c:1.2 Sat Sep 6 01:41:36 2003 +++ php-src/ext/standard/http.c Sat Sep 6 02:57:40 2003 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: http.c,v 1.2 2003/09/06 05:41:36 pollita Exp $ */ +/* $Id: http.c,v 1.3 2003/09/06 06:57:40 pollita Exp $ */ #include "http.h" #include "php_ini.h" @@ -115,6 +115,9 @@ php_url_encode_hash_ex(Z_ARRVAL_PP(zdata), formstr, NULL, 0, newprefix, newprefix_len, "]", 1 TSRMLS_CC); ht->nApplyCount--; efree(newprefix); + } else if (Z_TYPE_PP(zdata) == IS_NULL || Z_TYPE_PP(zdata) == IS_RESOURCE) { + /* Skip these types */ + continue; } else { if (formstr->len) { smart_str_appendl(formstr, arg_sep, arg_sep_len); @@ -141,10 +144,15 @@ ekey = php_url_encode(Z_STRVAL_PP(zdata), Z_STRLEN_PP(zdata), &ekey_len); break; case IS_LONG: - ekey_len = spprintf(&ekey, 12, "%ld", idx); + case IS_BOOL: + ekey_len = spprintf(&ekey, 12, "%ld", Z_LVAL_PP(zdata)); + break; + case IS_DOUBLE: + ekey_len = spprintf(&ekey, 48, "%.*G", (int) EG(precision), Z_DVAL_PP(zdata)); break; default: /* fall back on convert to string */ + MAKE_STD_ZVAL(copyzval); *copyzval = **zdata; zval_copy_ctor(copyzval); convert_to_string_ex(©zval); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/standard http.h
pollita Sat Sep 6 01:41:49 2003 EDT Modified files: /php-src/ext/standard http.h Log: Standard Footer Index: php-src/ext/standard/http.h diff -u php-src/ext/standard/http.h:1.1 php-src/ext/standard/http.h:1.2 --- php-src/ext/standard/http.h:1.1 Fri Sep 5 20:35:21 2003 +++ php-src/ext/standard/http.h Sat Sep 6 01:41:48 2003 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: http.h,v 1.1 2003/09/06 00:35:21 pollita Exp $ */ +/* $Id: http.h,v 1.2 2003/09/06 05:41:48 pollita Exp $ */ #ifndef PHP_HTTP_H #define PHP_HTTP_H @@ -33,3 +33,13 @@ PHP_FUNCTION(http_build_query); #endif + +/* + * Local variables: + * tab-width: 4 + * c-basic-offset: 4 + * End: + * vim600: sw=4 ts=4 fdm=marker + * vim<600: sw=4 ts=4 + */ + -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/standard http.c
pollita Sat Sep 6 01:41:37 2003 EDT Modified files: /php-src/ext/standard http.c Log: Prevent Recursion Index: php-src/ext/standard/http.c diff -u php-src/ext/standard/http.c:1.1 php-src/ext/standard/http.c:1.2 --- php-src/ext/standard/http.c:1.1 Fri Sep 5 20:35:21 2003 +++ php-src/ext/standard/http.c Sat Sep 6 01:41:36 2003 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: http.c,v 1.1 2003/09/06 00:35:21 pollita Exp $ */ +/* $Id: http.c,v 1.2 2003/09/06 05:41:36 pollita Exp $ */ #include "http.h" #include "php_ini.h" @@ -39,6 +39,11 @@ return FAILURE; } + if (ht->nApplyCount > 0) { + /* Prevent Recuriosn */ + return SUCCESS; + } + arg_sep = INI_STR("arg_separator.output"); if (!arg_sep || !strlen(arg_sep)) { arg_sep = URL_DEFAULT_ARG_SEP; @@ -106,7 +111,9 @@ *(p++) = '['; *p = '\0'; } + ht->nApplyCount++; php_url_encode_hash_ex(Z_ARRVAL_PP(zdata), formstr, NULL, 0, newprefix, newprefix_len, "]", 1 TSRMLS_CC); + ht->nApplyCount--; efree(newprefix); } else { if (formstr->len) { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src / NEWS /ext/standard basic_functions.c config.m4 http.c http.h
pollita Fri Sep 5 20:35:22 2003 EDT Added files: /php-src/ext/standard http.c http.h Modified files: /php-src/ext/standard basic_functions.c config.m4 /php-srcNEWS Log: Introducing php_url_encode_hash_ex() internal function and http_build_query() userspace function. Index: php-src/ext/standard/basic_functions.c diff -u php-src/ext/standard/basic_functions.c:1.625 php-src/ext/standard/basic_functions.c:1.626 --- php-src/ext/standard/basic_functions.c:1.625Tue Sep 2 09:34:22 2003 +++ php-src/ext/standard/basic_functions.c Fri Sep 5 20:35:21 2003 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: basic_functions.c,v 1.625 2003/09/02 13:34:22 abies Exp $ */ +/* $Id: basic_functions.c,v 1.626 2003/09/06 00:35:21 pollita Exp $ */ #include "php.h" #include "php_streams.h" @@ -27,6 +27,7 @@ #include "internal_functions_registry.h" #include "php_standard.h" #include "php_math.h" +#include "http.h" #include "php_incomplete_class.h" #include "ext/standard/info.h" #include "ext/session/php_session.h" @@ -429,6 +430,7 @@ PHP_FE(urldecode, NULL) PHP_FE(rawurlencode, NULL) PHP_FE(rawurldecode, NULL) + PHP_FE(http_build_query, NULL) #ifdef HAVE_SYMLINK PHP_FE(readlink, NULL) Index: php-src/ext/standard/config.m4 diff -u php-src/ext/standard/config.m4:1.63 php-src/ext/standard/config.m4:1.64 --- php-src/ext/standard/config.m4:1.63 Fri Aug 8 21:12:41 2003 +++ php-src/ext/standard/config.m4 Fri Sep 5 20:35:21 2003 @@ -1,4 +1,4 @@ -dnl $Id: config.m4,v 1.63 2003/08/09 01:12:41 helly Exp $ -*- sh -*- +dnl $Id: config.m4,v 1.64 2003/09/06 00:35:21 pollita Exp $ -*- sh -*- divert(3)dnl @@ -307,6 +307,6 @@ incomplete_class.c url_scanner_ex.c ftp_fopen_wrapper.c \ http_fopen_wrapper.c php_fopen_wrapper.c credits.c css.c \ var_unserializer.c ftok.c sha1.c user_filters.c \ -filters.c proc_open.c sunfuncs.c streamsfuncs.c) +filters.c proc_open.c sunfuncs.c streamsfuncs.c http.c) PHP_ADD_MAKEFILE_FRAGMENT Index: php-src/NEWS diff -u php-src/NEWS:1.1465 php-src/NEWS:1.1466 --- php-src/NEWS:1.1465 Fri Sep 5 09:34:21 2003 +++ php-src/NEWSFri Sep 5 20:35:21 2003 @@ -25,6 +25,7 @@ . pg_version(). (Marcus) . dbase_get_header_info(). (Zak) . snmp_read_mib(). (Jani) + . http_build_query(). (Sara) - Added "resume_pos" context option to "ftp://"; wrapper. (Sara) - Added optional parameter to OCIWriteTemporaryLob() to specify the type of LOB (Patch by Novicky Marek <[EMAIL PROTECTED]>). (Thies) Index: php-src/ext/standard/http.c +++ php-src/ext/standard/http.c /* +--+ | PHP Version 4| +--+ | Copyright (c) 1997-2003 The PHP Group| +--+ | This source file is subject to version 3.0 of the PHP license, | | that is bundled with this package in the file LICENSE, and is| | available through the world-wide-web at the following url: | | http://www.php.net/license/3_0.txt. | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | [EMAIL PROTECTED] so we can mail you a copy immediately. | +--+ | Authors: Sara Golemon <[EMAIL PROTECTED]> | +--+ */ /* $Id: http.c,v 1.1 2003/09/06 00:35:21 pollita Exp $ */ #include "http.h" #include "php_ini.h" #include "url.h" #define URL_DEFAULT_ARG_SEP "&" /* {{{ php_url_encode_hash */ PHPAPI int php_url_encode_hash_ex(HashTable *ht, smart_str *formstr, const char *num_prefix, int num_prefix_len, const char *key_prefix, int key_prefix_len, const char *key_suffix, int key
[PHP-CVS] cvs: php-src /ext/sqlite sqlite.c
helly Fri Sep 5 16:09:20 2003 EDT Modified files: /php-src/ext/sqlite sqlite.c Log: Omitting is also possible here Index: php-src/ext/sqlite/sqlite.c diff -u php-src/ext/sqlite/sqlite.c:1.93 php-src/ext/sqlite/sqlite.c:1.94 --- php-src/ext/sqlite/sqlite.c:1.93Fri Sep 5 16:05:08 2003 +++ php-src/ext/sqlite/sqlite.c Fri Sep 5 16:09:19 2003 @@ -17,7 +17,7 @@ | Marcus Boerger <[EMAIL PROTECTED]> | +--+ - $Id: sqlite.c,v 1.93 2003/09/05 20:05:08 helly Exp $ + $Id: sqlite.c,v 1.94 2003/09/05 20:09:19 helly Exp $ */ #ifdef HAVE_CONFIG_H @@ -944,7 +944,7 @@ { php_info_print_table_start(); php_info_print_table_header(2, "SQLite support", "enabled"); - php_info_print_table_row(2, "PECL Module version", PHP_SQLITE_MODULE_VERSION " $Id: sqlite.c,v 1.93 2003/09/05 20:05:08 helly Exp $"); + php_info_print_table_row(2, "PECL Module version", PHP_SQLITE_MODULE_VERSION " $Id: sqlite.c,v 1.94 2003/09/05 20:09:19 helly Exp $"); php_info_print_table_row(2, "SQLite Library", sqlite_libversion()); php_info_print_table_row(2, "SQLite Encoding", sqlite_libencoding()); php_info_print_table_end(); @@ -1773,7 +1773,7 @@ efree(fci.params); } } else if (ctor_params && Z_TYPE_P(ctor_params) != IS_NULL) { - zend_throw_exception_ex(sqlite_ce_exception, 0 TSRMLS_CC, "Class %s does not have a constructor use NULL for parameter ctor_params", class_name); + zend_throw_exception_ex(sqlite_ce_exception, 0 TSRMLS_CC, "Class %s does not have a constructor, use NULL for parameter ctor_params or omit it", class_name); } } /* }}} */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/sqlite sqlite.c
helly Fri Sep 5 16:05:09 2003 EDT Modified files: /php-src/ext/sqlite sqlite.c Log: WS Index: php-src/ext/sqlite/sqlite.c diff -u php-src/ext/sqlite/sqlite.c:1.92 php-src/ext/sqlite/sqlite.c:1.93 --- php-src/ext/sqlite/sqlite.c:1.92Thu Sep 4 10:54:52 2003 +++ php-src/ext/sqlite/sqlite.c Fri Sep 5 16:05:08 2003 @@ -17,7 +17,7 @@ | Marcus Boerger <[EMAIL PROTECTED]> | +--+ - $Id: sqlite.c,v 1.92 2003/09/04 14:54:52 helly Exp $ + $Id: sqlite.c,v 1.93 2003/09/05 20:05:08 helly Exp $ */ #ifdef HAVE_CONFIG_H @@ -944,7 +944,7 @@ { php_info_print_table_start(); php_info_print_table_header(2, "SQLite support", "enabled"); - php_info_print_table_row(2, "PECL Module version", PHP_SQLITE_MODULE_VERSION " $Id: sqlite.c,v 1.92 2003/09/04 14:54:52 helly Exp $"); + php_info_print_table_row(2, "PECL Module version", PHP_SQLITE_MODULE_VERSION " $Id: sqlite.c,v 1.93 2003/09/05 20:05:08 helly Exp $"); php_info_print_table_row(2, "SQLite Library", sqlite_libversion()); php_info_print_table_row(2, "SQLite Encoding", sqlite_libencoding()); php_info_print_table_end(); @@ -1756,17 +1756,12 @@ fci.params = NULL; } fci.no_separation = 1; - fcc.initialized = 1; - fcc.function_handler = ce->constructor; - fcc.calling_scope = EG(scope); - fcc.object_pp = &return_value; - if (zend_call_function(&fci, &fcc TSRMLS_CC) == FAILURE) { zend_throw_exception_ex(sqlite_ce_exception, 0 TSRMLS_CC, "Could not execute %s::%s()", class_name, ce->constructor->common.function_name); } else { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/mysqli mysqli_nonapi.c mysqli_profiler.c mysqli_profiler.h
helly Fri Sep 5 15:27:27 2003 EDT Modified files: /php-src/ext/mysqli mysqli_nonapi.c mysqli_profiler.c mysqli_profiler.h Log: Fix warnings Index: php-src/ext/mysqli/mysqli_nonapi.c diff -u php-src/ext/mysqli/mysqli_nonapi.c:1.14 php-src/ext/mysqli/mysqli_nonapi.c:1.15 --- php-src/ext/mysqli/mysqli_nonapi.c:1.14 Mon Jul 28 06:23:36 2003 +++ php-src/ext/mysqli/mysqli_nonapi.c Fri Sep 5 15:27:26 2003 @@ -15,7 +15,7 @@ | Author: Georg Richter <[EMAIL PROTECTED]>| +--+ - $Id: mysqli_nonapi.c,v 1.14 2003/07/28 10:23:36 sniper Exp $ + $Id: mysqli_nonapi.c,v 1.15 2003/09/05 19:27:26 helly Exp $ */ #ifdef HAVE_CONFIG_H @@ -194,6 +194,8 @@ if (MyG(profiler)) { gettimeofday(&starttime, NULL); prresult = (PR_RESULT *)MYSQLI_PROFILER_NEW(prquery, MYSQLI_PR_RESULT, 1); + } else { + prresult = NULL; } result = (resultmode == MYSQLI_USE_RESULT) ? mysql_use_result(mysql) : mysql_store_result(mysql); Index: php-src/ext/mysqli/mysqli_profiler.c diff -u php-src/ext/mysqli/mysqli_profiler.c:1.9 php-src/ext/mysqli/mysqli_profiler.c:1.10 --- php-src/ext/mysqli/mysqli_profiler.c:1.9Thu Aug 28 16:51:18 2003 +++ php-src/ext/mysqli/mysqli_profiler.cFri Sep 5 15:27:26 2003 @@ -15,7 +15,7 @@ | Author: Georg Richter <[EMAIL PROTECTED]>| +--+ - $Id: mysqli_profiler.c,v 1.9 2003/08/28 20:51:18 andrey Exp $ + $Id: mysqli_profiler.c,v 1.10 2003/09/05 19:27:26 helly Exp $ */ #ifdef HAVE_CONFIG_H @@ -49,7 +49,9 @@ break; case MYSQLI_PR_RESULT: prnew = (PR_COMMON *)ecalloc(1, sizeof(PR_RESULT)); - break; + break; + default: + return NULL; } prnew->header.type = type; prnew->header.filename = estrdup(zend_get_executed_filename(TSRMLS_C)); Index: php-src/ext/mysqli/mysqli_profiler.h diff -u php-src/ext/mysqli/mysqli_profiler.h:1.4 php-src/ext/mysqli/mysqli_profiler.h:1.5 --- php-src/ext/mysqli/mysqli_profiler.h:1.4Mon Jun 16 20:49:24 2003 +++ php-src/ext/mysqli/mysqli_profiler.hFri Sep 5 15:27:26 2003 @@ -145,6 +145,8 @@ if (MyG(profiler))\ {\ cmd = (PR_COMMAND *)php_mysqli_profiler_new_object((PR_COMMON *)parent, MYSQLI_PR_COMMAND,1);\ +} else {\ + cmd = NULL;\ } #define MYSQLI_PROFILER_COMMAND_RETURNLONG(cmd, value)\ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/interbase/tests 003.phpt 004.phpt 005.phpt 006.phpt 007.phpt
abies Fri Sep 5 13:02:03 2003 EDT Modified files: /php-src/ext/interbase/tests003.phpt 004.phpt 005.phpt 006.phpt 007.phpt Log: Add missing CVS Ids Index: php-src/ext/interbase/tests/003.phpt diff -u php-src/ext/interbase/tests/003.phpt:1.4 php-src/ext/interbase/tests/003.phpt:1.5 --- php-src/ext/interbase/tests/003.phpt:1.4Mon Jun 2 08:37:16 2003 +++ php-src/ext/interbase/tests/003.phptFri Sep 5 13:02:02 2003 @@ -5,7 +5,7 @@ --POST-- --GET-- --FILE-- -http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/ming/tests .cvsignore swfaction.phpt
sniper Fri Sep 5 10:46:38 2003 EDT Added files: /php-src/ext/ming/tests .cvsignore swfaction.phpt Log: - Simple test for ming Index: php-src/ext/ming/tests/.cvsignore +++ php-src/ext/ming/tests/.cvsignore phpt.* *.diff *.log *.exp *.out *.php test.swf Index: php-src/ext/ming/tests/swfaction.phpt +++ php-src/ext/ming/tests/swfaction.phpt --TEST-- Ming: Simple SWFAction() test --SKIPIF-- --FILE-- addFill(0xff, 0, 0); $s->setRightFill($f); $s->movePenTo(-500,-500); $s->drawLineTo(500,-500); $s->drawLineTo(500,500); $s->drawLineTo(-500,500); $s->drawLineTo(-500,-500); $p = new SWFSprite(); $i = $p->add($s); $i->setDepth(1); $p->nextFrame(); for($n=0; $n<5; ++$n) { $i->rotate(-15); $p->nextFrame(); } $m = new SWFMovie(); $m->setBackground(0xff, 0xff, 0xff); $m->setDimension(6000,4000); $i = $m->add($p); $i->setDepth(1); $i->moveTo(1000,2000); $i->setName("box"); $m->add(new SWFAction("_root.box._x += 3;")); $m->nextFrame(); $m->add(new SWFAction("gotoFrame(0); play();")); $m->nextFrame(); $m->save('./test.swf'); echo md5_file('./test.swf'), "\n"; unlink('./test.swf'); ?> --EXPECT-- 9e47538692393b9915faf3fc7e686cd5 -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/interbase interbase.c
abies Fri Sep 5 10:21:26 2003 EDT Modified files: /php-src/ext/interbase interbase.c Log: Be more relaxed about dimensions of array arguments Index: php-src/ext/interbase/interbase.c diff -u php-src/ext/interbase/interbase.c:1.175 php-src/ext/interbase/interbase.c:1.176 --- php-src/ext/interbase/interbase.c:1.175 Thu Sep 4 18:37:14 2003 +++ php-src/ext/interbase/interbase.c Fri Sep 5 10:21:25 2003 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: interbase.c,v 1.175 2003/09/04 22:37:14 abies Exp $ */ +/* $Id: interbase.c,v 1.176 2003/09/05 14:21:25 abies Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -716,7 +716,7 @@ php_info_print_table_start(); php_info_print_table_row(2, "Interbase Support", "enabled"); - php_info_print_table_row(2, "Revision", "$Revision: 1.175 $"); + php_info_print_table_row(2, "Revision", "$Revision: 1.176 $"); #ifdef COMPILE_DL_INTERBASE php_info_print_table_row(2, "Dynamic Module", "Yes"); #endif @@ -1105,7 +1105,7 @@ for (i = 0; i < sqlda->sqld; i++, var++) { unsigned short dim; - unsigned long ar_size; + unsigned long ar_size = 1; if ((var->sqltype & ~1) == SQL_ARRAY) { ISC_ARRAY_DESC *ar_desc = &IB_ARRAY[i].ar_desc; @@ -1121,7 +1121,7 @@ case blr_text: case blr_text2: IB_ARRAY[i].el_type = SQL_TEXT; - IB_ARRAY[i].el_size = ar_desc->array_desc_length + 1; + IB_ARRAY[i].el_size = ar_desc->array_desc_length; break; case blr_short: IB_ARRAY[i].el_type = SQL_SHORT; @@ -1165,8 +1165,12 @@ break; #endif case blr_varying: - case blr_varying2: /* changed to SQL_TEXT ? */ - /* sql_type = SQL_VARYING; Why? FIXME: ??? */ + case blr_varying2: + /** +* IB has a strange way of handling VARCHAR arrays. It doesn't store +* the length in the first short, as with VARCHAR fields. It does, +* however, expect the extra short to be allocated for each element. +*/ IB_ARRAY[i].el_type = SQL_TEXT; IB_ARRAY[i].el_size = ar_desc->array_desc_length + sizeof(short); break; @@ -1174,7 +1178,12 @@ case blr_blob_id: case blr_cstring: case blr_cstring2: - /* FIXME */ + /** +* These types are mentioned as array types in the manual, but I +* wouldn't know how to create an array field with any of these +* types. I assume these types are not applicable to arrays, and +* were mentioned erroneously. +*/ default: _php_ibase_module_error("Unsupported array type %d in relation '%s' column '%s'" TSRMLS_CC, ar_desc->array_desc_dtype, var->relname, var->sqlname); efree(IB_ARRAY); @@ -1182,7 +1191,7 @@ return FAILURE; } /* switch array_desc_type */ - ar_size = 1; /* calculate elements count */ + /* calculate elements count */ for (dim = 0; dim < ar_desc->array_desc_dimensions; dim++) { ar_size *= 1 + ar_desc->array_desc_bounds[dim].array_bound_upper - ar_desc->array_desc_bounds[dim].array_bound_lower; } @@ -1323,48 +1332,64 @@ /* {{{ _php_ibase_bind_array() */ static int _php_ibase_bind_array(zval *val, char *buf, unsigned long buf_size, ibase_array *array, int dim TSRMLS_DC) { - int - u_bound = array->ar_desc.array_desc_bounds[dim].array_bound_upper, + zval null_val, *pnull_val = &null_val; + int u_bound = array->ar_desc.array_desc_bounds[dim].array_bound_upper, l_bound = array->ar_d
[PHP-CVS] cvs: php-src / NEWS
sniper Fri Sep 5 09:34:22 2003 EDT Modified files: /php-srcNEWS Log: grouped DBX stuff Index: php-src/NEWS diff -u php-src/NEWS:1.1464 php-src/NEWS:1.1465 --- php-src/NEWS:1.1464 Fri Sep 5 08:14:57 2003 +++ php-src/NEWSFri Sep 5 09:34:21 2003 @@ -4,6 +4,10 @@ ?? ??? 2003, PHP 5 Beta 2 - Added new COM extension with integrated .Net support. (Wez) +- Improved the DBX extension: (Marc) + . Added DBX_RESULT_UNBUFFERED flag for dbx_query(). + . Added dbx_fetch_row() + . Added SQLite support. - Improved the Interbase extension: (Ard Biesheuvel) . Added support for multiple databases into ibase_trans() . Added support for CREATE DATABASE, SET TRANSACTION and EXECUTE PROCEDURE @@ -24,9 +28,6 @@ - Added "resume_pos" context option to "ftp://"; wrapper. (Sara) - Added optional parameter to OCIWriteTemporaryLob() to specify the type of LOB (Patch by Novicky Marek <[EMAIL PROTECTED]>). (Thies) -- Added DBX_RESULT_UNBUFFERED flag for dbx_query. (Marc) -- Added dbx_fetch_row() function to DBX. (Marc) -- Added SQLite support to DBX. (Marc) - Added reflection API. (Andrei, George, Timm) - Fixed support for fields within XML documents in ext/xml. (Sterling) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/interbase/tests 007.phpt
abies Fri Sep 5 09:08:42 2003 EDT Added files: /php-src/ext/interbase/tests007.phpt Log: Test array handling Index: php-src/ext/interbase/tests/007.phpt +++ php-src/ext/interbase/tests/007.phpt --TEST-- InterBase: array handling --SKIPIF-- --POST-- --GET-- --FILE-- V_CHAR[$i],$v_char[$i],strlen($v_char[$i])) != 0) { echo " CHAR[$i] fail:\n"; echo " in: ".$v_char[$i]."\n"; echo " out: ".$row->V_CHAR[$i]."\n"; } if($row->V_DATE[$i] != $v_date[$i]) { echo " DATE[$i] fail\n"; echo " in: ".$v_date[$i]."\n"; echo " out: ".$row->V_DATE[$i]."\n"; } if($row->V_DECIMAL[$i] != $v_decimal[$i]) { echo " DECIMAL[$i] fail\n"; echo " in: ".$v_decimal[$i]."\n"; echo " out: ".$row->V_DECIMAL[$i]."\n"; } if(abs($row->V_DOUBLE[$i] - $v_double[$i]) > abs($v_double[$i] / 1E15)) { echo " DOUBLE[$i] fail\n"; echo " in: ".$v_double[$i]."\n"; echo " out: ".$row->V_DOUBLE[$i]."\n"; } if(abs($row->V_FLOAT[$i] - $v_float[$i]) > abs($v_float[$i] / 1E7)) { echo " FLOAT[$i] fail\n"; echo " in: ".$v_float[$i]."\n"; echo " out: ".$row->V_FLOAT[$i]."\n"; } if($row->V_INTEGER[$i] != $v_integer[$i]) { echo " INTEGER[$i] fail\n"; echo " in: ".$v_integer[$i]."\n"; echo " out: ".$row->V_INTEGER[$i]."\n"; } if ($row->V_NUMERIC[$i] != $v_numeric[$i]) { echo " NUMERIC[$i] fail\n"; echo " in: ".$v_numeric[$i]."\n"; echo " out: ".$row->V_NUMERIC[$i]."\n"; } if ($row->V_SMALLINT[$i] != $v_smallint[$i]) { echo " SMALLINT[$i] fail\n"; echo " in: ".$v_smallint[$i]."\n"; echo " out: ".$row->V_SMALLINT[$i]."\n"; } if ($row->V_VARCHAR[$i] != $v_varchar[$i]) { echo " VARCHAR[$i] fail:\n"; echo " in: ".$v_varchar[$i]."\n"; echo " out: ".$row->V_VARCHAR[$i]."\n"; } } ibase_free_result($sel); }/* for($iter) */ echo "select\n"; $sel = ibase_query("SELECT v_multi[5,5,5],v_multi[10,10,10] FROM test7 WHERE iter = 0"); print_r(ibase_fetch_row($sel)); ibase_free_result($sel); for($iter = 1; $iter <= 3; $iter++) { if(!($sel = ibase_query( "select iter from test7 where v_char[$iter] LIKE ?", $v_char[$iter]."%")) || !ibase_fetch_row($sel)) { echo "CHAR fail\n"; } ibase_free_result($sel); if(!($sel = ibase_query( "select iter from test7 where v_date[$iter] = ?", $v_date[$iter])) || !ibase_fetch_row($sel)) { echo "DATE fail\n"; } ibase_free_result($sel); if(!($sel = ibase_query( "select iter from test7 where v_decimal[$iter] = ?", $v_decimal[$iter])) || !ibase_fetch_row($sel)) { echo "DECIMAL fail\n"; } ibase_free_result($sel); if(!($sel = ibase_query( "select iter from test7 where v_integer[$iter] = ?", $v_integer[$iter])) || !ibase_fetch_row($sel)) { echo "INTEGER fail\n"; } ibase_free_result($sel); if(!($sel = ibase_query( "select iter from test7 where v_numeric[$iter] = ?", $v_numeric[$iter])) || !ibase_fetch_row($sel)) { echo "NUMERIC fail\n"; } ibase_free_result($sel); if(!($sel = ibase_query( "select iter from test7 where v_smallint[$iter] = ?", $v_smallint[$iter])) || !ibase_fetch_row($sel)) {
RE: [PHP-CVS] cvs: php-src / NEWS
> > Added updates to dbx module to NEWS by hand as @ doesn't work > > according to Jani (since when is this?). > since a long time now. Slipped by me then :-) BTW, someone better update README.CVS-RULES too then? > Btw. why not group the dbx entries as we normally do > if several things are dded/improved in one area. This change would still amount to 2 lines and I already grouped it with the SQLite support... but feel free :-) Cheeroi, Marc. -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php-src / NEWS
Hello Marc, Friday, September 5, 2003, 2:14:58 PM, you wrote: > mboeren Fri Sep 5 08:14:58 2003 EDT > Modified files: > /php-src NEWS > Log: > Added updates to dbx module to NEWS by hand as @ doesn't work > according to Jani (since when is this?). since a long time now. Btw. why not group the dby entries as we normally do if several things are dded/improved in one area. -- Best regards, Marcusmailto:[EMAIL PROTECTED] -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/interbase/tests 006.phpt
abies Fri Sep 5 08:18:04 2003 EDT Modified files: /php-src/ext/interbase/tests006.phpt Log: Make the test fail if anything goes wrong :-) Some CS Index: php-src/ext/interbase/tests/006.phpt diff -u php-src/ext/interbase/tests/006.phpt:1.6 php-src/ext/interbase/tests/006.phpt:1.7 --- php-src/ext/interbase/tests/006.phpt:1.6Wed Sep 3 13:15:40 2003 +++ php-src/ext/interbase/tests/006.phptFri Sep 5 08:18:03 2003 @@ -38,7 +38,7 @@ echo "insert\n"; - for($iter = 0; $iter < 3; $iter++){ + for($iter = 0; $iter < 3; $iter++) { /* prepare data */ $v_char = rand_str(1000); $v_date = rand_datetime(); @@ -59,47 +59,47 @@ $sel = ibase_query("select * from test6 where iter = $iter"); $row = ibase_fetch_object($sel); - if(substr($row->V_CHAR,0,strlen($v_char)) != $v_char){ + if(substr($row->V_CHAR,0,strlen($v_char)) != $v_char) { echo " CHAR fail:\n"; echo " in: $v_char\n"; echo " out: $row->V_CHAR\n"; } - if($row->V_DATE != $v_date){ + if($row->V_DATE != $v_date) { echo " DATE fail\n"; echo " in: $v_date\n"; echo " out: $row->V_DATE\n"; } - if($row->V_DECIMAL != $v_decimal){ + if($row->V_DECIMAL != $v_decimal) { echo " DECIMAL fail\n"; echo " in: $v_decimal\n"; echo " out: $row->V_DECIMAL\n"; } - if(abs($row->V_DOUBLE - $v_double) > abs($v_double / 1E15)){ + if(abs($row->V_DOUBLE - $v_double) > abs($v_double / 1E15)) { echo " DOUBLE fail\n"; echo " in: $v_double\n"; echo " out: $row->V_DOUBLE\n"; } - if(abs($row->V_FLOAT - $v_float) > abs($v_float / 1E7)){ + if(abs($row->V_FLOAT - $v_float) > abs($v_float / 1E7)) { echo " FLOAT fail\n"; echo " in: $v_float\n"; echo " out: $row->V_FLOAT\n"; } - if($row->V_INTEGER != $v_integer){ + if($row->V_INTEGER != $v_integer) { echo " INTEGER fail\n"; echo " in: $v_integer\n"; echo " out: $row->V_INTEGER\n"; } - if ($row->V_NUMERIC != $v_numeric){ + if ($row->V_NUMERIC != $v_numeric) { echo " NUMERIC fail\n"; echo " in: $v_numeric\n"; echo " out: $row->V_NUMERIC\n"; } - if ($row->V_SMALLINT != $v_smallint){ + if ($row->V_SMALLINT != $v_smallint) { echo " SMALLINT fail\n"; echo " in: $v_smallint\n"; echo " out: $row->V_SMALLINT\n"; } - if ($row->V_VARCHAR != $v_varchar){ + if ($row->V_VARCHAR != $v_varchar) { echo " VARCHAR fail:\n"; echo " in: $v_varchar\n"; echo " out: $row->V_VARCHAR\n"; @@ -108,7 +108,7 @@ }/* for($iter)*/ echo "select\n"; - for($iter = 0; $iter < 3; $iter++){ + for($iter = 0; $iter < 3; $iter++) { /* prepare data */ $v_char = rand_str(1000); $v_date = rand_datetime(); @@ -132,35 +132,49 @@ /* test all types */ if(!($sel = ibase_query( - "select iter from test6 where v_char = ?", $v_char))) + "select iter from test6 where v_char = ?", $v_char)) || + !ibase_fetch_row($sel)) { echo "CHAR fail\n"; + } ibase_free_result($sel); if(!($sel = ibase_query( - "select iter from test6 where v_date = ?", $v_date))) + "select iter from test6 where v_date = ?", $v_date)) || + !ibase_fetch_row($sel)) { echo "DATE fail\n"; + } ibase_free_result($sel); if(!($sel = ibase_query( - "select iter from test6 where v_decimal = ?", $v_decimal))) + "select iter from test6 where v_decimal = ?", $v_decimal)) || + !ibase_fetch_row($sel)) { echo "DECIMAL fail\n"; + } ibase_free_result($sel); if(!($sel = ibase_query( - "select iter from test6 where v_integer = ?", $v_integer
[PHP-CVS] cvs: php-src / NEWS
mboeren Fri Sep 5 08:14:58 2003 EDT Modified files: /php-srcNEWS Log: Added updates to dbx module to NEWS by hand as @ doesn't work according to Jani (since when is this?). Index: php-src/NEWS diff -u php-src/NEWS:1.1463 php-src/NEWS:1.1464 --- php-src/NEWS:1.1463 Thu Aug 28 12:06:49 2003 +++ php-src/NEWSFri Sep 5 08:14:57 2003 @@ -24,6 +24,8 @@ - Added "resume_pos" context option to "ftp://"; wrapper. (Sara) - Added optional parameter to OCIWriteTemporaryLob() to specify the type of LOB (Patch by Novicky Marek <[EMAIL PROTECTED]>). (Thies) +- Added DBX_RESULT_UNBUFFERED flag for dbx_query. (Marc) +- Added dbx_fetch_row() function to DBX. (Marc) - Added SQLite support to DBX. (Marc) - Added reflection API. (Andrei, George, Timm) - Fixed support for fields within XML documents in ext/xml. -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/dbx dbx.c dbx.h php_dbx.h /ext/dbx/tests 002.phpt 005.phpt 010.phpt
mboeren Fri Sep 5 04:39:27 2003 EDT Added files: /php-src/ext/dbx/tests 010.phpt Modified files: /php-src/ext/dbxdbx.c dbx.h php_dbx.h /php-src/ext/dbx/tests 002.phpt 005.phpt Log: Added DBX_RESULT_UNBUFFERED flag for dbx_query. Added dbx_fetch_row() function. Added/updated tests for both. @Added DBX_RESULT_UNBUFFERED flag for dbx_query. (Marc) @Added dbx_fetch_row() function. (Marc) Index: php-src/ext/dbx/dbx.c diff -u php-src/ext/dbx/dbx.c:1.53 php-src/ext/dbx/dbx.c:1.54 --- php-src/ext/dbx/dbx.c:1.53 Thu Jul 10 04:34:03 2003 +++ php-src/ext/dbx/dbx.c Fri Sep 5 04:39:25 2003 @@ -20,7 +20,7 @@ +--+ */ -/* $Id: dbx.c,v 1.53 2003/07/10 08:34:03 mboeren Exp $ */ +/* $Id: dbx.c,v 1.54 2003/09/05 08:39:25 mboeren Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -100,6 +100,20 @@ return 1; } +int split_dbx_result_object(zval **dbx_result, zval ***pdbx_link, zval ***pdbx_handle, zval ***pdbx_flags, zval ***pdbx_info, zval ***pdbx_cols , zval ***pdbx_rows TSRMLS_DC) +{ + convert_to_object_ex(dbx_result); + if (zend_hash_find(Z_OBJPROP_PP(dbx_result), "link", 5, (void **) pdbx_link)==FAILURE + || zend_hash_find(Z_OBJPROP_PP(dbx_result), "handle", 7, (void **) pdbx_handle)==FAILURE + || zend_hash_find(Z_OBJPROP_PP(dbx_result), "flags", 6, (void **) pdbx_flags)==FAILURE + || zend_hash_find(Z_OBJPROP_PP(dbx_result), "info", 5, (void **) pdbx_info)==FAILURE + || zend_hash_find(Z_OBJPROP_PP(dbx_result), "cols", 5, (void **) pdbx_cols)==FAILURE + || zend_hash_find(Z_OBJPROP_PP(dbx_result), "rows", 5, (void **) pdbx_rows)==FAILURE) { + return 0; + } + return 1; +} + /* from dbx.h, to be used in support-files (dbx_mysql.c etc...) */ void dbx_call_any_function(INTERNAL_FUNCTION_PARAMETERS, char *function_name, zval **returnvalue, int number_of_arguments, zval ***params) { @@ -149,6 +163,7 @@ ZEND_FE(dbx_connect,NULL) ZEND_FE(dbx_close, NULL) ZEND_FE(dbx_query, NULL) + ZEND_FE(dbx_fetch_row, NULL) ZEND_FE(dbx_error, NULL) ZEND_FE(dbx_escape_string, NULL) @@ -197,6 +212,7 @@ REGISTER_LONG_CONSTANT("DBX_RESULT_INFO", DBX_RESULT_INFO, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("DBX_RESULT_INDEX", DBX_RESULT_INDEX, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("DBX_RESULT_ASSOC", DBX_RESULT_ASSOC, CONST_CS | CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("DBX_RESULT_UNBUFFERED", DBX_RESULT_UNBUFFERED, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("DBX_COLNAMES_UNCHANGED", DBX_COLNAMES_UNCHANGED, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("DBX_COLNAMES_UPPERCASE", DBX_COLNAMES_UPPERCASE, CONST_CS | CONST_PERSISTENT); @@ -231,7 +247,7 @@ { php_info_print_table_start(); php_info_print_table_row(2, "dbx support", "enabled"); - php_info_print_table_row(2, "dbx version", "1.0.1"); + php_info_print_table_row(2, "dbx version", "1.1.0"); php_info_print_table_row(2, "supported databases", "MySQL\nODBC\nPostgreSQL\nMicrosoft SQL Server\nFrontBase\nOracle 8 (oci8)\nSybase-CT\nSQLite"); php_info_print_table_end(); DISPLAY_INI_ENTRIES(); @@ -395,11 +411,12 @@ convert_to_long_ex(arguments[2]); query_flags = Z_LVAL_PP(arguments[2]); /* fieldnames are needed for association! */ - result_flags = (query_flags & DBX_RESULT_INFO) | (query_flags & DBX_RESULT_INDEX) | (query_flags & DBX_RESULT_ASSOC); + result_flags = (query_flags & DBX_RESULT_INFO) | (query_flags & DBX_RESULT_INDEX) | (query_flags & DBX_RESULT_ASSOC) | (query_flags & DBX_RESULT_UNBUFFERED); if (result_flags & DBX_RESULT_ASSOC) { result_flags |= DBX_RESULT_INFO; } - if (!result_flags) result_flags = DBX_RESULT_INFO | DBX_RESULT_INDEX | DBX_RESULT_ASSOC; + if (!result_flags) result_flags = DBX_RESULT_INFO | DBX_RESULT_INDEX | DBX_RESULT_ASSOC; + if (result_flags == DBX_RESULT_UNBUFFERED) result_flags |= DBX_RESULT_INFO | DBX_RESULT_INDEX | DBX_RESULT_ASSOC; /* override ini-setting for colcase */ if (query_flags & DBX_COLNAMES_UNCHANGED) { colcase = DBX_COLNAMES_UNCHANGED; @@ -427,8 +444,15 @@ /* init return_value as object (of rows) */ object_init(return_value); + zend_hash_update(Z_OBJPROP_P(return_value), "link", 5, (void *)(arguments[0]), sizeof(zval *), NULL); +/* need extra refcount here otherwise the link object is destroyed when the + * query resultobject is destroyed (or not assigned!) + */ +