[PHP-CVS] cvs: php-src / NEWS /ext/pcre/tests bug33200.phpt /ext/session session.c /ext/session/tests 007.phpt 008-php4.2.3.phpt 008.phpt 009.phpt 016.phpt /main main.c php_globals.h php_variables
dmitry Thu Mar 16 09:44:42 2006 UTC Modified files: /php-srcNEWS /ZendEngine2/tests unset_cv05.phpt /php-src/ext/pcre/tests bug33200.phpt /php-src/ext/sessionsession.c /php-src/ext/session/tests 007.phpt 008-php4.2.3.phpt 008.phpt 009.phpt 016.phpt /php-src/main main.c php_globals.h php_variables.c Log: Dropped register_long_arrays, added E_CORE for all dropped setting http://cvs.php.net/viewcvs.cgi/php-src/NEWS?r1=1.2100&r2=1.2101&diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2100 php-src/NEWS:1.2101 --- php-src/NEWS:1.2100 Fri Mar 10 08:29:22 2006 +++ php-src/NEWSThu Mar 16 09:44:41 2006 @@ -3,6 +3,7 @@ ?? ??? , PHP 6.0 - Unicode support. (Andrei, Dmitry, et al) - Dropped safe_mode support (Ilia, Andi) +- Dropped register_long_arrays (Dmitry) - Droped register_globals support (Pierre) - session_register, session_unregister and session_is_registered removed they depend on register_globals http://cvs.php.net/viewcvs.cgi/ZendEngine2/tests/unset_cv05.phpt?r1=1.4&r2=1.5&diff_format=u Index: ZendEngine2/tests/unset_cv05.phpt diff -u ZendEngine2/tests/unset_cv05.phpt:1.4 ZendEngine2/tests/unset_cv05.phpt:1.5 --- ZendEngine2/tests/unset_cv05.phpt:1.4 Fri Jul 8 07:57:47 2005 +++ ZendEngine2/tests/unset_cv05.phpt Thu Mar 16 09:44:41 2006 @@ -1,21 +1,16 @@ --TEST-- unset() CV 5 (indirect unset() of global variable in session_start()) --INI-- -register_long_arrays=1 session.auto_start=0 session.save_handler=files --SKIPIF-- - + --FILE-- --EXPECTF-- http://cvs.php.net/viewcvs.cgi/php-src/ext/pcre/tests/bug33200.phpt?r1=1.2&r2=1.3&diff_format=u Index: php-src/ext/pcre/tests/bug33200.phpt diff -u php-src/ext/pcre/tests/bug33200.phpt:1.2 php-src/ext/pcre/tests/bug33200.phpt:1.3 --- php-src/ext/pcre/tests/bug33200.phpt:1.2Wed Mar 8 00:43:28 2006 +++ php-src/ext/pcre/tests/bug33200.phptThu Mar 16 09:44:41 2006 @@ -2,8 +2,6 @@ Bug #33200 (magic_quotes_sybase = On makes 'e' modifier misbehave) --SKIPIF-- die('skip magic_quotes removed'); ---INI-- -magic_quotes_sybase=1 --FILE-- http://cvs.php.net/viewcvs.cgi/php-src/ext/session/session.c?r1=1.431&r2=1.432&diff_format=u Index: php-src/ext/session/session.c diff -u php-src/ext/session/session.c:1.431 php-src/ext/session/session.c:1.432 --- php-src/ext/session/session.c:1.431 Tue Mar 7 00:20:53 2006 +++ php-src/ext/session/session.c Thu Mar 16 09:44:41 2006 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: session.c,v 1.431 2006/03/07 00:20:53 pajoye Exp $ */ +/* $Id: session.c,v 1.432 2006/03/16 09:44:41 dmitry Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -466,13 +466,7 @@ array_init(session_vars); PS(http_session_vars) = session_vars; - if (PG(register_long_arrays)) { - ZEND_SET_GLOBAL_VAR_WITH_LENGTH("HTTP_SESSION_VARS", sizeof("HTTP_SESSION_VARS"), PS(http_session_vars), 2, 1); - ZEND_SET_GLOBAL_VAR_WITH_LENGTH("_SESSION", sizeof("_SESSION"), PS(http_session_vars), 2, 1); - } - else { - ZEND_SET_GLOBAL_VAR_WITH_LENGTH("_SESSION", sizeof("_SESSION"), PS(http_session_vars), 1, 0); - } + ZEND_SET_GLOBAL_VAR_WITH_LENGTH("_SESSION", sizeof("_SESSION"), PS(http_session_vars), 1, 0); } static char *php_session_encode(int *newlen TSRMLS_DC) http://cvs.php.net/viewcvs.cgi/php-src/ext/session/tests/007.phpt?r1=1.10&r2=1.11&diff_format=u Index: php-src/ext/session/tests/007.phpt diff -u php-src/ext/session/tests/007.phpt:1.10 php-src/ext/session/tests/007.phpt:1.11 --- php-src/ext/session/tests/007.phpt:1.10 Tue Mar 7 00:20:53 2006 +++ php-src/ext/session/tests/007.phpt Thu Mar 16 09:44:41 2006 @@ -3,7 +3,6 @@ --SKIPIF-- --INI-- -register_long_arrays=1 session.use_cookies=0 session.cache_limiter= session.bug_compat_42=1 @@ -19,26 +18,26 @@ session_start(); session_destroy(); -### Phase 2 $HTTP_SESSION_VARS["c"] does not contain any value +### Phase 2 $_SESSION["c"] does not contain any value session_id("abtest"); $_SESSION['c'] = $c; unset($c); $c = 3.14; session_write_close(); -unset($HTTP_SESSION_VARS); +unset($_SESSION); unset($c); -### Phase 3 $HTTP_SESSION_VARS["c"] is set +### Phase 3 $_SESSION["c"] is set session_start(); $c = $_SESSION['c']; var_dump($c); -var_dump($HTTP_SESSION_VARS); +var_dump($_SESSION); unset($c); $c = 2.78; session_write_close(); -unset($HTTP_SESSION_VARS); +unset($_SESSION); unset($c); ### Phase 4 final @@ -46,7 +45,7 @@ session_start(); $c = $_SESSION['c']; var_dump($c); -var_dump($HTTP_SESSION_VARS); +var_dump($_SESSION); session_destroy(); ?> http://cvs.php.net/viewcvs.cgi/php-src/ext/session/tests/008-php4.2.3.phpt?r1=1.8&r2=1.9&diff_format=u Index: php-src/ext/session/tests/008-php4.2.3.phpt diff -u php-src/ext/session/tests/008
[PHP-CVS] cvs: php-src / NEWS /ext/dom php_dom.c /ext/simplexml simplexml.c /main main.c /tests/lang bug22367.phpt ZendEngine2 zend.c zend_API.c zend_execute.c zend_execute.h zend_execute_API.c z
dmitry Thu Mar 16 10:33:23 2006 UTC Removed files: /ZendEngine2/tests bug30332.phpt bug31828.phpt bug32080.phpt bug32852.phpt bug33243.phpt bug34712.phpt bug34767.phpt /php-src/tests/lang bug22367.phpt Modified files: /php-srcNEWS /ZendEngine2zend.c zend_API.c zend_execute.c zend_execute.h zend_execute_API.c zend_globals.h zend_objects.c zend_operators.c zend_vm_def.h zend_vm_execute.h /php-src/ext/domphp_dom.c /php-src/ext/simplexml simplexml.c /php-src/main main.c Log: Dropped zend.ze1_compatibility_mode http://cvs.php.net/viewcvs.cgi/php-src/NEWS?r1=1.2101&r2=1.2102&diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2101 php-src/NEWS:1.2102 --- php-src/NEWS:1.2101 Thu Mar 16 09:44:41 2006 +++ php-src/NEWSThu Mar 16 10:33:22 2006 @@ -3,6 +3,7 @@ ?? ??? , PHP 6.0 - Unicode support. (Andrei, Dmitry, et al) - Dropped safe_mode support (Ilia, Andi) +- Dropped zend.ze1_compatibility_mode (Dmitry) - Dropped register_long_arrays (Dmitry) - Droped register_globals support (Pierre) - session_register, session_unregister and session_is_registered removed they http://cvs.php.net/viewcvs.cgi/ZendEngine2/zend.c?r1=1.341&r2=1.342&diff_format=u Index: ZendEngine2/zend.c diff -u ZendEngine2/zend.c:1.341 ZendEngine2/zend.c:1.342 --- ZendEngine2/zend.c:1.341Thu Mar 2 00:40:19 2006 +++ ZendEngine2/zend.c Thu Mar 16 10:33:23 2006 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: zend.c,v 1.341 2006/03/02 00:40:19 helly Exp $ */ +/* $Id: zend.c,v 1.342 2006/03/16 10:33:23 dmitry Exp $ */ #include "zend.h" #include "zend_extensions.h" @@ -210,7 +210,6 @@ ZEND_INI_BEGIN() ZEND_INI_ENTRY("error_reporting", NULL, ZEND_INI_ALL, OnUpdateErrorReporting) - STD_ZEND_INI_BOOLEAN("zend.ze1_compatibility_mode", "0", ZEND_INI_ALL, OnUpdateBool, ze1_compatibility_mode, zend_executor_globals, executor_globals) /* Unicode .ini entries */ STD_ZEND_INI_BOOLEAN("unicode_semantics", "0", ZEND_INI_SYSTEM, OnUpdateBool, unicode, zend_unicode_globals, unicode_globals) http://cvs.php.net/viewcvs.cgi/ZendEngine2/zend_API.c?r1=1.353&r2=1.354&diff_format=u Index: ZendEngine2/zend_API.c diff -u ZendEngine2/zend_API.c:1.353 ZendEngine2/zend_API.c:1.354 --- ZendEngine2/zend_API.c:1.353Sun Mar 5 16:09:45 2006 +++ ZendEngine2/zend_API.c Thu Mar 16 10:33:23 2006 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: zend_API.c,v 1.353 2006/03/05 16:09:45 helly Exp $ */ +/* $Id: zend_API.c,v 1.354 2006/03/16 10:33:23 dmitry Exp $ */ #include "zend.h" #include "zend_execute.h" @@ -154,25 +154,6 @@ while (param_count-->0) { zval **value = (zval**)(p-arg_count); - if (EG(ze1_compatibility_mode) && Z_TYPE_PP(value) == IS_OBJECT) { - zval *value_ptr; - zstr class_name; - zend_uint class_name_len; - int dup; - - dup = zend_get_object_classname(*value, &class_name, &class_name_len TSRMLS_CC); - - ALLOC_ZVAL(value_ptr); - *value_ptr = **value; - INIT_PZVAL(value_ptr); - zend_error(E_STRICT, "Implicit cloning object of class '%v' because of 'zend.ze1_compatibility_mode'", class_name.v); - if(!dup) { - efree(class_name.v); - } - Z_OBJVAL_P(value_ptr) = Z_OBJ_HANDLER_PP(value, clone_obj)(*value TSRMLS_CC); - zval_ptr_dtor(value); - *value = value_ptr; - } *(argument_array++) = value; arg_count--; } http://cvs.php.net/viewcvs.cgi/ZendEngine2/zend_execute.c?r1=1.738&r2=1.739&diff_format=u Index: ZendEngine2/zend_execute.c diff -u ZendEngine2/zend_execute.c:1.738 ZendEngine2/zend_execute.c:1.739 --- ZendEngine2/zend_execute.c:1.738Sun Feb 26 11:57:14 2006 +++ ZendEngine2/zend_execute.c Thu Mar 16 10:33:23 2006 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: zend_execute.c,v 1.738 2006/02/26 11:57:14 dmitry Exp $ */ +/* $Id: zend_execute.c,v 1.739 2006/03/16 10:33:23 dmitry Exp $ */ #define ZEND_INTENSIVE_DEBUGGING 0 @@ -598,26 +598,7 @@ /* here we are sure we are dealing with an object */ /* separate our value if necessary */ - if (EG(ze1_compatibility_mode) && Z_TYPE_P(value) == IS_OBJECT) { - zval *orig_value = value; - zstr class_name; -
[PHP-CVS] cvs: php-src / NEWS /ext/standard/tests/array bug33940.phpt /main main.c php_globals.h ZendEngine2 zend.c zend_compile.c zend_globals.h
dmitry Thu Mar 16 11:32:00 2006 UTC Modified files: /php-srcNEWS /ZendEngine2zend.c zend_compile.c zend_globals.h /php-src/ext/standard/tests/array bug33940.phpt /php-src/main main.c php_globals.h Log: Dropped allow_call_time_pass_reference, the error is maden E_STRICT. http://cvs.php.net/viewcvs.cgi/php-src/NEWS?r1=1.2102&r2=1.2103&diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2102 php-src/NEWS:1.2103 --- php-src/NEWS:1.2102 Thu Mar 16 10:33:22 2006 +++ php-src/NEWSThu Mar 16 11:32:00 2006 @@ -4,6 +4,7 @@ - Unicode support. (Andrei, Dmitry, et al) - Dropped safe_mode support (Ilia, Andi) - Dropped zend.ze1_compatibility_mode (Dmitry) +- Dropped allow_call_time_pass_reference, the error is maden E_STRICT. (Dmitry) - Dropped register_long_arrays (Dmitry) - Droped register_globals support (Pierre) - session_register, session_unregister and session_is_registered removed they http://cvs.php.net/viewcvs.cgi/ZendEngine2/zend.c?r1=1.342&r2=1.343&diff_format=u Index: ZendEngine2/zend.c diff -u ZendEngine2/zend.c:1.342 ZendEngine2/zend.c:1.343 --- ZendEngine2/zend.c:1.342Thu Mar 16 10:33:23 2006 +++ ZendEngine2/zend.c Thu Mar 16 11:32:00 2006 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: zend.c,v 1.342 2006/03/16 10:33:23 dmitry Exp $ */ +/* $Id: zend.c,v 1.343 2006/03/16 11:32:00 dmitry Exp $ */ #include "zend.h" #include "zend_extensions.h" @@ -673,7 +673,6 @@ /* default compile-time values */ CG(asp_tags) = 0; CG(short_tags) = 1; - CG(allow_call_time_pass_reference) = 1; CG(extended_info) = 0; } http://cvs.php.net/viewcvs.cgi/ZendEngine2/zend_compile.c?r1=1.695&r2=1.696&diff_format=u Index: ZendEngine2/zend_compile.c diff -u ZendEngine2/zend_compile.c:1.695 ZendEngine2/zend_compile.c:1.696 --- ZendEngine2/zend_compile.c:1.695Wed Mar 15 09:04:48 2006 +++ ZendEngine2/zend_compile.c Thu Mar 16 11:32:00 2006 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: zend_compile.c,v 1.695 2006/03/15 09:04:48 dmitry Exp $ */ +/* $Id: zend_compile.c,v 1.696 2006/03/16 11:32:00 dmitry Exp $ */ #include #include "zend.h" @@ -1642,19 +1642,22 @@ zend_stack_top(&CG(function_call_stack), (void **) &function_ptr_ptr); function_ptr = *function_ptr_ptr; - if (original_op==ZEND_SEND_REF - && !CG(allow_call_time_pass_reference)) { - zend_error(E_COMPILE_WARNING, - "Call-time pass-by-reference has been deprecated - argument passed by value; " - "If you would like to pass it by reference, modify the declaration of %R(). " - "If you would like to enable call-time pass-by-reference, you can set " - "allow_call_time_pass_reference to true in your INI file. " - "However, future versions may not support this any longer. ", - (function_ptr && UG(unicode))?IS_UNICODE:IS_STRING, - (function_ptr?function_ptr->common.function_name.s:"[runtime function name]")); - } - - if (function_ptr) { + if (original_op==ZEND_SEND_REF) { + if (function_ptr && + function_ptr->common.function_name.v && + function_ptr->common.type == ZEND_USER_FUNCTION && + !ARG_SHOULD_BE_SENT_BY_REF(function_ptr, (zend_uint) offset)) { + zend_error(E_STRICT, + "Call-time pass-by-reference has been deprecated; " + "if you would like to pass argument by reference, modify the declaration of %R().", + UG(unicode)?IS_UNICODE:IS_STRING, + function_ptr->common.function_name.v); + } else{ + zend_error(E_STRICT, + "Call-time pass-by-reference has been deprecated"); + } + send_by_reference = 1; + } else if (function_ptr) { if (ARG_MAY_BE_SENT_BY_REF(function_ptr, (zend_uint) offset)) { op = (param->op_type & (IS_VAR|IS_CV))?ZEND_SEND_REF:ZEND_SEND_VAL; send_by_reference = 0; http://cvs.php.net/viewcvs.cgi/ZendEngine2/zend_globals.h?r1=1.150&r2=1.151&diff_format=u Index: ZendEngine2/zend_globals.h diff -u ZendEngine2/zend_globals.h:1.150 ZendEngine2/zend_globals.h:1.151 --- ZendEngine2/zend_globals.h:1.150Thu Mar 16 10:33:23 2006 +++ ZendEngine2/zend_globals.h Thu Mar 16 11:32:00 2006 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: z
[PHP-CVS] cvs: php-src / NEWS
tony2001Thu Mar 16 11:35:30 2006 UTC Modified files: /php-srcNEWS Log: rephrase http://cvs.php.net/viewcvs.cgi/php-src/NEWS?r1=1.2103&r2=1.2104&diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2103 php-src/NEWS:1.2104 --- php-src/NEWS:1.2103 Thu Mar 16 11:32:00 2006 +++ php-src/NEWSThu Mar 16 11:35:30 2006 @@ -4,7 +4,7 @@ - Unicode support. (Andrei, Dmitry, et al) - Dropped safe_mode support (Ilia, Andi) - Dropped zend.ze1_compatibility_mode (Dmitry) -- Dropped allow_call_time_pass_reference, the error is maden E_STRICT. (Dmitry) +- Dropped allow_call_time_pass_reference, added E_STRICT error message. (Dmitry) - Dropped register_long_arrays (Dmitry) - Droped register_globals support (Pierre) - session_register, session_unregister and session_is_registered removed they -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/pgsql pgsql.c php_pgsql.h
edink Thu Mar 16 14:58:56 2006 UTC Modified files: /php-src/ext/pgsql pgsql.c php_pgsql.h Log: Added pg_field_table() as per req: #36750 http://cvs.php.net/viewcvs.cgi/php-src/ext/pgsql/pgsql.c?r1=1.344&r2=1.345&diff_format=u Index: php-src/ext/pgsql/pgsql.c diff -u php-src/ext/pgsql/pgsql.c:1.344 php-src/ext/pgsql/pgsql.c:1.345 --- php-src/ext/pgsql/pgsql.c:1.344 Wed Mar 8 00:43:28 2006 +++ php-src/ext/pgsql/pgsql.c Thu Mar 16 14:58:56 2006 @@ -20,7 +20,7 @@ +--+ */ -/* $Id: pgsql.c,v 1.344 2006/03/08 00:43:28 pajoye Exp $ */ +/* $Id: pgsql.c,v 1.345 2006/03/16 14:58:56 edink Exp $ */ #include @@ -151,6 +151,7 @@ PHP_FE(pg_field_type_oid, NULL) PHP_FE(pg_field_prtlen, NULL) PHP_FE(pg_field_is_null,NULL) + PHP_FE(pg_field_table, NULL) /* async message function */ PHP_FE(pg_get_notify, NULL) PHP_FE(pg_get_pid, NULL) @@ -1694,6 +1695,95 @@ } /* }}} */ +/* {{{ proto mixed pg_field_table(resource result, int field_number[, bool oid_only]) + Returns the name of the table field belongs to, or table's oid if oid_only is true */ +PHP_FUNCTION(pg_field_table) +{ + zval *result; + pgsql_result_handle *pg_result; + long fnum = -1; + zend_bool return_oid = 0; + Oid oid; + smart_str hash_key = {0}; + char *table_name; + zend_rsrc_list_entry *field_table; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl|b!", &result, &fnum, &return_oid) == FAILURE) { + return; + } + + ZEND_FETCH_RESOURCE(pg_result, pgsql_result_handle *, &result, -1, "PostgreSQL result", le_result); + + if (fnum < 0 || fnum >= PQnfields(pg_result->result)) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad field offset specified"); + RETURN_FALSE; + } + + oid = PQftable(pg_result->result, fnum); + + if (InvalidOid == oid) { + RETURN_FALSE; + } + + + if (return_oid) { + if (oid > LONG_MAX) { + smart_str oidstr = {0}; + smart_str_append_unsigned(&oidstr, oid); + smart_str_0(&oidstr); + RETURN_STRINGL(oidstr.c, oidstr.len, 0); + } else { + RETURN_LONG((long)oid); + } + } + + /* try to lookup the table name in the resource list */ + smart_str_appends(&hash_key, "pgsql_table_oid_"); + smart_str_append_unsigned(&hash_key, oid); + smart_str_0(&hash_key); + + if (zend_hash_find(&EG(regular_list), hash_key.c, hash_key.len+1, (void **) &field_table) == SUCCESS) { + smart_str_free(&hash_key); + RETURN_STRING((char *)field_table->ptr, 1); + } else { /* Not found, lookup by querying PostgreSQL system tables */ + PGresult *tmp_res; + smart_str querystr = {0}; + zend_rsrc_list_entry new_field_table; + + smart_str_appends(&querystr, "select relname from pg_class where oid="); + smart_str_append_unsigned(&querystr, oid); + smart_str_0(&querystr); + + + if ((tmp_res = PQexec(pg_result->conn, querystr.c)) == NULL || PQresultStatus(tmp_res) != PGRES_TUPLES_OK) { + if (tmp_res) { + PQclear(tmp_res); + } + smart_str_free(&querystr); + smart_str_free(&hash_key); + RETURN_FALSE; + } + + smart_str_free(&querystr); + + if ((table_name = PQgetvalue(tmp_res, 0, 0)) == NULL) { + PQclear(tmp_res); + smart_str_free(&hash_key); + RETURN_FALSE; + } + + Z_TYPE(new_field_table) = le_string; + new_field_table.ptr = estrdup(table_name); + zend_hash_update(&EG(regular_list), hash_key.c, hash_key.len+1, (void *) &new_field_table, sizeof(zend_rsrc_list_entry), NULL); + + smart_str_free(&hash_key); + PQclear(tmp_res); + RETURN_STRING(table_name, 1); + } + +} +/* }}} */ + #define PHP_PG_FIELD_NAME 1 #define PHP_PG_FIELD_SIZE 2 #define PHP_PG_FIELD_TYPE 3 http://cvs.php.net/viewcvs.cgi/php-src/ext/pgsql/php_pgsql.h?r1=1.74&r2=1.75&diff_format=u Index: php-src/ext/pgsql/php_pgsql.h diff -u php-src/ext/pgsql/php_pgsql.h:1.74 php-src/ext/pgsql/php_pgsql.h:1.75 --- php-src/ext/pgsql/php_pgsql.h:1.74 Sun Jan 1 13:09:53 2006 +++ php-src/ext/pgsql/php_pgsql.h Thu Mar 16 14:58:56 2006 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: php_pgsql.h,v 1.74 2006/
[PHP-CVS] cvs: php-src /ext/mbstring mbstring.c
masugataThu Mar 16 15:21:12 2006 UTC Modified files: /php-src/ext/mbstring mbstring.c Log: added option parameter mb_list_encodings( ). http://cvs.php.net/viewcvs.cgi/php-src/ext/mbstring/mbstring.c?r1=1.243&r2=1.244&diff_format=u Index: php-src/ext/mbstring/mbstring.c diff -u php-src/ext/mbstring/mbstring.c:1.243 php-src/ext/mbstring/mbstring.c:1.244 --- php-src/ext/mbstring/mbstring.c:1.243 Sun Mar 12 07:54:03 2006 +++ php-src/ext/mbstring/mbstring.c Thu Mar 16 15:21:12 2006 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: mbstring.c,v 1.243 2006/03/12 07:54:03 hirokawa Exp $ */ +/* $Id: mbstring.c,v 1.244 2006/03/16 15:21:12 masugata Exp $ */ /* * PHP 4 Multibyte String module "mbstring" @@ -2314,19 +2314,41 @@ } /* }}} */ -/* {{{ proto array mb_list_encodings() - Returns an array of all supported encodings */ +/* {{{ proto mixed mb_list_encodings([string alias_encoding]) + Returns an array of all supported entity encodings or Returns the entity encoding as a string */ PHP_FUNCTION(mb_list_encodings) { const mbfl_encoding **encodings; const mbfl_encoding *encoding; + enum mbfl_no_encoding no_encoding; int i; + char *name = NULL; + int name_len; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &name, &name_len) == FAILURE) { + RETURN_FALSE; + } - array_init(return_value); - i = 0; - encodings = mbfl_get_supported_encodings(); - while ((encoding = encodings[i++]) != NULL) { - add_next_index_string(return_value, (char *) encoding->name, 1); + if (name == NULL) { + array_init(return_value); + i = 0; + encodings = mbfl_get_supported_encodings(); + while ((encoding = encodings[i++]) != NULL) { + add_next_index_string(return_value, (char *) encoding->name, 1); + } + } else { + no_encoding = mbfl_name2no_encoding(name); + if (no_encoding == mbfl_no_encoding_invalid) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown encoding \"%s\"", name); + RETURN_FALSE; + } + + name = (char *)mbfl_no_encoding2name(no_encoding); + if (name != NULL) { + RETURN_STRING(name, 1); + } else { + RETURN_FALSE; + } } } /* }}} */ -- 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 dl.c dl.h /main main.c php_globals.h php_main.h /sapi/cgi cgi_main.c /sapi/cli php_cli.c /sapi/embed php_embed.c
dmitry Thu Mar 16 16:53:10 2006 UTC Modified files: /php-srcNEWS /php-src/ext/standard basic_functions.c dl.c dl.h /php-src/main main.c php_globals.h php_main.h /php-src/sapi/cgi cgi_main.c /php-src/sapi/cli php_cli.c /php-src/sapi/embed php_embed.c Log: Disabled dl(). Now it is enabled only when a SAPI layer registers it explicitly. Only CLI, CGI and EMBED do this. http://cvs.php.net/viewcvs.cgi/php-src/NEWS?r1=1.2106&r2=1.2107&diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2106 php-src/NEWS:1.2107 --- php-src/NEWS:1.2106 Thu Mar 16 15:35:26 2006 +++ php-src/NEWSThu Mar 16 16:53:09 2006 @@ -2,6 +2,8 @@ ||| ?? ??? , PHP 6.0 - Unicode support. (Andrei, Dmitry, et al) +- Disabled dl(). Now it is enabled only when a SAPI layer registers it + explicitly. Only CLI, CGI and EMBED do this. (Dmitry). - Return "new" by reference now throws an E_STRICT error. (Dmitry) - Added E_STRICT to E_ALL. (Dmitry) - Dropped safe_mode support (Ilia, Andi) http://cvs.php.net/viewcvs.cgi/php-src/ext/standard/basic_functions.c?r1=1.761&r2=1.762&diff_format=u Index: php-src/ext/standard/basic_functions.c diff -u php-src/ext/standard/basic_functions.c:1.761 php-src/ext/standard/basic_functions.c:1.762 --- php-src/ext/standard/basic_functions.c:1.761Wed Mar 8 14:41:45 2006 +++ php-src/ext/standard/basic_functions.c Thu Mar 16 16:53:09 2006 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: basic_functions.c,v 1.761 2006/03/08 14:41:45 iliaa Exp $ */ +/* $Id: basic_functions.c,v 1.762 2006/03/16 16:53:09 dmitry Exp $ */ #include "php.h" #include "php_streams.h" @@ -548,9 +548,6 @@ PHP_FALIAS(join,implode, NULL) PHP_FE(sql_regcase, NULL) - /* functions from dl.c */ - PHP_FE(dl, NULL) - /* functions from file.c */ PHP_FE(pclose, NULL) PHP_FE(popen, NULL) http://cvs.php.net/viewcvs.cgi/php-src/ext/standard/dl.c?r1=1.108&r2=1.109&diff_format=u Index: php-src/ext/standard/dl.c diff -u php-src/ext/standard/dl.c:1.108 php-src/ext/standard/dl.c:1.109 --- php-src/ext/standard/dl.c:1.108 Sun Feb 19 18:19:33 2006 +++ php-src/ext/standard/dl.c Thu Mar 16 16:53:09 2006 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: dl.c,v 1.108 2006/02/19 18:19:33 iliaa Exp $ */ +/* $Id: dl.c,v 1.109 2006/03/16 16:53:09 dmitry Exp $ */ #include "php.h" #include "dl.h" @@ -65,22 +65,6 @@ convert_to_string_ex(file); - if (!PG(enable_dl)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Dynamically loaded extensions aren't enabled"); - RETURN_FALSE; - } - - if ((strncmp(sapi_module.name, "cgi", 3)!=0) && - (strcmp(sapi_module.name, "cli")!=0) && - (strncmp(sapi_module.name, "embed", 5)!=0)) { -#ifdef ZTS - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Not supported in multithreaded Web servers - use extension=%s in your php.ini", Z_STRVAL_PP(file)); - RETURN_FALSE; -#else - php_error_docref(NULL TSRMLS_CC, E_STRICT, "dl() is deprecated - use extension=%s in your php.ini", Z_STRVAL_PP(file)); -#endif - } - php_dl(*file, MODULE_TEMPORARY, return_value, 0 TSRMLS_CC); EG(full_tables_cleanup) = 1; } http://cvs.php.net/viewcvs.cgi/php-src/ext/standard/dl.h?r1=1.24&r2=1.25&diff_format=u Index: php-src/ext/standard/dl.h diff -u php-src/ext/standard/dl.h:1.24 php-src/ext/standard/dl.h:1.25 --- php-src/ext/standard/dl.h:1.24 Sun Jan 1 13:09:55 2006 +++ php-src/ext/standard/dl.h Thu Mar 16 16:53:09 2006 @@ -18,15 +18,15 @@ +--+ */ -/* $Id: dl.h,v 1.24 2006/01/01 13:09:55 sniper Exp $ */ +/* $Id: dl.h,v 1.25 2006/03/16 16:53:09 dmitry Exp $ */ #ifndef DL_H #define DL_H -PHPAPI void php_dl(zval *file,int type, zval *return_value, int start_now TSRMLS_DC); +void php_dl(zval *file,int type, zval *return_value, int start_now TSRMLS_DC); /* dynamic loading functions */ -PHP_FUNCTION(dl); +PHPAPI PHP_FUNCTION(dl); PHP_MINFO_FUNCTION(dl); http://cvs.php.net/viewcvs.cgi/php-src/main/main.c?r1=1.677&r
[PHP-CVS] cvs: CVSROOT / avail
pajoye Thu Mar 16 17:28:43 2006 UTC Modified files: /CVSROOTavail Log: - Services_Hatena karma for makoto http://cvs.php.net/viewcvs.cgi/CVSROOT/avail?r1=1.1108&r2=1.1109&diff_format=u Index: CVSROOT/avail diff -u CVSROOT/avail:1.1108 CVSROOT/avail:1.1109 --- CVSROOT/avail:1.1108Mon Mar 13 08:13:20 2006 +++ CVSROOT/avail Thu Mar 16 17:28:43 2006 @@ -326,6 +326,7 @@ avail|nabeel|pecl/axis2 avail|fela|pear/Image_Puzzle,peardoc avail|migurski|pear/Services_JSON +avail|makoto|pear/Services_Hatena # Curl modules avail|bagder,sterling,crisb,linus_nielsen|curl,curl-cpp,curl-java,curl-perl,curl-php,curl-www -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_1) /ext/pdo_mysql mysql_driver.c
iliaa Fri Mar 17 00:15:09 2006 UTC Modified files: (Branch: PHP_5_1) /php-src/ext/pdo_mysql mysql_driver.c Log: Allow PDO_MYSQL_ATTR_DIRECT_QUERY to be set via constructor Allow getAttribute() to fetch MySQL specific attributes. Eliminate unnecessary auto-commit call on connect. http://cvs.php.net/viewcvs.cgi/php-src/ext/pdo_mysql/mysql_driver.c?r1=1.59.2.10&r2=1.59.2.11&diff_format=u Index: php-src/ext/pdo_mysql/mysql_driver.c diff -u php-src/ext/pdo_mysql/mysql_driver.c:1.59.2.10 php-src/ext/pdo_mysql/mysql_driver.c:1.59.2.11 --- php-src/ext/pdo_mysql/mysql_driver.c:1.59.2.10 Sun Mar 5 17:18:01 2006 +++ php-src/ext/pdo_mysql/mysql_driver.cFri Mar 17 00:15:09 2006 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: mysql_driver.c,v 1.59.2.10 2006/03/05 17:18:01 iliaa Exp $ */ +/* $Id: mysql_driver.c,v 1.59.2.11 2006/03/17 00:15:09 iliaa Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -362,6 +362,14 @@ ZVAL_LONG(return_value, H->buffered); return 1; + case PDO_MYSQL_ATTR_DIRECT_QUERY: + ZVAL_LONG(return_value, H->emulate_prepare); + return 1; + + case PDO_MYSQL_ATTR_MAX_BUFFER_SIZE: + ZVAL_LONG(return_value, H->max_buffer_size); + return 1; + default: return 0; } @@ -440,7 +448,7 @@ char *init_cmd = NULL, *default_file = NULL, *default_group = NULL; H->buffered = pdo_attr_lval(driver_options, PDO_MYSQL_ATTR_USE_BUFFERED_QUERY, 0 TSRMLS_CC); - + H->emulate_prepare = pdo_attr_lval(driver_options, PDO_MYSQL_ATTR_DIRECT_QUERY, 0 TSRMLS_CC); H->max_buffer_size = pdo_attr_lval(driver_options, PDO_MYSQL_ATTR_MAX_BUFFER_SIZE, 1024 * 1024 TSRMLS_CC); if (mysql_options(H->server, MYSQL_OPT_CONNECT_TIMEOUT, (const char *)&connect_timeout)) { @@ -497,7 +505,9 @@ goto cleanup; } - mysql_handle_autocommit(dbh TSRMLS_CC); + if (!dbh->auto_commit) { + mysql_handle_autocommit(dbh TSRMLS_CC); + } H->attached = 1; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/pdo_mysql mysql_driver.c
iliaa Fri Mar 17 00:15:28 2006 UTC Modified files: /php-src/ext/pdo_mysql mysql_driver.c Log: MFB51: Allow PDO_MYSQL_ATTR_DIRECT_QUERY to be set via constructor Allow getAttribute() to fetch MySQL specific attributes. Eliminate unnecessary auto-commit call on connect. http://cvs.php.net/viewcvs.cgi/php-src/ext/pdo_mysql/mysql_driver.c?r1=1.71&r2=1.72&diff_format=u Index: php-src/ext/pdo_mysql/mysql_driver.c diff -u php-src/ext/pdo_mysql/mysql_driver.c:1.71 php-src/ext/pdo_mysql/mysql_driver.c:1.72 --- php-src/ext/pdo_mysql/mysql_driver.c:1.71 Sun Mar 5 17:17:04 2006 +++ php-src/ext/pdo_mysql/mysql_driver.cFri Mar 17 00:15:28 2006 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: mysql_driver.c,v 1.71 2006/03/05 17:17:04 iliaa Exp $ */ +/* $Id: mysql_driver.c,v 1.72 2006/03/17 00:15:28 iliaa Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -353,6 +353,14 @@ ZVAL_LONG(return_value, H->buffered); return 1; + case PDO_MYSQL_ATTR_DIRECT_QUERY: + ZVAL_LONG(return_value, H->emulate_prepare); + return 1; + + case PDO_MYSQL_ATTR_MAX_BUFFER_SIZE: + ZVAL_LONG(return_value, H->max_buffer_size); + return 1; + default: return 0; } @@ -431,7 +439,7 @@ char *init_cmd = NULL, *default_file = NULL, *default_group = NULL; H->buffered = pdo_attr_lval(driver_options, PDO_MYSQL_ATTR_USE_BUFFERED_QUERY, 0 TSRMLS_CC); - + H->emulate_prepare = pdo_attr_lval(driver_options, PDO_MYSQL_ATTR_DIRECT_QUERY, 0 TSRMLS_CC); H->max_buffer_size = pdo_attr_lval(driver_options, PDO_MYSQL_ATTR_MAX_BUFFER_SIZE, 1024 * 1024 TSRMLS_CC); if (mysql_options(H->server, MYSQL_OPT_CONNECT_TIMEOUT, (const char *)&connect_timeout)) { @@ -488,7 +496,9 @@ goto cleanup; } - mysql_handle_autocommit(dbh TSRMLS_CC); + if (!dbh->auto_commit) { + mysql_handle_autocommit(dbh TSRMLS_CC); + } H->attached = 1; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php-src /ext/pgsql pgsql.c php_pgsql.h
Documentation? Edin Kadribasic wrote: edink Thu Mar 16 14:58:56 2006 UTC Modified files: /php-src/ext/pgsql pgsql.c php_pgsql.h Log: Added pg_field_table() as per req: #36750 http://cvs.php.net/viewcvs.cgi/php-src/ext/pgsql/pgsql.c?r1=1.344&r2=1.345&diff_format=u Index: php-src/ext/pgsql/pgsql.c diff -u php-src/ext/pgsql/pgsql.c:1.344 php-src/ext/pgsql/pgsql.c:1.345 --- php-src/ext/pgsql/pgsql.c:1.344 Wed Mar 8 00:43:28 2006 +++ php-src/ext/pgsql/pgsql.c Thu Mar 16 14:58:56 2006 @@ -20,7 +20,7 @@ +--+ */ -/* $Id: pgsql.c,v 1.344 2006/03/08 00:43:28 pajoye Exp $ */ +/* $Id: pgsql.c,v 1.345 2006/03/16 14:58:56 edink Exp $ */ #include @@ -151,6 +151,7 @@ PHP_FE(pg_field_type_oid, NULL) PHP_FE(pg_field_prtlen, NULL) PHP_FE(pg_field_is_null,NULL) + PHP_FE(pg_field_table, NULL) /* async message function */ PHP_FE(pg_get_notify, NULL) PHP_FE(pg_get_pid, NULL) @@ -1694,6 +1695,95 @@ } /* }}} */ +/* {{{ proto mixed pg_field_table(resource result, int field_number[, bool oid_only]) + Returns the name of the table field belongs to, or table's oid if oid_only is true */ +PHP_FUNCTION(pg_field_table) +{ + zval *result; + pgsql_result_handle *pg_result; + long fnum = -1; + zend_bool return_oid = 0; + Oid oid; + smart_str hash_key = {0}; + char *table_name; + zend_rsrc_list_entry *field_table; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl|b!", &result, &fnum, &return_oid) == FAILURE) { + return; + } + + ZEND_FETCH_RESOURCE(pg_result, pgsql_result_handle *, &result, -1, "PostgreSQL result", le_result); + + if (fnum < 0 || fnum >= PQnfields(pg_result->result)) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad field offset specified"); + RETURN_FALSE; + } + + oid = PQftable(pg_result->result, fnum); + + if (InvalidOid == oid) { + RETURN_FALSE; + } + + + if (return_oid) { + if (oid > LONG_MAX) { + smart_str oidstr = {0}; + smart_str_append_unsigned(&oidstr, oid); + smart_str_0(&oidstr); + RETURN_STRINGL(oidstr.c, oidstr.len, 0); + } else { + RETURN_LONG((long)oid); + } + } + + /* try to lookup the table name in the resource list */ + smart_str_appends(&hash_key, "pgsql_table_oid_"); + smart_str_append_unsigned(&hash_key, oid); + smart_str_0(&hash_key); + + if (zend_hash_find(&EG(regular_list), hash_key.c, hash_key.len+1, (void **) &field_table) == SUCCESS) { + smart_str_free(&hash_key); + RETURN_STRING((char *)field_table->ptr, 1); + } else { /* Not found, lookup by querying PostgreSQL system tables */ + PGresult *tmp_res; + smart_str querystr = {0}; + zend_rsrc_list_entry new_field_table; + + smart_str_appends(&querystr, "select relname from pg_class where oid="); + smart_str_append_unsigned(&querystr, oid); + smart_str_0(&querystr); + + + if ((tmp_res = PQexec(pg_result->conn, querystr.c)) == NULL || PQresultStatus(tmp_res) != PGRES_TUPLES_OK) { + if (tmp_res) { + PQclear(tmp_res); + } + smart_str_free(&querystr); + smart_str_free(&hash_key); + RETURN_FALSE; + } + + smart_str_free(&querystr); + + if ((table_name = PQgetvalue(tmp_res, 0, 0)) == NULL) { + PQclear(tmp_res); + smart_str_free(&hash_key); + RETURN_FALSE; + } + + Z_TYPE(new_field_table) = le_string; + new_field_table.ptr = estrdup(table_name); + zend_hash_update(&EG(regular_list), hash_key.c, hash_key.len+1, (void *) &new_field_table, sizeof(zend_rsrc_list_entry), NULL); + + smart_str_free(&hash_key); + PQclear(tmp_res); + RETURN_STRING(table_name, 1); + } + +} +/* }}} */ + #define PHP_PG_FIELD_NAME 1 #define PHP_PG_FIELD_SIZE 2 #define PHP_PG_FIELD_TYPE 3 http://cvs.php.net/viewcvs.cgi/php-src/ext/pgsql/php_pgsql.h?r1=1.74&r2=1.75&diff_format=u Index: php-src/ext/pgsql/php_pgsql.h diff -u php-src/ext/pgsql/php_pgsql.h:1.74 php-src/ext/pgsql/php_pgsql.h:1.75 --- php-src/ext/pgsql/php_pgsql.h:1.74 Sun Jan 1 13:09:53 2006 +++ php-src/ext/pgsql/php_pgsql.h Thu Mar 16 14:58:56 2006 @@ -17,7 +17,7 @@ +-
Re: [PHP-CVS] cvs: php-src /ext/pgsql pgsql.c php_pgsql.h
Christopher Kings-Lynne wrote: Documentation? What's that? ;-) Ilia -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php