diff options
252 files changed, 5989 insertions, 1313 deletions
diff --git a/.travis.yml b/.travis.yml index 2125e8d3d..f0a6f257d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -42,5 +42,5 @@ before_script: # Run PHPs run-tests.php script: - - ./sapi/cli/php run-tests.php -p `pwd`/sapi/cli/php -g "FAIL,XFAIL,BORK,WARN,LEAK,SKIP" --show-diff --set-timeout 120 + - ./sapi/cli/php run-tests.php -p `pwd`/sapi/cli/php -g "FAIL,XFAIL,BORK,WARN,LEAK,SKIP" --show-diff --set-timeout 120 -s - ./sapi/cli/php sapi/phpdbg/tests/run-tests.php -diff2stdout --phpdbg sapi/phpdbg/phpdbg diff --git a/CODING_STANDARDS b/CODING_STANDARDS index 27fff07f6..2664d12bd 100644 --- a/CODING_STANDARDS +++ b/CODING_STANDARDS @@ -42,7 +42,7 @@ Exceptions: 4. When writing functions that deal with strings, be sure to remember that PHP holds the length property of each string, and that it - shouldn't be calculated with strlen(). Write your functions in a such + shouldn't be calculated with strlen(). Write your functions in such a way so that they'll take advantage of the length property, both for efficiency and in order for them to be binary-safe. Functions that change strings and obtain their new lengths while @@ -155,7 +155,7 @@ Table of Contents a list of all available options along with short explanations running ./configure --help. Our manual documents the different options separately. You will find the core options in the appendix, while the - different extension specific options are descibed on the reference + different extension specific options are described on the reference pages. When PHP is configured, you are ready to build the module and/or @@ -1,5 +1,70 @@ PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| +18 Dec 2014, PHP 5.6.4 + +- Core: + . Fixed bug #68091 (Some Zend headers lack appropriate extern "C" blocks). + (Adam) + . Fixed bug #68104 (Segfault while pre-evaluating a disabled function). + (Laruence) + . Fixed bug #68185 ("Inconsistent insteadof definition."- incorrectly + triggered). (Julien) + . Fixed bug #68355 (Inconsistency in example php.ini comments). + (Chris McCafferty) + . Fixed bug #68370 ("unset($this)" can make the program crash). (Laruence) + . Fixed bug #68422 (Incorrect argument reflection info for array_multisort()). + (Alexander Lisachenko) + . Fixed bug #68545 (NULL pointer dereference in unserialize.c). (Anatol) + . Fixed bug #68446 (Array constant not accepted for array parameter default). + (Bob, Dmitry) + . Fixed bug #68594 (Use after free vulnerability in unserialize()). + (CVE-2014-8142) (Stefan Esser) + +- Date: + . Fixed day_of_week function as it could sometimes return negative values + internally. (Derick) + +- FPM: + . Fixed bug #68381 (fpm_unix_init_main ignores log_level). + (David Zuelke, Remi) + . Fixed bug #68420 (listen=9000 listens to ipv6 localhost instead of all + addresses). (Remi) + . Fixed bug #68421 (access.format='%R' doesn't log ipv6 address). (Remi) + . Fixed bug #68423 (PHP-FPM will no longer load all pools). (Remi) + . Fixed bug #68428 (listen.allowed_clients is IPv4 only). (Remi) + . Fixed bug #68452 (php-fpm man page is oudated). (Remi) + . Fixed request #68458 (Change pm.start_servers default warning to + notice). (David Zuelke, Remi) + . Fixed bug #68463 (listen.allowed_clients can silently result + in no allowed access). (Remi) + . Fixed request #68391 (php-fpm conf files loading order). + (Florian Margaine, Remi) + . Fixed bug #68478 (access.log don't use prefix). (Remi) + +- Mcrypt: + . Fixed possible read after end of buffer and use after free. (Dmitry) + +- GMP: + . Fixed bug #68419 (build error with gmp 4.1). (Remi) + +- PDO_pgsql: + . Fixed bug #67462 (PDO_PGSQL::beginTransaction() wrongly throws exception + when not in transaction) (Matteo) + . Fixed bug #68351 (PDO::PARAM_BOOL and ATTR_EMULATE_PREPARES misbehaving) + (Matteo) + +- Session: + . Fixed bug #68331 (Session custom storage callable functions not being called) + (Yasuo Ohgaki) + +- SOAP: + . Fixed bug #68361 (Segmentation fault on SoapClient::__getTypes). + (Laruence) + +- zlib: + . Fixed bug #53829 (Compiling PHP with large file support will replace + function gzopen by gzopen64) (Sascha Kettler, Matteo) + 13 Nov 2014, PHP 5.6.3 - Core: @@ -400,6 +465,7 @@ PHP NEWS . Fixed issue with null bytes in LDAP bindings. (Matthew Daley) - litespeed + . Updated LiteSpeed SAPI code to V6.6 (George Wang) . Fixed bug #63228 (-Werror=format-security error in lsapi code). (Elan Ruusamäe, George) diff --git a/README.TESTING2 b/README.TESTING2 index 3c4f1beb2..34f7e8332 100644 --- a/README.TESTING2 +++ b/README.TESTING2 @@ -8,7 +8,7 @@ the original run-tests.php script. server-tests is *not* used by 'make test'. server-tests was developed to provide support for testing PHP under it's primary environment, HTTP, and can run the PHP tests under any of the SAPI modules that are direct executables, -or are accessable via HTTP. +or are accessible via HTTP. [New features] ---------------- @@ -95,7 +95,7 @@ include: $filename full native path to file, will become PATH_TRANSLATED $filepath =dirname($filename) $scriptname this is what will become SCRIPT_NAME unless you override it - $docroot the equivelant of DOCUMENT_ROOT under Apache + $docroot the equivalent of DOCUMENT_ROOT under Apache $cwd the directory that the test is being initiated from $this->conf all server-tests configuration vars $this->env all environment variables that will get passed to the test @@ -105,7 +105,7 @@ include: This section is also eval'd, and is similar in nature to --ENV--. However, this section is used to build the url used in an HTTP request. Valid values to set in this section would include: - SCRIPT_NAME The inital part of the request url + SCRIPT_NAME The initial part of the request url PATH_INFO The pathinfo part of a request url FRAGMENT The fragment section of a url (after #) QUERY_STRING The query part of a url (after ?) diff --git a/Zend/tests/bug67436/bug67436_nohandler.phpt b/Zend/tests/bug67436/bug67436_nohandler.phpt index 464f71153..f1760c646 100644 --- a/Zend/tests/bug67436/bug67436_nohandler.phpt +++ b/Zend/tests/bug67436/bug67436_nohandler.phpt @@ -19,6 +19,6 @@ $b = new b(); $b->test(); --EXPECTF-- -Strict Standards: Declaration of b::test() should be compatible with a::test($arg = c::TESTCONSTANT) in %s/bug67436/b.php on line %d +Strict Standards: Declaration of b::test() should be compatible with a::test($arg = c::TESTCONSTANT) in %s%ebug67436%eb.php on line %d b::test() a::test(c::TESTCONSTANT) diff --git a/Zend/tests/bug68370.phpt b/Zend/tests/bug68370.phpt new file mode 100644 index 000000000..25589bf45 --- /dev/null +++ b/Zend/tests/bug68370.phpt @@ -0,0 +1,18 @@ +--TEST-- +Bug #68370 "unset($this)" can make the program crash +--FILE-- +<?php +class C { + public function test() { + unset($this); + return get_defined_vars(); + } +} +$c = new C(); +$x = $c->test(); +print_r($x); +unset($c, $x); +--EXPECTF-- +Array +( +) diff --git a/Zend/tests/bug68446.phpt b/Zend/tests/bug68446.phpt new file mode 100644 index 000000000..48e6f52f1 --- /dev/null +++ b/Zend/tests/bug68446.phpt @@ -0,0 +1,36 @@ +--TEST-- +Bug #68446 (Array constant not accepted for array parameter default) +--FILE-- +<?php +const FOO = [1]; +const BAR = null; + +function a(array $a = FOO) { + var_dump($a); +} + +function b(array $b = BAR) { + var_dump($b); +} + +b(null); +b([]); +b(); +a([]); +a(); +a(null); +?> +--EXPECTF-- +NULL +array(0) { +} +NULL +array(0) { +} +array(1) { + [0]=> + int(1) +} + +Catchable fatal error: Argument 1 passed to a() must be of the type array, null given, called in %s on line %d and defined in %s on line %d + diff --git a/Zend/zend_API.c b/Zend/zend_API.c index 8472cd7ab..a465721f1 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -2635,18 +2635,15 @@ ZEND_API ZEND_FUNCTION(display_disabled_function) } /* }}} */ -static zend_function_entry disabled_function[] = { - ZEND_FE(display_disabled_function, NULL) - ZEND_FE_END -}; - ZEND_API int zend_disable_function(char *function_name, uint function_name_length TSRMLS_DC) /* {{{ */ { - if (zend_hash_del(CG(function_table), function_name, function_name_length+1)==FAILURE) { - return FAILURE; + zend_internal_function *func; + if (zend_hash_find(CG(function_table), function_name, function_name_length+1, (void **)&func)==SUCCESS) { + func->arg_info = NULL; + func->handler = ZEND_FN(display_disabled_function); + return SUCCESS; } - disabled_function[0].fname = function_name; - return zend_register_functions(NULL, disabled_function, CG(function_table), MODULE_PERSISTENT TSRMLS_CC); + return FAILURE; } /* }}} */ diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index 19185dfb7..ccaf1652c 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -1931,8 +1931,11 @@ void zend_do_receive_param(zend_uchar op, znode *varname, const znode *initializ if (class_type->u.constant.type == IS_ARRAY) { cur_arg_info->type_hint = IS_ARRAY; if (op == ZEND_RECV_INIT) { - if (Z_TYPE(initialization->u.constant) == IS_NULL || (Z_TYPE(initialization->u.constant) == IS_CONSTANT && !strcasecmp(Z_STRVAL(initialization->u.constant), "NULL")) || Z_TYPE(initialization->u.constant) == IS_CONSTANT_AST) { + if (Z_TYPE(initialization->u.constant) == IS_NULL || (Z_TYPE(initialization->u.constant) == IS_CONSTANT && !strcasecmp(Z_STRVAL(initialization->u.constant), "NULL"))) { cur_arg_info->allow_null = 1; + } else if (IS_CONSTANT_TYPE(Z_TYPE(initialization->u.constant))) { + /* delay constant resolution and check to run-time */ + cur_arg_info->allow_null = 0; } else if (Z_TYPE(initialization->u.constant) != IS_ARRAY) { zend_error_noreturn(E_COMPILE_ERROR, "Default value for parameters with array type hint can only be an array or NULL"); } @@ -1940,8 +1943,11 @@ void zend_do_receive_param(zend_uchar op, znode *varname, const znode *initializ } else if (class_type->u.constant.type == IS_CALLABLE) { cur_arg_info->type_hint = IS_CALLABLE; if (op == ZEND_RECV_INIT) { - if (Z_TYPE(initialization->u.constant) == IS_NULL || (Z_TYPE(initialization->u.constant) == IS_CONSTANT && !strcasecmp(Z_STRVAL(initialization->u.constant), "NULL")) || Z_TYPE(initialization->u.constant) == IS_CONSTANT_AST) { + if (Z_TYPE(initialization->u.constant) == IS_NULL || (Z_TYPE(initialization->u.constant) == IS_CONSTANT && !strcasecmp(Z_STRVAL(initialization->u.constant), "NULL"))) { cur_arg_info->allow_null = 1; + } else if (IS_CONSTANT_TYPE(Z_TYPE(initialization->u.constant))) { + /* delay constant resolution and check to run-time */ + cur_arg_info->allow_null = 0; } else { zend_error_noreturn(E_COMPILE_ERROR, "Default value for parameters with callable type hint can only be NULL"); } @@ -1955,8 +1961,11 @@ void zend_do_receive_param(zend_uchar op, znode *varname, const znode *initializ cur_arg_info->class_name = Z_STRVAL(class_type->u.constant); cur_arg_info->class_name_len = Z_STRLEN(class_type->u.constant); if (op == ZEND_RECV_INIT) { - if (Z_TYPE(initialization->u.constant) == IS_NULL || (Z_TYPE(initialization->u.constant) == IS_CONSTANT && !strcasecmp(Z_STRVAL(initialization->u.constant), "NULL")) || Z_TYPE(initialization->u.constant) == IS_CONSTANT_AST) { + if (Z_TYPE(initialization->u.constant) == IS_NULL || (Z_TYPE(initialization->u.constant) == IS_CONSTANT && !strcasecmp(Z_STRVAL(initialization->u.constant), "NULL"))) { cur_arg_info->allow_null = 1; + } else if (IS_CONSTANT_TYPE(Z_TYPE(initialization->u.constant))) { + /* delay constant resolution and check to run-time */ + cur_arg_info->allow_null = 0; } else { zend_error_noreturn(E_COMPILE_ERROR, "Default value for parameters with a class type hint can only be NULL"); } @@ -4246,8 +4255,8 @@ static void zend_traits_init_trait_structures(zend_class_entry *ce TSRMLS_DC) /* /* make sure that the trait method is not from a class mentioned in exclude_from_classes, for consistency */ - if (cur_precedence->trait_method->ce == cur_precedence->exclude_from_classes[i]) { - zend_error_noreturn(E_COMPILE_ERROR, + if (cur_precedence->trait_method->ce == cur_precedence->exclude_from_classes[j]) { + zend_error(E_COMPILE_ERROR, "Inconsistent insteadof definition. " "The method %s is to be used from %s, but %s is also on the exclude list", cur_method_ref->method_name, diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index 6ada04e1c..cbd568993 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -608,7 +608,22 @@ ZEND_API int zend_verify_arg_error(int error_type, const zend_function *zf, zend return 0; } -static inline int zend_verify_arg_type(zend_function *zf, zend_uint arg_num, zval *arg, ulong fetch_type TSRMLS_DC) +static int is_null_constant(zval *default_value TSRMLS_DC) +{ + if (IS_CONSTANT_TYPE(Z_TYPE_P(default_value))) { + zval constant = *default_value; + zval *constant_ptr = &constant; + + zval_update_constant(&constant_ptr, 0 TSRMLS_CC); + if (Z_TYPE(constant) == IS_NULL) { + return 1; + } + zval_dtor(&constant); + } + return 0; +} + +static inline int zend_verify_arg_type(zend_function *zf, zend_uint arg_num, zval *arg, ulong fetch_type, zval *default_value TSRMLS_DC) { zend_arg_info *cur_arg_info; char *need_msg; @@ -638,7 +653,7 @@ static inline int zend_verify_arg_type(zend_function *zf, zend_uint arg_num, zva if (!ce || !instanceof_function(Z_OBJCE_P(arg), ce TSRMLS_CC)) { return zend_verify_arg_error(E_RECOVERABLE_ERROR, zf, arg_num, need_msg, class_name, "instance of ", Z_OBJCE_P(arg)->name TSRMLS_CC); } - } else if (Z_TYPE_P(arg) != IS_NULL || !cur_arg_info->allow_null) { + } else if (Z_TYPE_P(arg) != IS_NULL || !(cur_arg_info->allow_null || (default_value && is_null_constant(default_value TSRMLS_CC)))) { need_msg = zend_verify_arg_class_kind(cur_arg_info, fetch_type, &class_name, &ce TSRMLS_CC); return zend_verify_arg_error(E_RECOVERABLE_ERROR, zf, arg_num, need_msg, class_name, zend_zval_type_name(arg), "" TSRMLS_CC); } @@ -649,7 +664,7 @@ static inline int zend_verify_arg_type(zend_function *zf, zend_uint arg_num, zva return zend_verify_arg_error(E_RECOVERABLE_ERROR, zf, arg_num, "be of the type array", "", "none", "" TSRMLS_CC); } - if (Z_TYPE_P(arg) != IS_ARRAY && (Z_TYPE_P(arg) != IS_NULL || !cur_arg_info->allow_null)) { + if (Z_TYPE_P(arg) != IS_ARRAY && (Z_TYPE_P(arg) != IS_NULL || !(cur_arg_info->allow_null || (default_value && is_null_constant(default_value TSRMLS_CC))))) { return zend_verify_arg_error(E_RECOVERABLE_ERROR, zf, arg_num, "be of the type array", "", zend_zval_type_name(arg), "" TSRMLS_CC); } break; @@ -658,7 +673,7 @@ static inline int zend_verify_arg_type(zend_function *zf, zend_uint arg_num, zva if (!arg) { return zend_verify_arg_error(E_RECOVERABLE_ERROR, zf, arg_num, "be callable", "", "none", "" TSRMLS_CC); } - if (!zend_is_callable(arg, IS_CALLABLE_CHECK_SILENT, NULL TSRMLS_CC) && (Z_TYPE_P(arg) != IS_NULL || !cur_arg_info->allow_null)) { + if (!zend_is_callable(arg, IS_CALLABLE_CHECK_SILENT, NULL TSRMLS_CC) && (Z_TYPE_P(arg) != IS_NULL || !(cur_arg_info->allow_null || (default_value && is_null_constant(default_value TSRMLS_CC))))) { return zend_verify_arg_error(E_RECOVERABLE_ERROR, zf, arg_num, "be callable", "", zend_zval_type_name(arg), "" TSRMLS_CC); } break; diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index 243da3fde..1f3cab24b 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -1236,6 +1236,10 @@ ZEND_API void zend_timeout(int dummy) /* {{{ */ #ifdef ZEND_WIN32 static LRESULT CALLBACK zend_timeout_WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) /* {{{ */ { +#ifdef ZTS + THREAD_T thread_id = (THREAD_T)wParam; +#endif + switch (message) { case WM_DESTROY: PostQuitMessage(0); @@ -1250,7 +1254,7 @@ static LRESULT CALLBACK zend_timeout_WndProc(HWND hWnd, UINT message, WPARAM wPa #endif SetTimer(timeout_window, wParam, lParam*1000, NULL); #ifdef ZTS - tsrm_ls = ts_resource_ex(0, &wParam); + tsrm_ls = ts_resource_ex(0, &thread_id); if (!tsrm_ls) { /* shouldn't normally happen */ break; @@ -1267,7 +1271,7 @@ static LRESULT CALLBACK zend_timeout_WndProc(HWND hWnd, UINT message, WPARAM wPa #ifdef ZTS void ***tsrm_ls; - tsrm_ls = ts_resource_ex(0, &wParam); + tsrm_ls = ts_resource_ex(0, &thread_id); if (!tsrm_ls) { /* Thread died before receiving its timeout? */ break; @@ -1656,13 +1660,6 @@ ZEND_API void zend_rebuild_symbol_table(TSRMLS_D) /* {{{ */ /*printf("Cache miss! Initialized %x\n", EG(active_symbol_table));*/ } ex->symbol_table = EG(active_symbol_table); - - if (ex->op_array->this_var != -1 && - !*EX_CV_NUM(ex, ex->op_array->this_var) && - EG(This)) { - *EX_CV_NUM(ex, ex->op_array->this_var) = (zval**)EX_CV_NUM(ex, ex->op_array->last_var + ex->op_array->this_var); - **EX_CV_NUM(ex, ex->op_array->this_var) = EG(This); - } for (i = 0; i < ex->op_array->last_var; i++) { if (*EX_CV_NUM(ex, i)) { zend_hash_quick_update(EG(active_symbol_table), diff --git a/Zend/zend_float.h b/Zend/zend_float.h index 33f8e93fb..d9e4f4be8 100644 --- a/Zend/zend_float.h +++ b/Zend/zend_float.h @@ -21,6 +21,8 @@ #ifndef ZEND_FLOAT_H #define ZEND_FLOAT_H +BEGIN_EXTERN_C() + /* Define functions for FP initialization and de-initialization. */ @@ -28,6 +30,8 @@ extern ZEND_API void zend_init_fpu(TSRMLS_D); extern ZEND_API void zend_shutdown_fpu(TSRMLS_D); extern ZEND_API void zend_ensure_fpu_mode(TSRMLS_D); +END_EXTERN_C() + /* Copy of the contents of xpfpa.h (which is under public domain) See http://wiki.php.net/rfc/rounding for details. diff --git a/Zend/zend_vm.h b/Zend/zend_vm.h index 078be15b7..e403e7cc9 100644 --- a/Zend/zend_vm.h +++ b/Zend/zend_vm.h @@ -21,9 +21,13 @@ #ifndef ZEND_VM_H #define ZEND_VM_H +BEGIN_EXTERN_C() + ZEND_API void zend_vm_use_old_executor(void); ZEND_API void zend_vm_set_opcode_handler(zend_op* opcode); +END_EXTERN_C() + #define ZEND_VM_SET_OPCODE_HANDLER(opline) zend_vm_set_opcode_handler(opline) #endif diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h index 705e46e7d..03fa7cf09 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -1961,7 +1961,7 @@ ZEND_VM_HELPER(zend_do_fcall_common_helper, ANY, ANY) void **p = EX(function_state).arguments - num_args; for (i = 0; i < num_args; ++i, ++p) { - zend_verify_arg_type(fbc, i + 1, (zval *) *p, 0 TSRMLS_CC); + zend_verify_arg_type(fbc, i + 1, (zval *) *p, 0, NULL TSRMLS_CC); } } @@ -3374,7 +3374,7 @@ ZEND_VM_HANDLER(63, ZEND_RECV, ANY, ANY) SAVE_OPLINE(); if (UNEXPECTED(param == NULL)) { - if (zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, NULL, opline->extended_value TSRMLS_CC)) { + if (zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, NULL, opline->extended_value, NULL TSRMLS_CC)) { const char *space; const char *class_name; zend_execute_data *ptr; @@ -3396,7 +3396,7 @@ ZEND_VM_HANDLER(63, ZEND_RECV, ANY, ANY) } else { zval **var_ptr; - zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, *param, opline->extended_value TSRMLS_CC); + zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, *param, opline->extended_value, NULL TSRMLS_CC); var_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(execute_data, opline->result.var TSRMLS_CC); Z_DELREF_PP(var_ptr); *var_ptr = *param; @@ -3438,7 +3438,7 @@ ZEND_VM_HANDLER(64, ZEND_RECV_INIT, ANY, CONST) Z_ADDREF_P(assignment_value); } - zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, assignment_value, opline->extended_value TSRMLS_CC); + zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, assignment_value, opline->extended_value, opline->op2.zv TSRMLS_CC); var_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(execute_data, opline->result.var TSRMLS_CC); zval_ptr_dtor(var_ptr); *var_ptr = assignment_value; @@ -3469,7 +3469,7 @@ ZEND_VM_HANDLER(164, ZEND_RECV_VARIADIC, ANY, ANY) for (; arg_num <= arg_count; ++arg_num) { zval **param = zend_vm_stack_get_arg(arg_num TSRMLS_CC); - zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, *param, opline->extended_value TSRMLS_CC); + zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, *param, opline->extended_value, NULL TSRMLS_CC); zend_hash_next_index_insert(Z_ARRVAL_P(params), param, sizeof(zval *), NULL); Z_ADDREF_PP(param); } diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index 993aaee74..20731b4ef 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -541,7 +541,7 @@ static int ZEND_FASTCALL zend_do_fcall_common_helper_SPEC(ZEND_OPCODE_HANDLER_AR void **p = EX(function_state).arguments - num_args; for (i = 0; i < num_args; ++i, ++p) { - zend_verify_arg_type(fbc, i + 1, (zval *) *p, 0 TSRMLS_CC); + zend_verify_arg_type(fbc, i + 1, (zval *) *p, 0, NULL TSRMLS_CC); } } @@ -861,7 +861,7 @@ static int ZEND_FASTCALL ZEND_RECV_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) SAVE_OPLINE(); if (UNEXPECTED(param == NULL)) { - if (zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, NULL, opline->extended_value TSRMLS_CC)) { + if (zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, NULL, opline->extended_value, NULL TSRMLS_CC)) { const char *space; const char *class_name; zend_execute_data *ptr; @@ -883,7 +883,7 @@ static int ZEND_FASTCALL ZEND_RECV_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) } else { zval **var_ptr; - zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, *param, opline->extended_value TSRMLS_CC); + zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, *param, opline->extended_value, NULL TSRMLS_CC); var_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(execute_data, opline->result.var TSRMLS_CC); Z_DELREF_PP(var_ptr); *var_ptr = *param; @@ -916,7 +916,7 @@ static int ZEND_FASTCALL ZEND_RECV_VARIADIC_SPEC_HANDLER(ZEND_OPCODE_HANDLER_AR for (; arg_num <= arg_count; ++arg_num) { zval **param = zend_vm_stack_get_arg(arg_num TSRMLS_CC); - zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, *param, opline->extended_value TSRMLS_CC); + zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, *param, opline->extended_value, NULL TSRMLS_CC); zend_hash_next_index_insert(Z_ARRVAL_P(params), param, sizeof(zval *), NULL); Z_ADDREF_PP(param); } @@ -1643,7 +1643,7 @@ static int ZEND_FASTCALL ZEND_RECV_INIT_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ Z_ADDREF_P(assignment_value); } - zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, assignment_value, opline->extended_value TSRMLS_CC); + zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, assignment_value, opline->extended_value, opline->op2.zv TSRMLS_CC); var_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(execute_data, opline->result.var TSRMLS_CC); zval_ptr_dtor(var_ptr); *var_ptr = assignment_value; diff --git a/Zend/zend_vm_gen.php b/Zend/zend_vm_gen.php index 9995b0b9a..945b42423 100644 --- a/Zend/zend_vm_gen.php +++ b/Zend/zend_vm_gen.php @@ -1208,7 +1208,9 @@ function gen_vm($def, $skel) { out($f, $GLOBALS['header_text']); fputs($f, "#ifndef ZEND_VM_OPCODES_H\n#define ZEND_VM_OPCODES_H\n\n"); + fputs($f, "BEGIN_EXTERN_C()\n\n"); fputs($f, "ZEND_API const char *zend_get_opcode_name(zend_uchar opcode);\n\n"); + fputs($f, "END_EXTERN_C()\n\n"); foreach ($opcodes as $code => $dsc) { $code = str_pad((string)$code,$code_len," ",STR_PAD_LEFT); diff --git a/Zend/zend_vm_opcodes.h b/Zend/zend_vm_opcodes.h index f9c30ca12..605f4a626 100644 --- a/Zend/zend_vm_opcodes.h +++ b/Zend/zend_vm_opcodes.h @@ -21,8 +21,12 @@ #ifndef ZEND_VM_OPCODES_H #define ZEND_VM_OPCODES_H +BEGIN_EXTERN_C() + ZEND_API const char *zend_get_opcode_name(zend_uchar opcode); +END_EXTERN_C() + #define ZEND_NOP 0 #define ZEND_ADD 1 #define ZEND_SUB 2 @@ -3667,7 +3667,7 @@ ac_config_headers="$ac_config_headers main/php_config.h" PHP_MAJOR_VERSION=5 PHP_MINOR_VERSION=6 -PHP_RELEASE_VERSION=3 +PHP_RELEASE_VERSION=4 PHP_EXTRA_VERSION="" PHP_VERSION="$PHP_MAJOR_VERSION.$PHP_MINOR_VERSION.$PHP_RELEASE_VERSION$PHP_EXTRA_VERSION" PHP_VERSION_ID=`expr $PHP_MAJOR_VERSION \* 10000 + $PHP_MINOR_VERSION \* 100 + $PHP_RELEASE_VERSION` diff --git a/configure.in b/configure.in index 00c69a326..3ca75878b 100644 --- a/configure.in +++ b/configure.in @@ -119,7 +119,7 @@ int zend_sprintf(char *buffer, const char *format, ...); PHP_MAJOR_VERSION=5 PHP_MINOR_VERSION=6 -PHP_RELEASE_VERSION=3 +PHP_RELEASE_VERSION=4 PHP_EXTRA_VERSION="" PHP_VERSION="$PHP_MAJOR_VERSION.$PHP_MINOR_VERSION.$PHP_RELEASE_VERSION$PHP_EXTRA_VERSION" PHP_VERSION_ID=`expr [$]PHP_MAJOR_VERSION \* 10000 + [$]PHP_MINOR_VERSION \* 100 + [$]PHP_RELEASE_VERSION` diff --git a/ext/calendar/julian.c b/ext/calendar/julian.c index 17e7bcb59..cbaebc057 100644 --- a/ext/calendar/julian.c +++ b/ext/calendar/julian.c @@ -47,7 +47,7 @@ * * CALENDAR OVERVIEW * - * Julias Ceasar created the calendar in 46 B.C. as a modified form of + * Julius Caesar created the calendar in 46 B.C. as a modified form of * the old Roman republican calendar which was based on lunar cycles. * The new Julian calendar set fixed lengths for the months, abandoning * the lunar cycle. It also specified that there would be exactly 12 diff --git a/ext/calendar/tests/unixtojd.phpt b/ext/calendar/tests/unixtojd.phpt index 4eeb1ca93..6183cae9e 100644 --- a/ext/calendar/tests/unixtojd.phpt +++ b/ext/calendar/tests/unixtojd.phpt @@ -21,10 +21,10 @@ putenv('TZ=UTC'); // -uses --INI-- section with date.timezone=UTC // -uses putenv('TZ=UTC') // date.timezone=UTC -// -if ommitted from easter_date.phpt, outputs DATE_TZ_ERRMSG warning +// -if omitted from easter_date.phpt, outputs DATE_TZ_ERRMSG warning // -easter_date() calls mktime() and localtime() // -whereas unixtojd(1000000000) calls localtime(1000000000) -// -if ommitted from unixtojd.phpt, does NOT output DATE_TZ_ERRMSG +// -if omitted from unixtojd.phpt, does NOT output DATE_TZ_ERRMSG // // unixtojd() calls php_localtime_r() which for Pacific timezone systems, returns a time -8 hours // -this incorrect localtime is passed to the julian date conversion (GregorianToSDN) function which works (probably correctly) diff --git a/ext/curl/tests/bug68089.phpt b/ext/curl/tests/bug68089.phpt index 3bd588970..d65441b2c 100644 --- a/ext/curl/tests/bug68089.phpt +++ b/ext/curl/tests/bug68089.phpt @@ -13,6 +13,6 @@ var_dump(curl_setopt($ch, CURLOPT_URL, $url)); ?> Done --EXPECTF-- -Warning: curl_setopt(): Curl option contains invalid characters (\0) in %s/bug68089.php on line 4 +Warning: curl_setopt(): Curl option contains invalid characters (\0) in %s%ebug68089.php on line 4 bool(false) Done diff --git a/ext/curl/tests/curl_multi_init_param.phpt b/ext/curl/tests/curl_multi_init_param.phpt new file mode 100644 index 000000000..e7848976a --- /dev/null +++ b/ext/curl/tests/curl_multi_init_param.phpt @@ -0,0 +1,27 @@ +--TEST-- +Test curl_multi_init() fail if any parameter is passed +--CREDITS-- +Paulo Eduardo <pauloelr [at] gmail [dot] com> +#testfest SP 2014 +--SKIPIF-- +<?php if (!extension_loaded("curl")) print "skip"; ?> +--FILE-- +<?php +/* Prototype : resource curl_multi_init(void) + * Description : Returns a new cURL multi handle + * Source code : ext/curl/multi.c + * Test documentation: http://wiki.php.net/qa/temp/ext/curl + */ + +// start testing + +//create the multiple cURL handle +$mh = curl_multi_init('test'); +var_dump($mh); + +?> +===DONE=== +--EXPECTF-- +Warning: curl_multi_init() expects exactly 0 parameters, %d given in %s on line %d +NULL +===DONE=== diff --git a/ext/date/lib/dow.c b/ext/date/lib/dow.c index a77fdd718..ccfea996f 100644 --- a/ext/date/lib/dow.c +++ b/ext/date/lib/dow.c @@ -23,9 +23,21 @@ static int m_table_common[13] = { -1, 0, 3, 3, 6, 1, 4, 6, 2, 5, 0, 3, 5 }; /* 1 = jan */ static int m_table_leap[13] = { -1, 6, 2, 3, 6, 1, 4, 6, 2, 5, 0, 3, 5 }; /* 1 = jan */ +static timelib_sll positive_mod(timelib_sll x, timelib_sll y) +{ + timelib_sll tmp; + + tmp = x % y; + if (tmp < 0) { + tmp += y; + } + + return tmp; +} + static timelib_sll century_value(timelib_sll j) { - return 6 - (j % 4) * 2; + return 6 - positive_mod(j, 4) * 2; } static timelib_sll timelib_day_of_week_ex(timelib_sll y, timelib_sll m, timelib_sll d, int iso) @@ -36,9 +48,9 @@ static timelib_sll timelib_day_of_week_ex(timelib_sll y, timelib_sll m, timelib_ * Julian calendar. We just return the 'wrong' day of week to be * consistent. */ c1 = century_value(y / 100); - y1 = (y % 100); + y1 = positive_mod(y, 100); m1 = timelib_is_leap(y) ? m_table_leap[m] : m_table_common[m]; - dow = (c1 + y1 + m1 + (y1 / 4) + d) % 7; + dow = positive_mod((c1 + y1 + m1 + (y1 / 4) + d), 7); if (iso) { if (dow == 0) { dow = 7; diff --git a/ext/date/lib/parse_tz.c b/ext/date/lib/parse_tz.c index 5d2aec9c9..5e6250b8b 100644 --- a/ext/date/lib/parse_tz.c +++ b/ext/date/lib/parse_tz.c @@ -336,7 +336,7 @@ static ttinfo* fetch_timezone_offset(timelib_tzinfo *tz, timelib_sll ts, timelib { uint32_t i; - /* If there is no transistion time, we pick the first one, if that doesn't + /* If there is no transition time, we pick the first one, if that doesn't * exist we return NULL */ if (!tz->timecnt || !tz->trans) { *transition_time = 0; @@ -346,8 +346,8 @@ static ttinfo* fetch_timezone_offset(timelib_tzinfo *tz, timelib_sll ts, timelib return NULL; } - /* If the TS is lower than the first transistion time, then we scan over - * all the transistion times to find the first non-DST one, or the first + /* If the TS is lower than the first transition time, then we scan over + * all the transition times to find the first non-DST one, or the first * one in case there are only DST entries. Not sure which smartass came up * with this idea in the first though :) */ if (ts < tz->trans[0]) { diff --git a/ext/date/lib/timezonedb.h b/ext/date/lib/timezonedb.h index 0fd9bfbe1..157f0f494 100644 --- a/ext/date/lib/timezonedb.h +++ b/ext/date/lib/timezonedb.h @@ -2,589 +2,589 @@ const timelib_tzdb_index_entry timezonedb_idx_builtin[583] = { { "Africa/Abidjan" , 0x000000 }, { "Africa/Accra" , 0x000055 }, { "Africa/Addis_Ababa" , 0x00019D }, - { "Africa/Algiers" , 0x0001F3 }, - { "Africa/Asmara" , 0x00031E }, - { "Africa/Asmera" , 0x000374 }, - { "Africa/Bamako" , 0x0003CA }, - { "Africa/Bangui" , 0x00041F }, - { "Africa/Banjul" , 0x000474 }, - { "Africa/Bissau" , 0x0004C9 }, - { "Africa/Blantyre" , 0x00052F }, - { "Africa/Brazzaville" , 0x000584 }, - { "Africa/Bujumbura" , 0x0005D9 }, - { "Africa/Cairo" , 0x00062E }, - { "Africa/Casablanca" , 0x000A15 }, - { "Africa/Ceuta" , 0x000C77 }, - { "Africa/Conakry" , 0x000F7E }, - { "Africa/Dakar" , 0x000FD3 }, - { "Africa/Dar_es_Salaam" , 0x001028 }, - { "Africa/Djibouti" , 0x001095 }, - { "Africa/Douala" , 0x0010EA }, - { "Africa/El_Aaiun" , 0x00113F }, - { "Africa/Freetown" , 0x00136A }, - { "Africa/Gaborone" , 0x0013BF }, - { "Africa/Harare" , 0x001414 }, - { "Africa/Johannesburg" , 0x001469 }, - { "Africa/Juba" , 0x0014D7 }, - { "Africa/Kampala" , 0x0015EA }, - { "Africa/Khartoum" , 0x001669 }, - { "Africa/Kigali" , 0x00177C }, - { "Africa/Kinshasa" , 0x0017D1 }, - { "Africa/Lagos" , 0x00183D }, - { "Africa/Libreville" , 0x001892 }, - { "Africa/Lome" , 0x0018E7 }, - { "Africa/Luanda" , 0x00193C }, - { "Africa/Lubumbashi" , 0x001991 }, - { "Africa/Lusaka" , 0x0019FD }, - { "Africa/Malabo" , 0x001A52 }, - { "Africa/Maputo" , 0x001AA7 }, - { "Africa/Maseru" , 0x001AFC }, - { "Africa/Mbabane" , 0x001B6A }, - { "Africa/Mogadishu" , 0x001BD8 }, - { "Africa/Monrovia" , 0x001C33 }, - { "Africa/Nairobi" , 0x001C99 }, - { "Africa/Ndjamena" , 0x001D18 }, - { "Africa/Niamey" , 0x001D84 }, - { "Africa/Nouakchott" , 0x001DD9 }, - { "Africa/Ouagadougou" , 0x001E2E }, - { "Africa/Porto-Novo" , 0x001E83 }, - { "Africa/Sao_Tome" , 0x001ED8 }, - { "Africa/Timbuktu" , 0x001F2D }, - { "Africa/Tripoli" , 0x001F82 }, - { "Africa/Tunis" , 0x00208B }, - { "Africa/Windhoek" , 0x00219D }, - { "America/Adak" , 0x0023E4 }, - { "America/Anchorage" , 0x00275A }, - { "America/Anguilla" , 0x002ACE }, - { "America/Antigua" , 0x002B23 }, - { "America/Araguaina" , 0x002B89 }, - { "America/Argentina/Buenos_Aires" , 0x002CEE }, - { "America/Argentina/Catamarca" , 0x002E9C }, - { "America/Argentina/ComodRivadavia" , 0x00305D }, - { "America/Argentina/Cordoba" , 0x003203 }, - { "America/Argentina/Jujuy" , 0x0033D8 }, - { "America/Argentina/La_Rioja" , 0x00358C }, - { "America/Argentina/Mendoza" , 0x003744 }, - { "America/Argentina/Rio_Gallegos" , 0x003904 }, - { "America/Argentina/Salta" , 0x003AB9 }, - { "America/Argentina/San_Juan" , 0x003C65 }, - { "America/Argentina/San_Luis" , 0x003E1D }, - { "America/Argentina/Tucuman" , 0x003FE3 }, - { "America/Argentina/Ushuaia" , 0x00419F }, - { "America/Aruba" , 0x00435A }, - { "America/Asuncion" , 0x0043C0 }, - { "America/Atikokan" , 0x0046A5 }, - { "America/Atka" , 0x00477B }, - { "America/Bahia" , 0x004AE1 }, - { "America/Bahia_Banderas" , 0x004C74 }, - { "America/Barbados" , 0x004EED }, - { "America/Belem" , 0x004F87 }, - { "America/Belize" , 0x005082 }, - { "America/Blanc-Sablon" , 0x0051FE }, - { "America/Boa_Vista" , 0x0052B2 }, - { "America/Bogota" , 0x0053BB }, - { "America/Boise" , 0x005427 }, - { "America/Buenos_Aires" , 0x0057BE }, - { "America/Cambridge_Bay" , 0x005957 }, - { "America/Campo_Grande" , 0x005C7F }, - { "America/Cancun" , 0x005F6E }, - { "America/Caracas" , 0x0061B0 }, - { "America/Catamarca" , 0x006217 }, - { "America/Cayenne" , 0x0063BD }, - { "America/Cayman" , 0x00641F }, - { "America/Chicago" , 0x006474 }, - { "America/Chihuahua" , 0x00698B }, - { "America/Coral_Harbour" , 0x006BF6 }, - { "America/Cordoba" , 0x006C88 }, - { "America/Costa_Rica" , 0x006E2E }, - { "America/Creston" , 0x006EB8 }, - { "America/Cuiaba" , 0x006F44 }, - { "America/Curacao" , 0x007222 }, - { "America/Danmarkshavn" , 0x007288 }, - { "America/Dawson" , 0x0073CC }, - { "America/Dawson_Creek" , 0x0076E9 }, - { "America/Denver" , 0x0078C3 }, - { "America/Detroit" , 0x007C49 }, - { "America/Dominica" , 0x007FA8 }, - { "America/Edmonton" , 0x007FFD }, - { "America/Eirunepe" , 0x0083B5 }, - { "America/El_Salvador" , 0x0084CD }, - { "America/Ensenada" , 0x008542 }, - { "America/Fort_Wayne" , 0x0089E9 }, - { "America/Fortaleza" , 0x0088AB }, - { "America/Glace_Bay" , 0x008C53 }, - { "America/Godthab" , 0x008FCA }, - { "America/Goose_Bay" , 0x00928E }, - { "America/Grand_Turk" , 0x00974B }, - { "America/Grenada" , 0x009920 }, - { "America/Guadeloupe" , 0x009975 }, - { "America/Guatemala" , 0x0099CA }, - { "America/Guayaquil" , 0x009A53 }, - { "America/Guyana" , 0x009AB0 }, - { "America/Halifax" , 0x009B31 }, - { "America/Havana" , 0x00A047 }, - { "America/Hermosillo" , 0x00A3BA }, - { "America/Indiana/Indianapolis" , 0x00A498 }, - { "America/Indiana/Knox" , 0x00A729 }, - { "America/Indiana/Marengo" , 0x00AAC0 }, - { "America/Indiana/Petersburg" , 0x00AD66 }, - { "America/Indiana/Tell_City" , 0x00B2B3 }, - { "America/Indiana/Vevay" , 0x00B54C }, - { "America/Indiana/Vincennes" , 0x00B787 }, - { "America/Indiana/Winamac" , 0x00BA3B }, - { "America/Indianapolis" , 0x00B049 }, - { "America/Inuvik" , 0x00BCF4 }, - { "America/Iqaluit" , 0x00BFEB }, - { "America/Jamaica" , 0x00C30D }, - { "America/Jujuy" , 0x00C3D2 }, - { "America/Juneau" , 0x00C57C }, - { "America/Kentucky/Louisville" , 0x00C8FA }, - { "America/Kentucky/Monticello" , 0x00CD18 }, - { "America/Knox_IN" , 0x00D09D }, - { "America/Kralendijk" , 0x00D40E }, - { "America/La_Paz" , 0x00D474 }, - { "America/Lima" , 0x00D4DB }, - { "America/Los_Angeles" , 0x00D583 }, - { "America/Louisville" , 0x00D994 }, - { "America/Lower_Princes" , 0x00DD89 }, - { "America/Maceio" , 0x00DDEF }, - { "America/Managua" , 0x00DF29 }, - { "America/Manaus" , 0x00DFDC }, - { "America/Marigot" , 0x00E0DE }, - { "America/Martinique" , 0x00E133 }, - { "America/Matamoros" , 0x00E19F }, - { "America/Mazatlan" , 0x00E3F8 }, - { "America/Mendoza" , 0x00E665 }, - { "America/Menominee" , 0x00E819 }, - { "America/Merida" , 0x00EB9A }, - { "America/Metlakatla" , 0x00EDD5 }, - { "America/Mexico_City" , 0x00EF10 }, - { "America/Miquelon" , 0x00F18B }, - { "America/Moncton" , 0x00F3FD }, - { "America/Monterrey" , 0x00F894 }, - { "America/Montevideo" , 0x00FAF7 }, - { "America/Montreal" , 0x00FE09 }, - { "America/Montserrat" , 0x0102F9 }, - { "America/Nassau" , 0x01034E }, - { "America/New_York" , 0x010693 }, - { "America/Nipigon" , 0x010B9E }, - { "America/Nome" , 0x010EEF }, - { "America/Noronha" , 0x01126D }, - { "America/North_Dakota/Beulah" , 0x01139D }, - { "America/North_Dakota/Center" , 0x011731 }, - { "America/North_Dakota/New_Salem" , 0x011AC5 }, - { "America/Ojinaga" , 0x011E6E }, - { "America/Panama" , 0x0120CF }, - { "America/Pangnirtung" , 0x012124 }, - { "America/Paramaribo" , 0x01245A }, - { "America/Phoenix" , 0x0124EC }, - { "America/Port-au-Prince" , 0x0125AA }, - { "America/Port_of_Spain" , 0x0128CE }, - { "America/Porto_Acre" , 0x0127CA }, - { "America/Porto_Velho" , 0x012923 }, - { "America/Puerto_Rico" , 0x012A19 }, - { "America/Rainy_River" , 0x012A84 }, - { "America/Rankin_Inlet" , 0x012DBC }, - { "America/Recife" , 0x0130A2 }, - { "America/Regina" , 0x0131CC }, - { "America/Resolute" , 0x01338A }, - { "America/Rio_Branco" , 0x013672 }, - { "America/Rosario" , 0x01377A }, - { "America/Santa_Isabel" , 0x013920 }, - { "America/Santarem" , 0x013CC3 }, - { "America/Santiago" , 0x013DC8 }, - { "America/Santo_Domingo" , 0x014171 }, - { "America/Sao_Paulo" , 0x014237 }, - { "America/Scoresbysund" , 0x014546 }, - { "America/Shiprock" , 0x014834 }, - { "America/Sitka" , 0x014BAD }, - { "America/St_Barthelemy" , 0x014F35 }, - { "America/St_Johns" , 0x014F8A }, - { "America/St_Kitts" , 0x0154DD }, - { "America/St_Lucia" , 0x015532 }, - { "America/St_Thomas" , 0x015587 }, - { "America/St_Vincent" , 0x0155DC }, - { "America/Swift_Current" , 0x015631 }, - { "America/Tegucigalpa" , 0x015752 }, - { "America/Thule" , 0x0157D1 }, - { "America/Thunder_Bay" , 0x015A18 }, - { "America/Tijuana" , 0x015D61 }, - { "America/Toronto" , 0x0160FA }, - { "America/Tortola" , 0x01661A }, - { "America/Vancouver" , 0x01666F }, - { "America/Virgin" , 0x016AAC }, - { "America/Whitehorse" , 0x016B01 }, - { "America/Winnipeg" , 0x016E1E }, - { "America/Yakutat" , 0x01725E }, - { "America/Yellowknife" , 0x0175C9 }, - { "Antarctica/Casey" , 0x0178D9 }, - { "Antarctica/Davis" , 0x017977 }, - { "Antarctica/DumontDUrville" , 0x017A18 }, - { "Antarctica/Macquarie" , 0x017AA9 }, - { "Antarctica/Mawson" , 0x017CF6 }, - { "Antarctica/McMurdo" , 0x017D72 }, - { "Antarctica/Palmer" , 0x01811D }, - { "Antarctica/Rothera" , 0x018439 }, - { "Antarctica/South_Pole" , 0x0184AF }, - { "Antarctica/Syowa" , 0x01882D }, - { "Antarctica/Troll" , 0x01889B }, - { "Antarctica/Vostok" , 0x018A6D }, - { "Arctic/Longyearbyen" , 0x018ADE }, - { "Asia/Aden" , 0x018E10 }, - { "Asia/Almaty" , 0x018E65 }, - { "Asia/Amman" , 0x018FE4 }, - { "Asia/Anadyr" , 0x01929A }, - { "Asia/Aqtau" , 0x01949C }, - { "Asia/Aqtobe" , 0x01969B }, - { "Asia/Ashgabat" , 0x019853 }, - { "Asia/Ashkhabad" , 0x019970 }, - { "Asia/Baghdad" , 0x019A8D }, - { "Asia/Bahrain" , 0x019C02 }, - { "Asia/Baku" , 0x019C68 }, - { "Asia/Bangkok" , 0x019F50 }, - { "Asia/Beirut" , 0x019FA5 }, - { "Asia/Bishkek" , 0x01A2B2 }, - { "Asia/Brunei" , 0x01A45E }, - { "Asia/Calcutta" , 0x01A4C0 }, - { "Asia/Chita" , 0x01A539 }, - { "Asia/Choibalsan" , 0x01A74E }, - { "Asia/Chongqing" , 0x01A8C7 }, - { "Asia/Chungking" , 0x01A967 }, - { "Asia/Colombo" , 0x01AA07 }, - { "Asia/Dacca" , 0x01AAA3 }, - { "Asia/Damascus" , 0x01AB49 }, - { "Asia/Dhaka" , 0x01AE99 }, - { "Asia/Dili" , 0x01AF3F }, - { "Asia/Dubai" , 0x01AFC9 }, - { "Asia/Dushanbe" , 0x01B01E }, - { "Asia/Gaza" , 0x01B121 }, - { "Asia/Harbin" , 0x01B474 }, - { "Asia/Hebron" , 0x01B514 }, - { "Asia/Ho_Chi_Minh" , 0x01B870 }, - { "Asia/Hong_Kong" , 0x01B912 }, - { "Asia/Hovd" , 0x01BAD4 }, - { "Asia/Irkutsk" , 0x01BC4C }, - { "Asia/Istanbul" , 0x01BE37 }, - { "Asia/Jakarta" , 0x01C224 }, - { "Asia/Jayapura" , 0x01C2CE }, - { "Asia/Jerusalem" , 0x01C36B }, - { "Asia/Kabul" , 0x01C69A }, - { "Asia/Kamchatka" , 0x01C6EB }, - { "Asia/Karachi" , 0x01C8E4 }, - { "Asia/Kashgar" , 0x01C999 }, - { "Asia/Kathmandu" , 0x01C9EE }, - { "Asia/Katmandu" , 0x01CA54 }, - { "Asia/Khandyga" , 0x01CABA }, - { "Asia/Kolkata" , 0x01CCE4 }, - { "Asia/Krasnoyarsk" , 0x01CD5D }, - { "Asia/Kuala_Lumpur" , 0x01CF4A }, - { "Asia/Kuching" , 0x01D007 }, - { "Asia/Kuwait" , 0x01D0F5 }, - { "Asia/Macao" , 0x01D14A }, - { "Asia/Macau" , 0x01D285 }, - { "Asia/Magadan" , 0x01D3C0 }, - { "Asia/Makassar" , 0x01D5C4 }, - { "Asia/Manila" , 0x01D689 }, - { "Asia/Muscat" , 0x01D70E }, - { "Asia/Nicosia" , 0x01D763 }, - { "Asia/Novokuznetsk" , 0x01DA4B }, - { "Asia/Novosibirsk" , 0x01DC6B }, - { "Asia/Omsk" , 0x01DE5B }, - { "Asia/Oral" , 0x01E047 }, - { "Asia/Phnom_Penh" , 0x01E217 }, - { "Asia/Pontianak" , 0x01E26C }, - { "Asia/Pyongyang" , 0x01E32E }, - { "Asia/Qatar" , 0x01E3BE }, - { "Asia/Qyzylorda" , 0x01E424 }, - { "Asia/Rangoon" , 0x01E5FA }, - { "Asia/Riyadh" , 0x01E672 }, - { "Asia/Saigon" , 0x01E6C7 }, - { "Asia/Sakhalin" , 0x01E769 }, - { "Asia/Samarkand" , 0x01E966 }, - { "Asia/Seoul" , 0x01EA9C }, - { "Asia/Shanghai" , 0x01EB63 }, - { "Asia/Singapore" , 0x01EC0F }, - { "Asia/Srednekolymsk" , 0x01ECC6 }, - { "Asia/Taipei" , 0x01EEC6 }, - { "Asia/Tashkent" , 0x01EFF7 }, - { "Asia/Tbilisi" , 0x01F128 }, - { "Asia/Tehran" , 0x01F2E2 }, - { "Asia/Tel_Aviv" , 0x01F550 }, - { "Asia/Thimbu" , 0x01F87F }, - { "Asia/Thimphu" , 0x01F8E5 }, - { "Asia/Tokyo" , 0x01F94B }, - { "Asia/Ujung_Pandang" , 0x01F9D5 }, - { "Asia/Ulaanbaatar" , 0x01FA52 }, - { "Asia/Ulan_Bator" , 0x01FBAD }, - { "Asia/Urumqi" , 0x01FCFA }, - { "Asia/Ust-Nera" , 0x01FD5C }, - { "Asia/Vientiane" , 0x01FF6E }, - { "Asia/Vladivostok" , 0x01FFC3 }, - { "Asia/Yakutsk" , 0x0201AD }, - { "Asia/Yekaterinburg" , 0x020397 }, - { "Asia/Yerevan" , 0x0205B8 }, - { "Atlantic/Azores" , 0x0207B8 }, - { "Atlantic/Bermuda" , 0x020CBB }, - { "Atlantic/Canary" , 0x020F9C }, - { "Atlantic/Cape_Verde" , 0x021272 }, - { "Atlantic/Faeroe" , 0x0212EB }, - { "Atlantic/Faroe" , 0x02158F }, - { "Atlantic/Jan_Mayen" , 0x021833 }, - { "Atlantic/Madeira" , 0x021B65 }, - { "Atlantic/Reykjavik" , 0x02206E }, - { "Atlantic/South_Georgia" , 0x022227 }, - { "Atlantic/St_Helena" , 0x022439 }, - { "Atlantic/Stanley" , 0x02226B }, - { "Australia/ACT" , 0x02248E }, - { "Australia/Adelaide" , 0x0227B1 }, - { "Australia/Brisbane" , 0x022AE3 }, - { "Australia/Broken_Hill" , 0x022BB0 }, - { "Australia/Canberra" , 0x022EF4 }, - { "Australia/Currie" , 0x023217 }, - { "Australia/Darwin" , 0x023550 }, - { "Australia/Eucla" , 0x0235DC }, - { "Australia/Hobart" , 0x0236B8 }, - { "Australia/LHI" , 0x023A1C }, - { "Australia/Lindeman" , 0x023CBD }, - { "Australia/Lord_Howe" , 0x023DA4 }, - { "Australia/Melbourne" , 0x024055 }, - { "Australia/North" , 0x024380 }, - { "Australia/NSW" , 0x0243FA }, - { "Australia/Perth" , 0x02471D }, - { "Australia/Queensland" , 0x0247FB }, - { "Australia/South" , 0x0248AD }, - { "Australia/Sydney" , 0x024BD0 }, - { "Australia/Tasmania" , 0x024F13 }, - { "Australia/Victoria" , 0x02525E }, - { "Australia/West" , 0x025581 }, - { "Australia/Yancowinna" , 0x02563D }, - { "Brazil/Acre" , 0x025965 }, - { "Brazil/DeNoronha" , 0x025A69 }, - { "Brazil/East" , 0x025B89 }, - { "Brazil/West" , 0x025E66 }, - { "Canada/Atlantic" , 0x025F5E }, - { "Canada/Central" , 0x026446 }, - { "Canada/East-Saskatchewan" , 0x026D50 }, - { "Canada/Eastern" , 0x026860 }, - { "Canada/Mountain" , 0x026ED9 }, - { "Canada/Newfoundland" , 0x02724F }, - { "Canada/Pacific" , 0x02777A }, - { "Canada/Saskatchewan" , 0x027B93 }, - { "Canada/Yukon" , 0x027D1C }, - { "CET" , 0x02801F }, - { "Chile/Continental" , 0x028328 }, - { "Chile/EasterIsland" , 0x0286C3 }, - { "CST6CDT" , 0x028A05 }, - { "Cuba" , 0x028D56 }, - { "EET" , 0x0290C9 }, - { "Egypt" , 0x02937C }, - { "Eire" , 0x029763 }, - { "EST" , 0x029C74 }, - { "EST5EDT" , 0x029CB8 }, - { "Etc/GMT" , 0x02A009 }, - { "Etc/GMT+0" , 0x02A0D5 }, - { "Etc/GMT+1" , 0x02A15F }, - { "Etc/GMT+10" , 0x02A1EC }, - { "Etc/GMT+11" , 0x02A27A }, - { "Etc/GMT+12" , 0x02A308 }, - { "Etc/GMT+2" , 0x02A423 }, - { "Etc/GMT+3" , 0x02A4AF }, - { "Etc/GMT+4" , 0x02A53B }, - { "Etc/GMT+5" , 0x02A5C7 }, - { "Etc/GMT+6" , 0x02A653 }, - { "Etc/GMT+7" , 0x02A6DF }, - { "Etc/GMT+8" , 0x02A76B }, - { "Etc/GMT+9" , 0x02A7F7 }, - { "Etc/GMT-0" , 0x02A091 }, - { "Etc/GMT-1" , 0x02A119 }, - { "Etc/GMT-10" , 0x02A1A5 }, - { "Etc/GMT-11" , 0x02A233 }, - { "Etc/GMT-12" , 0x02A2C1 }, - { "Etc/GMT-13" , 0x02A34F }, - { "Etc/GMT-14" , 0x02A396 }, - { "Etc/GMT-2" , 0x02A3DD }, - { "Etc/GMT-3" , 0x02A469 }, - { "Etc/GMT-4" , 0x02A4F5 }, - { "Etc/GMT-5" , 0x02A581 }, - { "Etc/GMT-6" , 0x02A60D }, - { "Etc/GMT-7" , 0x02A699 }, - { "Etc/GMT-8" , 0x02A725 }, - { "Etc/GMT-9" , 0x02A7B1 }, - { "Etc/GMT0" , 0x02A04D }, - { "Etc/Greenwich" , 0x02A83D }, - { "Etc/UCT" , 0x02A881 }, - { "Etc/Universal" , 0x02A8C5 }, - { "Etc/UTC" , 0x02A909 }, - { "Etc/Zulu" , 0x02A94D }, - { "Europe/Amsterdam" , 0x02A991 }, - { "Europe/Andorra" , 0x02ADCF }, - { "Europe/Athens" , 0x02B04B }, - { "Europe/Belfast" , 0x02B38E }, - { "Europe/Belgrade" , 0x02B8C5 }, - { "Europe/Berlin" , 0x02BB8E }, - { "Europe/Bratislava" , 0x02BEF2 }, - { "Europe/Brussels" , 0x02C224 }, - { "Europe/Bucharest" , 0x02C65B }, - { "Europe/Budapest" , 0x02C985 }, - { "Europe/Busingen" , 0x02CCEE }, - { "Europe/Chisinau" , 0x02CFA5 }, - { "Europe/Copenhagen" , 0x02D333 }, - { "Europe/Dublin" , 0x02D63D }, - { "Europe/Gibraltar" , 0x02DB4E }, - { "Europe/Guernsey" , 0x02DFA5 }, - { "Europe/Helsinki" , 0x02E4DC }, - { "Europe/Isle_of_Man" , 0x02E792 }, - { "Europe/Istanbul" , 0x02ECC9 }, - { "Europe/Jersey" , 0x02F0B6 }, - { "Europe/Kaliningrad" , 0x02F5ED }, - { "Europe/Kiev" , 0x02F858 }, - { "Europe/Lisbon" , 0x02FB74 }, - { "Europe/Ljubljana" , 0x030078 }, - { "Europe/London" , 0x030341 }, - { "Europe/Luxembourg" , 0x030878 }, - { "Europe/Madrid" , 0x030CCE }, - { "Europe/Malta" , 0x031094 }, - { "Europe/Mariehamn" , 0x03144D }, - { "Europe/Minsk" , 0x031703 }, - { "Europe/Monaco" , 0x031916 }, - { "Europe/Moscow" , 0x031D51 }, - { "Europe/Nicosia" , 0x031FAB }, - { "Europe/Oslo" , 0x032293 }, - { "Europe/Paris" , 0x0325C5 }, - { "Europe/Podgorica" , 0x032A0B }, - { "Europe/Prague" , 0x032CD4 }, - { "Europe/Riga" , 0x033006 }, - { "Europe/Rome" , 0x03334B }, - { "Europe/Samara" , 0x03370E }, - { "Europe/San_Marino" , 0x033977 }, - { "Europe/Sarajevo" , 0x033D3A }, - { "Europe/Simferopol" , 0x034003 }, - { "Europe/Skopje" , 0x034254 }, - { "Europe/Sofia" , 0x03451D }, - { "Europe/Stockholm" , 0x034825 }, - { "Europe/Tallinn" , 0x034AD4 }, - { "Europe/Tirane" , 0x034E0E }, - { "Europe/Tiraspol" , 0x035114 }, - { "Europe/Uzhgorod" , 0x0354A2 }, - { "Europe/Vaduz" , 0x0357B9 }, - { "Europe/Vatican" , 0x035A68 }, - { "Europe/Vienna" , 0x035E2B }, - { "Europe/Vilnius" , 0x036158 }, - { "Europe/Volgograd" , 0x036497 }, - { "Europe/Warsaw" , 0x0366B8 }, - { "Europe/Zagreb" , 0x036A99 }, - { "Europe/Zaporozhye" , 0x036D62 }, - { "Europe/Zurich" , 0x0370A3 }, - { "Factory" , 0x037352 }, - { "GB" , 0x0373C3 }, - { "GB-Eire" , 0x0378FA }, - { "GMT" , 0x037E31 }, - { "GMT+0" , 0x037EFD }, - { "GMT-0" , 0x037EB9 }, - { "GMT0" , 0x037E75 }, - { "Greenwich" , 0x037F41 }, - { "Hongkong" , 0x037F85 }, - { "HST" , 0x038147 }, - { "Iceland" , 0x03818B }, - { "Indian/Antananarivo" , 0x038344 }, - { "Indian/Chagos" , 0x0383B8 }, - { "Indian/Christmas" , 0x03841A }, - { "Indian/Cocos" , 0x03845E }, - { "Indian/Comoro" , 0x0384A2 }, - { "Indian/Kerguelen" , 0x0384F7 }, - { "Indian/Mahe" , 0x03854C }, - { "Indian/Maldives" , 0x0385A1 }, - { "Indian/Mauritius" , 0x0385F6 }, - { "Indian/Mayotte" , 0x03866C }, - { "Indian/Reunion" , 0x0386C1 }, - { "Iran" , 0x038716 }, - { "Israel" , 0x038984 }, - { "Jamaica" , 0x038CB3 }, - { "Japan" , 0x038D78 }, - { "Kwajalein" , 0x038E02 }, - { "Libya" , 0x038E65 }, - { "MET" , 0x038F6E }, - { "Mexico/BajaNorte" , 0x039277 }, - { "Mexico/BajaSur" , 0x0395E0 }, - { "Mexico/General" , 0x039825 }, - { "MST" , 0x039A83 }, - { "MST7MDT" , 0x039AC7 }, - { "Navajo" , 0x039E18 }, - { "NZ" , 0x03A191 }, - { "NZ-CHAT" , 0x03A50F }, - { "Pacific/Apia" , 0x03A7F3 }, - { "Pacific/Auckland" , 0x03A98F }, - { "Pacific/Bougainville" , 0x03AD1B }, - { "Pacific/Chatham" , 0x03AD92 }, - { "Pacific/Chuuk" , 0x03B085 }, - { "Pacific/Easter" , 0x03B0DE }, - { "Pacific/Efate" , 0x03B42D }, - { "Pacific/Enderbury" , 0x03B4F3 }, - { "Pacific/Fakaofo" , 0x03B561 }, - { "Pacific/Fiji" , 0x03B5B2 }, - { "Pacific/Funafuti" , 0x03B745 }, - { "Pacific/Galapagos" , 0x03B789 }, - { "Pacific/Gambier" , 0x03B801 }, - { "Pacific/Guadalcanal" , 0x03B866 }, - { "Pacific/Guam" , 0x03B8BB }, - { "Pacific/Honolulu" , 0x03B911 }, - { "Pacific/Johnston" , 0x03B988 }, - { "Pacific/Kiritimati" , 0x03BA07 }, - { "Pacific/Kosrae" , 0x03BA72 }, - { "Pacific/Kwajalein" , 0x03BACF }, - { "Pacific/Majuro" , 0x03BB3B }, - { "Pacific/Marquesas" , 0x03BB9A }, - { "Pacific/Midway" , 0x03BC01 }, - { "Pacific/Nauru" , 0x03BC8B }, - { "Pacific/Niue" , 0x03BD03 }, - { "Pacific/Norfolk" , 0x03BD61 }, - { "Pacific/Noumea" , 0x03BDB6 }, - { "Pacific/Pago_Pago" , 0x03BE46 }, - { "Pacific/Palau" , 0x03BEBD }, - { "Pacific/Pitcairn" , 0x03BF01 }, - { "Pacific/Pohnpei" , 0x03BF56 }, - { "Pacific/Ponape" , 0x03BFAB }, - { "Pacific/Port_Moresby" , 0x03BFF0 }, - { "Pacific/Rarotonga" , 0x03C042 }, - { "Pacific/Saipan" , 0x03C11E }, - { "Pacific/Samoa" , 0x03C181 }, - { "Pacific/Tahiti" , 0x03C1F8 }, - { "Pacific/Tarawa" , 0x03C25D }, - { "Pacific/Tongatapu" , 0x03C2B1 }, - { "Pacific/Truk" , 0x03C33D }, - { "Pacific/Wake" , 0x03C382 }, - { "Pacific/Wallis" , 0x03C3D2 }, - { "Pacific/Yap" , 0x03C416 }, - { "Poland" , 0x03C45B }, - { "Portugal" , 0x03C83C }, - { "PRC" , 0x03CD38 }, - { "PST8PDT" , 0x03CDD8 }, - { "ROC" , 0x03D129 }, - { "ROK" , 0x03D25A }, - { "Singapore" , 0x03D321 }, - { "Turkey" , 0x03D3D8 }, - { "UCT" , 0x03D7C5 }, - { "Universal" , 0x03D809 }, - { "US/Alaska" , 0x03D84D }, - { "US/Aleutian" , 0x03DBB6 }, - { "US/Arizona" , 0x03DF1C }, - { "US/Central" , 0x03DFAA }, - { "US/East-Indiana" , 0x03E9B4 }, - { "US/Eastern" , 0x03E4B5 }, - { "US/Hawaii" , 0x03EC1E }, - { "US/Indiana-Starke" , 0x03EC8F }, - { "US/Michigan" , 0x03F000 }, - { "US/Mountain" , 0x03F337 }, - { "US/Pacific" , 0x03F6B0 }, - { "US/Pacific-New" , 0x03FAB5 }, - { "US/Samoa" , 0x03FEBA }, - { "UTC" , 0x03FF31 }, - { "W-SU" , 0x040228 }, - { "WET" , 0x03FF75 }, - { "Zulu" , 0x04046B }, + { "Africa/Algiers" , 0x00021C }, + { "Africa/Asmara" , 0x000347 }, + { "Africa/Asmera" , 0x0003C6 }, + { "Africa/Bamako" , 0x000445 }, + { "Africa/Bangui" , 0x00049A }, + { "Africa/Banjul" , 0x0004EF }, + { "Africa/Bissau" , 0x000544 }, + { "Africa/Blantyre" , 0x0005AA }, + { "Africa/Brazzaville" , 0x0005FF }, + { "Africa/Bujumbura" , 0x000654 }, + { "Africa/Cairo" , 0x0006A9 }, + { "Africa/Casablanca" , 0x000A90 }, + { "Africa/Ceuta" , 0x000CF2 }, + { "Africa/Conakry" , 0x000FF9 }, + { "Africa/Dakar" , 0x00104E }, + { "Africa/Dar_es_Salaam" , 0x0010A3 }, + { "Africa/Djibouti" , 0x001122 }, + { "Africa/Douala" , 0x0011A1 }, + { "Africa/El_Aaiun" , 0x0011F6 }, + { "Africa/Freetown" , 0x001421 }, + { "Africa/Gaborone" , 0x001476 }, + { "Africa/Harare" , 0x0014CB }, + { "Africa/Johannesburg" , 0x001520 }, + { "Africa/Juba" , 0x00158E }, + { "Africa/Kampala" , 0x0016A1 }, + { "Africa/Khartoum" , 0x001720 }, + { "Africa/Kigali" , 0x001833 }, + { "Africa/Kinshasa" , 0x001888 }, + { "Africa/Lagos" , 0x0018F4 }, + { "Africa/Libreville" , 0x001949 }, + { "Africa/Lome" , 0x00199E }, + { "Africa/Luanda" , 0x0019F3 }, + { "Africa/Lubumbashi" , 0x001A48 }, + { "Africa/Lusaka" , 0x001AB4 }, + { "Africa/Malabo" , 0x001B09 }, + { "Africa/Maputo" , 0x001B5E }, + { "Africa/Maseru" , 0x001BB3 }, + { "Africa/Mbabane" , 0x001C21 }, + { "Africa/Mogadishu" , 0x001C8F }, + { "Africa/Monrovia" , 0x001D0E }, + { "Africa/Nairobi" , 0x001D74 }, + { "Africa/Ndjamena" , 0x001DF3 }, + { "Africa/Niamey" , 0x001E5F }, + { "Africa/Nouakchott" , 0x001EB4 }, + { "Africa/Ouagadougou" , 0x001F09 }, + { "Africa/Porto-Novo" , 0x001F5E }, + { "Africa/Sao_Tome" , 0x001FB3 }, + { "Africa/Timbuktu" , 0x002008 }, + { "Africa/Tripoli" , 0x00205D }, + { "Africa/Tunis" , 0x002166 }, + { "Africa/Windhoek" , 0x002278 }, + { "America/Adak" , 0x0024BF }, + { "America/Anchorage" , 0x002835 }, + { "America/Anguilla" , 0x002BA9 }, + { "America/Antigua" , 0x002BFE }, + { "America/Araguaina" , 0x002C64 }, + { "America/Argentina/Buenos_Aires" , 0x002DC9 }, + { "America/Argentina/Catamarca" , 0x002F77 }, + { "America/Argentina/ComodRivadavia" , 0x003138 }, + { "America/Argentina/Cordoba" , 0x0032DE }, + { "America/Argentina/Jujuy" , 0x0034B3 }, + { "America/Argentina/La_Rioja" , 0x003667 }, + { "America/Argentina/Mendoza" , 0x00381F }, + { "America/Argentina/Rio_Gallegos" , 0x0039DF }, + { "America/Argentina/Salta" , 0x003B94 }, + { "America/Argentina/San_Juan" , 0x003D40 }, + { "America/Argentina/San_Luis" , 0x003EF8 }, + { "America/Argentina/Tucuman" , 0x0040BE }, + { "America/Argentina/Ushuaia" , 0x00427A }, + { "America/Aruba" , 0x004435 }, + { "America/Asuncion" , 0x00449B }, + { "America/Atikokan" , 0x004780 }, + { "America/Atka" , 0x004856 }, + { "America/Bahia" , 0x004BBC }, + { "America/Bahia_Banderas" , 0x004D4F }, + { "America/Barbados" , 0x004FC8 }, + { "America/Belem" , 0x005062 }, + { "America/Belize" , 0x00515D }, + { "America/Blanc-Sablon" , 0x0052D9 }, + { "America/Boa_Vista" , 0x00538D }, + { "America/Bogota" , 0x005496 }, + { "America/Boise" , 0x005502 }, + { "America/Buenos_Aires" , 0x005899 }, + { "America/Cambridge_Bay" , 0x005A32 }, + { "America/Campo_Grande" , 0x005D5A }, + { "America/Cancun" , 0x006049 }, + { "America/Caracas" , 0x00628B }, + { "America/Catamarca" , 0x0062F2 }, + { "America/Cayenne" , 0x006498 }, + { "America/Cayman" , 0x0064FA }, + { "America/Chicago" , 0x00654F }, + { "America/Chihuahua" , 0x006A66 }, + { "America/Coral_Harbour" , 0x006CD1 }, + { "America/Cordoba" , 0x006D63 }, + { "America/Costa_Rica" , 0x006F09 }, + { "America/Creston" , 0x006F93 }, + { "America/Cuiaba" , 0x00701F }, + { "America/Curacao" , 0x0072FD }, + { "America/Danmarkshavn" , 0x007363 }, + { "America/Dawson" , 0x0074A7 }, + { "America/Dawson_Creek" , 0x0077C4 }, + { "America/Denver" , 0x00799E }, + { "America/Detroit" , 0x007D24 }, + { "America/Dominica" , 0x008083 }, + { "America/Edmonton" , 0x0080D8 }, + { "America/Eirunepe" , 0x008490 }, + { "America/El_Salvador" , 0x0085A8 }, + { "America/Ensenada" , 0x00861D }, + { "America/Fort_Wayne" , 0x008AC4 }, + { "America/Fortaleza" , 0x008986 }, + { "America/Glace_Bay" , 0x008D2E }, + { "America/Godthab" , 0x0090A5 }, + { "America/Goose_Bay" , 0x009369 }, + { "America/Grand_Turk" , 0x009826 }, + { "America/Grenada" , 0x009A05 }, + { "America/Guadeloupe" , 0x009A5A }, + { "America/Guatemala" , 0x009AAF }, + { "America/Guayaquil" , 0x009B38 }, + { "America/Guyana" , 0x009B95 }, + { "America/Halifax" , 0x009C16 }, + { "America/Havana" , 0x00A12C }, + { "America/Hermosillo" , 0x00A49F }, + { "America/Indiana/Indianapolis" , 0x00A57D }, + { "America/Indiana/Knox" , 0x00A80E }, + { "America/Indiana/Marengo" , 0x00ABA5 }, + { "America/Indiana/Petersburg" , 0x00AE4B }, + { "America/Indiana/Tell_City" , 0x00B398 }, + { "America/Indiana/Vevay" , 0x00B631 }, + { "America/Indiana/Vincennes" , 0x00B86C }, + { "America/Indiana/Winamac" , 0x00BB20 }, + { "America/Indianapolis" , 0x00B12E }, + { "America/Inuvik" , 0x00BDD9 }, + { "America/Iqaluit" , 0x00C0D0 }, + { "America/Jamaica" , 0x00C3F2 }, + { "America/Jujuy" , 0x00C4B7 }, + { "America/Juneau" , 0x00C661 }, + { "America/Kentucky/Louisville" , 0x00C9DF }, + { "America/Kentucky/Monticello" , 0x00CDFD }, + { "America/Knox_IN" , 0x00D182 }, + { "America/Kralendijk" , 0x00D4F3 }, + { "America/La_Paz" , 0x00D559 }, + { "America/Lima" , 0x00D5C0 }, + { "America/Los_Angeles" , 0x00D668 }, + { "America/Louisville" , 0x00DA79 }, + { "America/Lower_Princes" , 0x00DE6E }, + { "America/Maceio" , 0x00DED4 }, + { "America/Managua" , 0x00E00E }, + { "America/Manaus" , 0x00E0C1 }, + { "America/Marigot" , 0x00E1C3 }, + { "America/Martinique" , 0x00E218 }, + { "America/Matamoros" , 0x00E284 }, + { "America/Mazatlan" , 0x00E4DD }, + { "America/Mendoza" , 0x00E74A }, + { "America/Menominee" , 0x00E8FE }, + { "America/Merida" , 0x00EC7F }, + { "America/Metlakatla" , 0x00EEBA }, + { "America/Mexico_City" , 0x00EFF5 }, + { "America/Miquelon" , 0x00F270 }, + { "America/Moncton" , 0x00F4E2 }, + { "America/Monterrey" , 0x00F979 }, + { "America/Montevideo" , 0x00FBDC }, + { "America/Montreal" , 0x00FEEE }, + { "America/Montserrat" , 0x0103DE }, + { "America/Nassau" , 0x010433 }, + { "America/New_York" , 0x010778 }, + { "America/Nipigon" , 0x010C83 }, + { "America/Nome" , 0x010FD4 }, + { "America/Noronha" , 0x011352 }, + { "America/North_Dakota/Beulah" , 0x011482 }, + { "America/North_Dakota/Center" , 0x011816 }, + { "America/North_Dakota/New_Salem" , 0x011BAA }, + { "America/Ojinaga" , 0x011F53 }, + { "America/Panama" , 0x0121B4 }, + { "America/Pangnirtung" , 0x012209 }, + { "America/Paramaribo" , 0x01253F }, + { "America/Phoenix" , 0x0125D1 }, + { "America/Port-au-Prince" , 0x01268F }, + { "America/Port_of_Spain" , 0x0129B3 }, + { "America/Porto_Acre" , 0x0128AF }, + { "America/Porto_Velho" , 0x012A08 }, + { "America/Puerto_Rico" , 0x012AFE }, + { "America/Rainy_River" , 0x012B69 }, + { "America/Rankin_Inlet" , 0x012EA1 }, + { "America/Recife" , 0x013187 }, + { "America/Regina" , 0x0132B1 }, + { "America/Resolute" , 0x01346F }, + { "America/Rio_Branco" , 0x013757 }, + { "America/Rosario" , 0x01385F }, + { "America/Santa_Isabel" , 0x013A05 }, + { "America/Santarem" , 0x013DA8 }, + { "America/Santiago" , 0x013EAD }, + { "America/Santo_Domingo" , 0x014256 }, + { "America/Sao_Paulo" , 0x01431C }, + { "America/Scoresbysund" , 0x01462B }, + { "America/Shiprock" , 0x014919 }, + { "America/Sitka" , 0x014C92 }, + { "America/St_Barthelemy" , 0x01501A }, + { "America/St_Johns" , 0x01506F }, + { "America/St_Kitts" , 0x0155C2 }, + { "America/St_Lucia" , 0x015617 }, + { "America/St_Thomas" , 0x01566C }, + { "America/St_Vincent" , 0x0156C1 }, + { "America/Swift_Current" , 0x015716 }, + { "America/Tegucigalpa" , 0x015837 }, + { "America/Thule" , 0x0158B6 }, + { "America/Thunder_Bay" , 0x015AFD }, + { "America/Tijuana" , 0x015E46 }, + { "America/Toronto" , 0x0161DF }, + { "America/Tortola" , 0x0166FF }, + { "America/Vancouver" , 0x016754 }, + { "America/Virgin" , 0x016B91 }, + { "America/Whitehorse" , 0x016BE6 }, + { "America/Winnipeg" , 0x016F03 }, + { "America/Yakutat" , 0x017343 }, + { "America/Yellowknife" , 0x0176AE }, + { "Antarctica/Casey" , 0x0179BE }, + { "Antarctica/Davis" , 0x017A5C }, + { "Antarctica/DumontDUrville" , 0x017AFD }, + { "Antarctica/Macquarie" , 0x017B8E }, + { "Antarctica/Mawson" , 0x017DDB }, + { "Antarctica/McMurdo" , 0x017E57 }, + { "Antarctica/Palmer" , 0x018202 }, + { "Antarctica/Rothera" , 0x01851E }, + { "Antarctica/South_Pole" , 0x018594 }, + { "Antarctica/Syowa" , 0x018912 }, + { "Antarctica/Troll" , 0x018980 }, + { "Antarctica/Vostok" , 0x018B52 }, + { "Arctic/Longyearbyen" , 0x018BC3 }, + { "Asia/Aden" , 0x018EF5 }, + { "Asia/Almaty" , 0x018F4A }, + { "Asia/Amman" , 0x0190C9 }, + { "Asia/Anadyr" , 0x01937F }, + { "Asia/Aqtau" , 0x019581 }, + { "Asia/Aqtobe" , 0x019780 }, + { "Asia/Ashgabat" , 0x019938 }, + { "Asia/Ashkhabad" , 0x019A55 }, + { "Asia/Baghdad" , 0x019B72 }, + { "Asia/Bahrain" , 0x019CE7 }, + { "Asia/Baku" , 0x019D4D }, + { "Asia/Bangkok" , 0x01A035 }, + { "Asia/Beirut" , 0x01A08A }, + { "Asia/Bishkek" , 0x01A397 }, + { "Asia/Brunei" , 0x01A543 }, + { "Asia/Calcutta" , 0x01A5A5 }, + { "Asia/Chita" , 0x01A61E }, + { "Asia/Choibalsan" , 0x01A833 }, + { "Asia/Chongqing" , 0x01A9AC }, + { "Asia/Chungking" , 0x01AA4C }, + { "Asia/Colombo" , 0x01AAEC }, + { "Asia/Dacca" , 0x01AB88 }, + { "Asia/Damascus" , 0x01AC2E }, + { "Asia/Dhaka" , 0x01AF7E }, + { "Asia/Dili" , 0x01B024 }, + { "Asia/Dubai" , 0x01B0AE }, + { "Asia/Dushanbe" , 0x01B103 }, + { "Asia/Gaza" , 0x01B206 }, + { "Asia/Harbin" , 0x01B559 }, + { "Asia/Hebron" , 0x01B5F9 }, + { "Asia/Ho_Chi_Minh" , 0x01B955 }, + { "Asia/Hong_Kong" , 0x01B9F7 }, + { "Asia/Hovd" , 0x01BBB9 }, + { "Asia/Irkutsk" , 0x01BD31 }, + { "Asia/Istanbul" , 0x01BF1C }, + { "Asia/Jakarta" , 0x01C309 }, + { "Asia/Jayapura" , 0x01C3B3 }, + { "Asia/Jerusalem" , 0x01C450 }, + { "Asia/Kabul" , 0x01C77F }, + { "Asia/Kamchatka" , 0x01C7D0 }, + { "Asia/Karachi" , 0x01C9C9 }, + { "Asia/Kashgar" , 0x01CA7E }, + { "Asia/Kathmandu" , 0x01CAD3 }, + { "Asia/Katmandu" , 0x01CB39 }, + { "Asia/Khandyga" , 0x01CB9F }, + { "Asia/Kolkata" , 0x01CDC9 }, + { "Asia/Krasnoyarsk" , 0x01CE42 }, + { "Asia/Kuala_Lumpur" , 0x01D02F }, + { "Asia/Kuching" , 0x01D0EC }, + { "Asia/Kuwait" , 0x01D1DA }, + { "Asia/Macao" , 0x01D22F }, + { "Asia/Macau" , 0x01D36A }, + { "Asia/Magadan" , 0x01D4A5 }, + { "Asia/Makassar" , 0x01D6A9 }, + { "Asia/Manila" , 0x01D76E }, + { "Asia/Muscat" , 0x01D7F3 }, + { "Asia/Nicosia" , 0x01D848 }, + { "Asia/Novokuznetsk" , 0x01DB30 }, + { "Asia/Novosibirsk" , 0x01DD50 }, + { "Asia/Omsk" , 0x01DF40 }, + { "Asia/Oral" , 0x01E12C }, + { "Asia/Phnom_Penh" , 0x01E2FC }, + { "Asia/Pontianak" , 0x01E351 }, + { "Asia/Pyongyang" , 0x01E413 }, + { "Asia/Qatar" , 0x01E498 }, + { "Asia/Qyzylorda" , 0x01E4FE }, + { "Asia/Rangoon" , 0x01E6D4 }, + { "Asia/Riyadh" , 0x01E74C }, + { "Asia/Saigon" , 0x01E7A1 }, + { "Asia/Sakhalin" , 0x01E843 }, + { "Asia/Samarkand" , 0x01EA40 }, + { "Asia/Seoul" , 0x01EB76 }, + { "Asia/Shanghai" , 0x01EC69 }, + { "Asia/Singapore" , 0x01ED15 }, + { "Asia/Srednekolymsk" , 0x01EDCC }, + { "Asia/Taipei" , 0x01EFCC }, + { "Asia/Tashkent" , 0x01F0FD }, + { "Asia/Tbilisi" , 0x01F22E }, + { "Asia/Tehran" , 0x01F3E8 }, + { "Asia/Tel_Aviv" , 0x01F656 }, + { "Asia/Thimbu" , 0x01F985 }, + { "Asia/Thimphu" , 0x01F9EB }, + { "Asia/Tokyo" , 0x01FA51 }, + { "Asia/Ujung_Pandang" , 0x01FADB }, + { "Asia/Ulaanbaatar" , 0x01FB58 }, + { "Asia/Ulan_Bator" , 0x01FCB3 }, + { "Asia/Urumqi" , 0x01FE00 }, + { "Asia/Ust-Nera" , 0x01FE62 }, + { "Asia/Vientiane" , 0x020074 }, + { "Asia/Vladivostok" , 0x0200C9 }, + { "Asia/Yakutsk" , 0x0202B3 }, + { "Asia/Yekaterinburg" , 0x02049D }, + { "Asia/Yerevan" , 0x0206BE }, + { "Atlantic/Azores" , 0x0208BE }, + { "Atlantic/Bermuda" , 0x020DC1 }, + { "Atlantic/Canary" , 0x0210A2 }, + { "Atlantic/Cape_Verde" , 0x021378 }, + { "Atlantic/Faeroe" , 0x0213F1 }, + { "Atlantic/Faroe" , 0x021695 }, + { "Atlantic/Jan_Mayen" , 0x021939 }, + { "Atlantic/Madeira" , 0x021C6B }, + { "Atlantic/Reykjavik" , 0x022174 }, + { "Atlantic/South_Georgia" , 0x02232D }, + { "Atlantic/St_Helena" , 0x02253F }, + { "Atlantic/Stanley" , 0x022371 }, + { "Australia/ACT" , 0x022594 }, + { "Australia/Adelaide" , 0x0228B7 }, + { "Australia/Brisbane" , 0x022BE9 }, + { "Australia/Broken_Hill" , 0x022CB6 }, + { "Australia/Canberra" , 0x022FFA }, + { "Australia/Currie" , 0x02331D }, + { "Australia/Darwin" , 0x023656 }, + { "Australia/Eucla" , 0x0236E2 }, + { "Australia/Hobart" , 0x0237BE }, + { "Australia/LHI" , 0x023B22 }, + { "Australia/Lindeman" , 0x023DC3 }, + { "Australia/Lord_Howe" , 0x023EAA }, + { "Australia/Melbourne" , 0x02415B }, + { "Australia/North" , 0x024486 }, + { "Australia/NSW" , 0x024500 }, + { "Australia/Perth" , 0x024823 }, + { "Australia/Queensland" , 0x024901 }, + { "Australia/South" , 0x0249B3 }, + { "Australia/Sydney" , 0x024CD6 }, + { "Australia/Tasmania" , 0x025019 }, + { "Australia/Victoria" , 0x025364 }, + { "Australia/West" , 0x025687 }, + { "Australia/Yancowinna" , 0x025743 }, + { "Brazil/Acre" , 0x025A6B }, + { "Brazil/DeNoronha" , 0x025B6F }, + { "Brazil/East" , 0x025C8F }, + { "Brazil/West" , 0x025F6C }, + { "Canada/Atlantic" , 0x026064 }, + { "Canada/Central" , 0x02654C }, + { "Canada/East-Saskatchewan" , 0x026E56 }, + { "Canada/Eastern" , 0x026966 }, + { "Canada/Mountain" , 0x026FDF }, + { "Canada/Newfoundland" , 0x027355 }, + { "Canada/Pacific" , 0x027880 }, + { "Canada/Saskatchewan" , 0x027C99 }, + { "Canada/Yukon" , 0x027E22 }, + { "CET" , 0x028125 }, + { "Chile/Continental" , 0x02842E }, + { "Chile/EasterIsland" , 0x0287C9 }, + { "CST6CDT" , 0x028B0B }, + { "Cuba" , 0x028E5C }, + { "EET" , 0x0291CF }, + { "Egypt" , 0x029482 }, + { "Eire" , 0x029869 }, + { "EST" , 0x029D7A }, + { "EST5EDT" , 0x029DBE }, + { "Etc/GMT" , 0x02A10F }, + { "Etc/GMT+0" , 0x02A1DB }, + { "Etc/GMT+1" , 0x02A265 }, + { "Etc/GMT+10" , 0x02A2F2 }, + { "Etc/GMT+11" , 0x02A380 }, + { "Etc/GMT+12" , 0x02A40E }, + { "Etc/GMT+2" , 0x02A529 }, + { "Etc/GMT+3" , 0x02A5B5 }, + { "Etc/GMT+4" , 0x02A641 }, + { "Etc/GMT+5" , 0x02A6CD }, + { "Etc/GMT+6" , 0x02A759 }, + { "Etc/GMT+7" , 0x02A7E5 }, + { "Etc/GMT+8" , 0x02A871 }, + { "Etc/GMT+9" , 0x02A8FD }, + { "Etc/GMT-0" , 0x02A197 }, + { "Etc/GMT-1" , 0x02A21F }, + { "Etc/GMT-10" , 0x02A2AB }, + { "Etc/GMT-11" , 0x02A339 }, + { "Etc/GMT-12" , 0x02A3C7 }, + { "Etc/GMT-13" , 0x02A455 }, + { "Etc/GMT-14" , 0x02A49C }, + { "Etc/GMT-2" , 0x02A4E3 }, + { "Etc/GMT-3" , 0x02A56F }, + { "Etc/GMT-4" , 0x02A5FB }, + { "Etc/GMT-5" , 0x02A687 }, + { "Etc/GMT-6" , 0x02A713 }, + { "Etc/GMT-7" , 0x02A79F }, + { "Etc/GMT-8" , 0x02A82B }, + { "Etc/GMT-9" , 0x02A8B7 }, + { "Etc/GMT0" , 0x02A153 }, + { "Etc/Greenwich" , 0x02A943 }, + { "Etc/UCT" , 0x02A987 }, + { "Etc/Universal" , 0x02A9CB }, + { "Etc/UTC" , 0x02AA0F }, + { "Etc/Zulu" , 0x02AA53 }, + { "Europe/Amsterdam" , 0x02AA97 }, + { "Europe/Andorra" , 0x02AED5 }, + { "Europe/Athens" , 0x02B151 }, + { "Europe/Belfast" , 0x02B494 }, + { "Europe/Belgrade" , 0x02B9CB }, + { "Europe/Berlin" , 0x02BC94 }, + { "Europe/Bratislava" , 0x02BFF8 }, + { "Europe/Brussels" , 0x02C32A }, + { "Europe/Bucharest" , 0x02C761 }, + { "Europe/Budapest" , 0x02CA8B }, + { "Europe/Busingen" , 0x02CDF4 }, + { "Europe/Chisinau" , 0x02D0AB }, + { "Europe/Copenhagen" , 0x02D439 }, + { "Europe/Dublin" , 0x02D743 }, + { "Europe/Gibraltar" , 0x02DC54 }, + { "Europe/Guernsey" , 0x02E0AB }, + { "Europe/Helsinki" , 0x02E5E2 }, + { "Europe/Isle_of_Man" , 0x02E898 }, + { "Europe/Istanbul" , 0x02EDCF }, + { "Europe/Jersey" , 0x02F1BC }, + { "Europe/Kaliningrad" , 0x02F6F3 }, + { "Europe/Kiev" , 0x02F95E }, + { "Europe/Lisbon" , 0x02FC7A }, + { "Europe/Ljubljana" , 0x03017E }, + { "Europe/London" , 0x030447 }, + { "Europe/Luxembourg" , 0x03097E }, + { "Europe/Madrid" , 0x030DD4 }, + { "Europe/Malta" , 0x03119A }, + { "Europe/Mariehamn" , 0x031553 }, + { "Europe/Minsk" , 0x031809 }, + { "Europe/Monaco" , 0x031A1C }, + { "Europe/Moscow" , 0x031E57 }, + { "Europe/Nicosia" , 0x0320B1 }, + { "Europe/Oslo" , 0x032399 }, + { "Europe/Paris" , 0x0326CB }, + { "Europe/Podgorica" , 0x032B11 }, + { "Europe/Prague" , 0x032DDA }, + { "Europe/Riga" , 0x03310C }, + { "Europe/Rome" , 0x033451 }, + { "Europe/Samara" , 0x033814 }, + { "Europe/San_Marino" , 0x033A7D }, + { "Europe/Sarajevo" , 0x033E40 }, + { "Europe/Simferopol" , 0x034109 }, + { "Europe/Skopje" , 0x03435A }, + { "Europe/Sofia" , 0x034623 }, + { "Europe/Stockholm" , 0x03492B }, + { "Europe/Tallinn" , 0x034BDA }, + { "Europe/Tirane" , 0x034F14 }, + { "Europe/Tiraspol" , 0x03521A }, + { "Europe/Uzhgorod" , 0x0355A8 }, + { "Europe/Vaduz" , 0x0358BF }, + { "Europe/Vatican" , 0x035B6E }, + { "Europe/Vienna" , 0x035F31 }, + { "Europe/Vilnius" , 0x03625E }, + { "Europe/Volgograd" , 0x03659D }, + { "Europe/Warsaw" , 0x0367BE }, + { "Europe/Zagreb" , 0x036B9F }, + { "Europe/Zaporozhye" , 0x036E68 }, + { "Europe/Zurich" , 0x0371A9 }, + { "Factory" , 0x037458 }, + { "GB" , 0x0374C9 }, + { "GB-Eire" , 0x037A00 }, + { "GMT" , 0x037F37 }, + { "GMT+0" , 0x038003 }, + { "GMT-0" , 0x037FBF }, + { "GMT0" , 0x037F7B }, + { "Greenwich" , 0x038047 }, + { "Hongkong" , 0x03808B }, + { "HST" , 0x03824D }, + { "Iceland" , 0x038291 }, + { "Indian/Antananarivo" , 0x03844A }, + { "Indian/Chagos" , 0x0384C9 }, + { "Indian/Christmas" , 0x03852B }, + { "Indian/Cocos" , 0x03856F }, + { "Indian/Comoro" , 0x0385B3 }, + { "Indian/Kerguelen" , 0x038632 }, + { "Indian/Mahe" , 0x038687 }, + { "Indian/Maldives" , 0x0386DC }, + { "Indian/Mauritius" , 0x038731 }, + { "Indian/Mayotte" , 0x0387A7 }, + { "Indian/Reunion" , 0x038826 }, + { "Iran" , 0x03887B }, + { "Israel" , 0x038AE9 }, + { "Jamaica" , 0x038E18 }, + { "Japan" , 0x038EDD }, + { "Kwajalein" , 0x038F67 }, + { "Libya" , 0x038FCA }, + { "MET" , 0x0390D3 }, + { "Mexico/BajaNorte" , 0x0393DC }, + { "Mexico/BajaSur" , 0x039745 }, + { "Mexico/General" , 0x03998A }, + { "MST" , 0x039BE8 }, + { "MST7MDT" , 0x039C2C }, + { "Navajo" , 0x039F7D }, + { "NZ" , 0x03A2F6 }, + { "NZ-CHAT" , 0x03A674 }, + { "Pacific/Apia" , 0x03A958 }, + { "Pacific/Auckland" , 0x03AAF4 }, + { "Pacific/Bougainville" , 0x03AE80 }, + { "Pacific/Chatham" , 0x03AEF7 }, + { "Pacific/Chuuk" , 0x03B1EA }, + { "Pacific/Easter" , 0x03B243 }, + { "Pacific/Efate" , 0x03B592 }, + { "Pacific/Enderbury" , 0x03B658 }, + { "Pacific/Fakaofo" , 0x03B6C6 }, + { "Pacific/Fiji" , 0x03B717 }, + { "Pacific/Funafuti" , 0x03B8AA }, + { "Pacific/Galapagos" , 0x03B8EE }, + { "Pacific/Gambier" , 0x03B966 }, + { "Pacific/Guadalcanal" , 0x03B9CB }, + { "Pacific/Guam" , 0x03BA20 }, + { "Pacific/Honolulu" , 0x03BA76 }, + { "Pacific/Johnston" , 0x03BAED }, + { "Pacific/Kiritimati" , 0x03BB6C }, + { "Pacific/Kosrae" , 0x03BBD7 }, + { "Pacific/Kwajalein" , 0x03BC34 }, + { "Pacific/Majuro" , 0x03BCA0 }, + { "Pacific/Marquesas" , 0x03BCFF }, + { "Pacific/Midway" , 0x03BD66 }, + { "Pacific/Nauru" , 0x03BDF0 }, + { "Pacific/Niue" , 0x03BE68 }, + { "Pacific/Norfolk" , 0x03BEC6 }, + { "Pacific/Noumea" , 0x03BF1B }, + { "Pacific/Pago_Pago" , 0x03BFAB }, + { "Pacific/Palau" , 0x03C022 }, + { "Pacific/Pitcairn" , 0x03C066 }, + { "Pacific/Pohnpei" , 0x03C0BB }, + { "Pacific/Ponape" , 0x03C110 }, + { "Pacific/Port_Moresby" , 0x03C155 }, + { "Pacific/Rarotonga" , 0x03C1A7 }, + { "Pacific/Saipan" , 0x03C283 }, + { "Pacific/Samoa" , 0x03C2E6 }, + { "Pacific/Tahiti" , 0x03C35D }, + { "Pacific/Tarawa" , 0x03C3C2 }, + { "Pacific/Tongatapu" , 0x03C416 }, + { "Pacific/Truk" , 0x03C4A2 }, + { "Pacific/Wake" , 0x03C4E7 }, + { "Pacific/Wallis" , 0x03C537 }, + { "Pacific/Yap" , 0x03C57B }, + { "Poland" , 0x03C5C0 }, + { "Portugal" , 0x03C9A1 }, + { "PRC" , 0x03CE9D }, + { "PST8PDT" , 0x03CF3D }, + { "ROC" , 0x03D28E }, + { "ROK" , 0x03D3BF }, + { "Singapore" , 0x03D4B2 }, + { "Turkey" , 0x03D569 }, + { "UCT" , 0x03D956 }, + { "Universal" , 0x03D99A }, + { "US/Alaska" , 0x03D9DE }, + { "US/Aleutian" , 0x03DD47 }, + { "US/Arizona" , 0x03E0AD }, + { "US/Central" , 0x03E13B }, + { "US/East-Indiana" , 0x03EB45 }, + { "US/Eastern" , 0x03E646 }, + { "US/Hawaii" , 0x03EDAF }, + { "US/Indiana-Starke" , 0x03EE20 }, + { "US/Michigan" , 0x03F191 }, + { "US/Mountain" , 0x03F4C8 }, + { "US/Pacific" , 0x03F841 }, + { "US/Pacific-New" , 0x03FC46 }, + { "US/Samoa" , 0x04004B }, + { "UTC" , 0x0400C2 }, + { "W-SU" , 0x0403B9 }, + { "WET" , 0x040106 }, + { "Zulu" , 0x0405FC }, }; /* This is a generated file, do not modify */ -const unsigned char timelib_timezone_db_data_builtin[263343] = { +const unsigned char timelib_timezone_db_data_builtin[263744] = { /* Africa/Abidjan */ @@ -620,11 +620,13 @@ const unsigned char timelib_timezone_db_data_builtin[263343] = { /* Africa/Addis_Ababa */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x45, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x09, 0xC0, 0xAF, 0xF2, 0x98, -0x01, 0x00, 0x00, 0x24, 0x68, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x05, 0x41, 0x44, 0x4D, -0x54, 0x00, 0x45, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x97, 0x1C, 0xE5, 0x01, 0x4D, -0xB5, 0xB0, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x13, 0xB1, 0xEE, 0xDA, 0xFC, +0xB4, 0xC2, 0x9A, 0xD0, 0xC7, 0x91, 0x47, 0xD8, 0xED, 0x2F, 0xE1, 0xD4, 0x01, 0x02, 0x03, 0x01, +0x00, 0x00, 0x22, 0x84, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x00, 0x00, 0x23, 0x28, +0x00, 0x08, 0x00, 0x00, 0x26, 0xAC, 0x00, 0x0D, 0x4C, 0x4D, 0x54, 0x00, 0x45, 0x41, 0x54, 0x00, +0x42, 0x45, 0x41, 0x54, 0x00, 0x42, 0x45, 0x41, 0x55, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x97, 0x1C, 0xE5, 0x01, 0x4D, 0xB5, 0xB0, 0x00, 0x00, 0x00, 0x00, /* Africa/Algiers */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x44, 0x5A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -649,19 +651,23 @@ const unsigned char timelib_timezone_db_data_builtin[263343] = { /* Africa/Asmara */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x45, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x09, 0xC0, 0xAF, 0xF2, 0x98, -0x01, 0x00, 0x00, 0x24, 0x68, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x05, 0x41, 0x44, 0x4D, -0x54, 0x00, 0x45, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xA0, 0xB9, 0xD5, 0x01, 0x4D, -0xFD, 0x4D, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x13, 0xB1, 0xEE, 0xDA, 0xFC, +0xB4, 0xC2, 0x9A, 0xD0, 0xC7, 0x91, 0x47, 0xD8, 0xED, 0x2F, 0xE1, 0xD4, 0x01, 0x02, 0x03, 0x01, +0x00, 0x00, 0x22, 0x84, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x00, 0x00, 0x23, 0x28, +0x00, 0x08, 0x00, 0x00, 0x26, 0xAC, 0x00, 0x0D, 0x4C, 0x4D, 0x54, 0x00, 0x45, 0x41, 0x54, 0x00, +0x42, 0x45, 0x41, 0x54, 0x00, 0x42, 0x45, 0x41, 0x55, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0xA0, 0xB9, 0xD5, 0x01, 0x4D, 0xFD, 0x4D, 0x00, 0x00, 0x00, 0x00, /* Africa/Asmera */ 0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x09, 0xC0, 0xAF, 0xF2, 0x98, -0x01, 0x00, 0x00, 0x24, 0x68, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x05, 0x41, 0x44, 0x4D, -0x54, 0x00, 0x45, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, -0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x13, 0xB1, 0xEE, 0xDA, 0xFC, +0xB4, 0xC2, 0x9A, 0xD0, 0xC7, 0x91, 0x47, 0xD8, 0xED, 0x2F, 0xE1, 0xD4, 0x01, 0x02, 0x03, 0x01, +0x00, 0x00, 0x22, 0x84, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x00, 0x00, 0x23, 0x28, +0x00, 0x08, 0x00, 0x00, 0x26, 0xAC, 0x00, 0x0D, 0x4C, 0x4D, 0x54, 0x00, 0x45, 0x41, 0x54, 0x00, +0x42, 0x45, 0x41, 0x54, 0x00, 0x42, 0x45, 0x41, 0x55, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, /* Africa/Bamako */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x4D, 0x4C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -895,20 +901,23 @@ const unsigned char timelib_timezone_db_data_builtin[263343] = { /* Africa/Dar_es_Salaam */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x54, 0x5A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0E, 0xB6, 0xA3, 0xD3, 0xAC, -0xD6, 0x9D, 0x7F, 0xD0, 0xEF, 0x12, 0x66, 0xD4, 0x01, 0x02, 0x01, 0x00, 0x00, 0x24, 0xD4, 0x00, -0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x00, 0x00, 0x26, 0xAC, 0x00, 0x08, 0x4C, 0x4D, 0x54, -0x00, 0x45, 0x41, 0x54, 0x00, 0x42, 0x45, 0x41, 0x55, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x7E, 0xF4, 0x00, 0x01, 0x4E, 0x99, 0x8D, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x13, 0xB1, 0xEE, 0xDA, 0xFC, +0xB4, 0xC2, 0x9A, 0xD0, 0xC7, 0x91, 0x47, 0xD8, 0xED, 0x2F, 0xE1, 0xD4, 0x01, 0x02, 0x03, 0x01, +0x00, 0x00, 0x22, 0x84, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x00, 0x00, 0x23, 0x28, +0x00, 0x08, 0x00, 0x00, 0x26, 0xAC, 0x00, 0x0D, 0x4C, 0x4D, 0x54, 0x00, 0x45, 0x41, 0x54, 0x00, +0x42, 0x45, 0x41, 0x54, 0x00, 0x42, 0x45, 0x41, 0x55, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x7E, 0xF4, 0x00, 0x01, 0x4E, 0x99, 0x8D, 0x00, 0x00, 0x00, 0x00, /* Africa/Djibouti */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x44, 0x4A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x91, 0xF3, 0xD2, 0x0C, -0x01, 0x00, 0x00, 0x28, 0x74, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x4C, 0x4D, 0x54, -0x00, 0x45, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9B, 0x07, 0x80, 0x01, 0x54, 0x7F, -0xF8, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x13, 0xB1, 0xEE, 0xDA, 0xFC, +0xB4, 0xC2, 0x9A, 0xD0, 0xC7, 0x91, 0x47, 0xD8, 0xED, 0x2F, 0xE1, 0xD4, 0x01, 0x02, 0x03, 0x01, +0x00, 0x00, 0x22, 0x84, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x00, 0x00, 0x23, 0x28, +0x00, 0x08, 0x00, 0x00, 0x26, 0xAC, 0x00, 0x0D, 0x4C, 0x4D, 0x54, 0x00, 0x45, 0x41, 0x54, 0x00, +0x42, 0x45, 0x41, 0x54, 0x00, 0x42, 0x45, 0x41, 0x55, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x9B, 0x07, 0x80, 0x01, 0x54, 0x7F, 0xF8, 0x00, 0x00, 0x00, 0x00, /* Africa/Douala */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x43, 0x4D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -1011,9 +1020,9 @@ const unsigned char timelib_timezone_db_data_builtin[263343] = { /* Africa/Kampala */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x55, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x13, 0xB1, 0xEE, 0xDF, 0x1C, -0xB4, 0xC2, 0x9A, 0xD0, 0xD6, 0x9D, 0x86, 0xD8, 0xE7, 0x8C, 0x47, 0x54, 0x01, 0x02, 0x03, 0x01, -0x00, 0x00, 0x1E, 0x64, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x00, 0x00, 0x23, 0x28, +0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x13, 0xB1, 0xEE, 0xDA, 0xFC, +0xB4, 0xC2, 0x9A, 0xD0, 0xC7, 0x91, 0x47, 0xD8, 0xED, 0x2F, 0xE1, 0xD4, 0x01, 0x02, 0x03, 0x01, +0x00, 0x00, 0x22, 0x84, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x00, 0x00, 0x23, 0x28, 0x00, 0x08, 0x00, 0x00, 0x26, 0xAC, 0x00, 0x0D, 0x4C, 0x4D, 0x54, 0x00, 0x45, 0x41, 0x54, 0x00, 0x42, 0x45, 0x41, 0x54, 0x00, 0x42, 0x45, 0x41, 0x55, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x89, 0xCF, 0xF2, 0x01, 0x44, 0x1F, 0x42, 0x00, 0x00, 0x00, 0x00, @@ -1140,11 +1149,13 @@ const unsigned char timelib_timezone_db_data_builtin[263343] = { /* Africa/Mogadishu */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x53, 0x4F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x09, 0xB6, 0xA3, 0xCE, 0x50, -0xE7, 0x8C, 0x4A, 0xD8, 0x01, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x00, 0x00, 0x00, 0x23, 0x28, -0x00, 0x04, 0x45, 0x41, 0x54, 0x00, 0x42, 0x45, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x8C, 0x7B, 0x8A, 0x01, 0x57, 0xE1, 0xDA, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x13, 0xB1, 0xEE, 0xDA, 0xFC, +0xB4, 0xC2, 0x9A, 0xD0, 0xC7, 0x91, 0x47, 0xD8, 0xED, 0x2F, 0xE1, 0xD4, 0x01, 0x02, 0x03, 0x01, +0x00, 0x00, 0x22, 0x84, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x00, 0x00, 0x23, 0x28, +0x00, 0x08, 0x00, 0x00, 0x26, 0xAC, 0x00, 0x0D, 0x4C, 0x4D, 0x54, 0x00, 0x45, 0x41, 0x54, 0x00, +0x42, 0x45, 0x41, 0x54, 0x00, 0x42, 0x45, 0x41, 0x55, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x8C, 0x7B, 0x8A, 0x01, 0x57, 0xE1, 0xDA, 0x00, 0x00, 0x00, 0x00, /* Africa/Monrovia */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x4C, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -3306,7 +3317,7 @@ const unsigned char timelib_timezone_db_data_builtin[263343] = { /* America/Grand_Turk */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x54, 0x43, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x49, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0x93, 0x0F, 0xB4, 0xFF, +0x00, 0x00, 0x00, 0x4B, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0x93, 0x0F, 0xB4, 0xFF, 0x11, 0x89, 0x65, 0xF0, 0x12, 0x79, 0x48, 0xE0, 0x13, 0x69, 0x47, 0xF0, 0x14, 0x59, 0x2A, 0xE0, 0x15, 0x49, 0x29, 0xF0, 0x16, 0x39, 0x0C, 0xE0, 0x17, 0x29, 0x0B, 0xF0, 0x18, 0x22, 0x29, 0x60, 0x19, 0x08, 0xED, 0xF0, 0x1A, 0x02, 0x0B, 0x60, 0x1A, 0xF2, 0x0A, 0x70, 0x1B, 0xE1, 0xED, 0x60, @@ -3325,15 +3336,15 @@ const unsigned char timelib_timezone_db_data_builtin[263343] = { 0x49, 0xB3, 0x6C, 0xF0, 0x4A, 0xED, 0x23, 0xE0, 0x4B, 0x9C, 0x89, 0x70, 0x4C, 0xD6, 0x40, 0x60, 0x4D, 0x7C, 0x6B, 0x70, 0x4E, 0xB6, 0x22, 0x60, 0x4F, 0x5C, 0x4D, 0x70, 0x50, 0x96, 0x04, 0x60, 0x51, 0x3C, 0x2F, 0x70, 0x52, 0x75, 0xE6, 0x60, 0x53, 0x1C, 0x11, 0x70, 0x54, 0x55, 0xC8, 0x60, +0x54, 0xFB, 0xF3, 0x70, 0x56, 0x35, 0xAA, 0x60, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03, 0xFF, 0xFF, 0xB8, 0x01, 0x00, 0x00, 0xFF, -0xFF, 0xB9, 0xB0, 0x00, 0x04, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x08, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, -0x0C, 0x4B, 0x4D, 0x54, 0x00, 0x45, 0x53, 0x54, 0x00, 0x45, 0x44, 0x54, 0x00, 0x41, 0x53, 0x54, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xAA, 0x15, 0xAA, 0x00, 0xA6, 0x1E, -0x0A, 0x00, 0x00, 0x00, 0x00, +0x01, 0x02, 0x03, 0xFF, 0xFF, 0xB8, 0x01, 0x00, 0x00, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x04, 0xFF, +0xFF, 0xC7, 0xC0, 0x01, 0x08, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x0C, 0x4B, 0x4D, 0x54, 0x00, 0x45, +0x53, 0x54, 0x00, 0x45, 0x44, 0x54, 0x00, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0xAA, 0x15, 0xAA, 0x00, 0xA6, 0x1E, 0x0A, 0x00, 0x00, 0x00, 0x00, /* America/Grenada */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x47, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -9074,14 +9085,13 @@ const unsigned char timelib_timezone_db_data_builtin[263343] = { /* Asia/Pyongyang */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x4B, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x0D, 0x85, 0x93, 0x7E, 0x78, -0xB0, 0xFE, 0x8D, 0xF0, 0xB8, 0x84, 0xB4, 0x78, 0xC3, 0x55, 0x3B, 0x70, 0xD2, 0x2F, 0x61, 0x70, -0xE2, 0x4F, 0x29, 0xF0, 0xF0, 0x35, 0x78, 0x80, 0x01, 0x00, 0x01, 0x02, 0x03, 0x04, 0x03, 0x00, -0x00, 0x77, 0x88, 0x00, 0x00, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x04, 0x00, 0x00, 0x7E, 0x90, 0x00, -0x09, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x00, 0x00, 0x00, 0x70, 0x80, 0x00, 0x00, 0x4B, 0x53, 0x54, -0x00, 0x4A, 0x43, 0x53, 0x54, 0x00, 0x4A, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0xC4, 0xDD, 0x22, 0x01, 0xD2, 0x89, 0x98, 0x00, 0x00, 0x00, 0x00, - +0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x11, 0x8B, 0xD7, 0xF1, 0x9C, +0x92, 0xE6, 0x16, 0xF8, 0xC3, 0x55, 0x3B, 0x70, 0xD2, 0x2F, 0x61, 0x70, 0x01, 0x02, 0x03, 0x04, +0x00, 0x00, 0x75, 0xE4, 0x00, 0x00, 0x00, 0x00, 0x77, 0x88, 0x00, 0x04, 0x00, 0x00, 0x7E, 0x90, +0x00, 0x08, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x0D, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x04, 0x4C, 0x4D, +0x54, 0x00, 0x4B, 0x53, 0x54, 0x00, 0x4A, 0x43, 0x53, 0x54, 0x00, 0x4A, 0x53, 0x54, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC4, 0xDD, 0x22, 0x01, 0xD2, 0x89, +0x98, 0x00, 0x00, 0x00, 0x00, /* Asia/Qatar */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x51, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -9214,17 +9224,20 @@ const unsigned char timelib_timezone_db_data_builtin[263343] = { /* Asia/Seoul */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x4B, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x11, 0x85, 0x93, 0x7E, 0x78, -0xB0, 0xFE, 0x8D, 0xF0, 0xB8, 0x84, 0xB4, 0x78, 0xC3, 0x55, 0x3B, 0x70, 0xD2, 0x43, 0x27, 0xF0, -0xE2, 0x4F, 0x29, 0xF0, 0xED, 0xE1, 0x92, 0x80, 0xEE, 0x81, 0x09, 0xF0, 0xF0, 0x35, 0x78, 0x80, -0xFD, 0xA5, 0x0A, 0xF8, 0x20, 0xA3, 0x44, 0x70, 0x21, 0x6E, 0x3D, 0x60, 0x22, 0x83, 0x26, 0x70, -0x23, 0x4E, 0x1F, 0x60, 0x01, 0x00, 0x01, 0x02, 0x03, 0x05, 0x04, 0x05, 0x00, 0x03, 0x06, 0x03, -0x06, 0x03, 0x00, 0x00, 0x77, 0x88, 0x00, 0x00, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x04, 0x00, 0x00, -0x7E, 0x90, 0x00, 0x09, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x00, 0x00, 0x00, 0x7E, 0x90, 0x01, 0x0D, -0x00, 0x00, 0x70, 0x80, 0x00, 0x00, 0x00, 0x00, 0x8C, 0xA0, 0x01, 0x0D, 0x4B, 0x53, 0x54, 0x00, -0x4A, 0x43, 0x53, 0x54, 0x00, 0x4A, 0x53, 0x54, 0x00, 0x4B, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC2, 0xA0, 0x38, 0x01, -0xD4, 0x64, 0xDA, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x15, 0x8B, 0xD7, 0xF0, 0x78, +0x92, 0xE6, 0x16, 0xF8, 0xC3, 0x55, 0x3B, 0x70, 0xD2, 0x43, 0x27, 0xF0, 0xE2, 0x4F, 0x29, 0xF0, +0xE4, 0x6B, 0xB7, 0xF8, 0xE5, 0x13, 0x18, 0x68, 0xE6, 0x62, 0x03, 0x78, 0xE7, 0x11, 0x4C, 0xE8, +0xE8, 0x2F, 0x70, 0x78, 0xE8, 0xE7, 0xF4, 0x68, 0xEA, 0x0F, 0x52, 0x78, 0xEA, 0xC7, 0xD6, 0x68, +0xEB, 0xEF, 0x34, 0x78, 0xEC, 0xA7, 0xB8, 0x68, 0xED, 0xCF, 0x16, 0x78, 0xEE, 0x87, 0x9A, 0x68, +0xF0, 0x35, 0x71, 0x78, 0x20, 0xA3, 0x60, 0x90, 0x21, 0x6E, 0x67, 0x90, 0x22, 0x83, 0x42, 0x90, +0x23, 0x4E, 0x49, 0x90, 0x01, 0x02, 0x03, 0x04, 0x01, 0x05, 0x01, 0x05, 0x01, 0x05, 0x01, 0x05, +0x01, 0x05, 0x01, 0x05, 0x01, 0x04, 0x06, 0x04, 0x06, 0x04, 0x00, 0x00, 0x77, 0x08, 0x00, 0x00, +0x00, 0x00, 0x77, 0x88, 0x00, 0x04, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x08, 0x00, 0x00, 0x7E, 0x90, +0x00, 0x0D, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x04, 0x00, 0x00, 0x85, 0x98, 0x01, 0x11, 0x00, 0x00, +0x8C, 0xA0, 0x01, 0x11, 0x4C, 0x4D, 0x54, 0x00, 0x4B, 0x53, 0x54, 0x00, 0x4A, 0x43, 0x53, 0x54, +0x00, 0x4A, 0x53, 0x54, 0x00, 0x4B, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC2, 0xA0, 0x38, 0x01, 0xD4, 0x64, 0xDA, 0x00, +0x00, 0x00, 0x00, /* Asia/Shanghai */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x43, 0x4E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -16232,12 +16245,12 @@ const unsigned char timelib_timezone_db_data_builtin[263343] = { /* Indian/Antananarivo */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x4D, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0D, 0x91, 0xF3, 0xCD, 0xF4, -0xE2, 0x33, 0xC0, 0xC0, 0xE2, 0xAB, 0xB9, 0x40, 0x01, 0x02, 0x03, 0x00, 0x00, 0x2C, 0x8C, 0x00, -0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x00, 0x00, 0x38, 0x40, 0x01, 0x08, 0x00, 0x00, 0x2A, -0x30, 0x00, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x45, 0x41, 0x54, 0x00, 0x45, 0x41, 0x53, 0x54, 0x00, -0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6C, 0x76, 0xED, 0x01, 0x5B, 0x29, 0xB2, -0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x13, 0xB1, 0xEE, 0xDA, 0xFC, +0xB4, 0xC2, 0x9A, 0xD0, 0xC7, 0x91, 0x47, 0xD8, 0xED, 0x2F, 0xE1, 0xD4, 0x01, 0x02, 0x03, 0x01, +0x00, 0x00, 0x22, 0x84, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x00, 0x00, 0x23, 0x28, +0x00, 0x08, 0x00, 0x00, 0x26, 0xAC, 0x00, 0x0D, 0x4C, 0x4D, 0x54, 0x00, 0x45, 0x41, 0x54, 0x00, +0x42, 0x45, 0x41, 0x54, 0x00, 0x42, 0x45, 0x41, 0x55, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x6C, 0x76, 0xED, 0x01, 0x5B, 0x29, 0xB2, 0x00, 0x00, 0x00, 0x00, /* Indian/Chagos */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x49, 0x4F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -16264,11 +16277,13 @@ const unsigned char timelib_timezone_db_data_builtin[263343] = { /* Indian/Comoro */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x4B, 0x4D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x91, 0xF3, 0xD1, 0xF0, -0x01, 0x00, 0x00, 0x28, 0x90, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x4C, 0x4D, 0x54, -0x00, 0x45, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x77, 0x80, 0x72, 0x01, 0x54, 0xAD, -0x8A, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x13, 0xB1, 0xEE, 0xDA, 0xFC, +0xB4, 0xC2, 0x9A, 0xD0, 0xC7, 0x91, 0x47, 0xD8, 0xED, 0x2F, 0xE1, 0xD4, 0x01, 0x02, 0x03, 0x01, +0x00, 0x00, 0x22, 0x84, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x00, 0x00, 0x23, 0x28, +0x00, 0x08, 0x00, 0x00, 0x26, 0xAC, 0x00, 0x0D, 0x4C, 0x4D, 0x54, 0x00, 0x45, 0x41, 0x54, 0x00, +0x42, 0x45, 0x41, 0x54, 0x00, 0x42, 0x45, 0x41, 0x55, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x77, 0x80, 0x72, 0x01, 0x54, 0xAD, 0x8A, 0x00, 0x00, 0x00, 0x00, /* Indian/Kerguelen */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x54, 0x46, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -16306,11 +16321,13 @@ const unsigned char timelib_timezone_db_data_builtin[263343] = { /* Indian/Mayotte */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x59, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x91, 0xF3, 0xD0, 0x18, -0x01, 0x00, 0x00, 0x2A, 0x68, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x4C, 0x4D, 0x54, -0x00, 0x45, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0xD2, 0xC2, 0x01, 0x57, 0xAD, -0xC5, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x13, 0xB1, 0xEE, 0xDA, 0xFC, +0xB4, 0xC2, 0x9A, 0xD0, 0xC7, 0x91, 0x47, 0xD8, 0xED, 0x2F, 0xE1, 0xD4, 0x01, 0x02, 0x03, 0x01, +0x00, 0x00, 0x22, 0x84, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x00, 0x00, 0x23, 0x28, +0x00, 0x08, 0x00, 0x00, 0x26, 0xAC, 0x00, 0x0D, 0x4C, 0x4D, 0x54, 0x00, 0x45, 0x41, 0x54, 0x00, +0x42, 0x45, 0x41, 0x54, 0x00, 0x42, 0x45, 0x41, 0x55, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x75, 0xD2, 0xC2, 0x01, 0x57, 0xAD, 0xC5, 0x00, 0x00, 0x00, 0x00, /* Indian/Reunion */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x52, 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -17688,17 +17705,20 @@ const unsigned char timelib_timezone_db_data_builtin[263343] = { /* ROK */ 0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x11, 0x85, 0x93, 0x7E, 0x78, -0xB0, 0xFE, 0x8D, 0xF0, 0xB8, 0x84, 0xB4, 0x78, 0xC3, 0x55, 0x3B, 0x70, 0xD2, 0x43, 0x27, 0xF0, -0xE2, 0x4F, 0x29, 0xF0, 0xED, 0xE1, 0x92, 0x80, 0xEE, 0x81, 0x09, 0xF0, 0xF0, 0x35, 0x78, 0x80, -0xFD, 0xA5, 0x0A, 0xF8, 0x20, 0xA3, 0x44, 0x70, 0x21, 0x6E, 0x3D, 0x60, 0x22, 0x83, 0x26, 0x70, -0x23, 0x4E, 0x1F, 0x60, 0x01, 0x00, 0x01, 0x02, 0x03, 0x05, 0x04, 0x05, 0x00, 0x03, 0x06, 0x03, -0x06, 0x03, 0x00, 0x00, 0x77, 0x88, 0x00, 0x00, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x04, 0x00, 0x00, -0x7E, 0x90, 0x00, 0x09, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x00, 0x00, 0x00, 0x7E, 0x90, 0x01, 0x0D, -0x00, 0x00, 0x70, 0x80, 0x00, 0x00, 0x00, 0x00, 0x8C, 0xA0, 0x01, 0x0D, 0x4B, 0x53, 0x54, 0x00, -0x4A, 0x43, 0x53, 0x54, 0x00, 0x4A, 0x53, 0x54, 0x00, 0x4B, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, -0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x15, 0x8B, 0xD7, 0xF0, 0x78, +0x92, 0xE6, 0x16, 0xF8, 0xC3, 0x55, 0x3B, 0x70, 0xD2, 0x43, 0x27, 0xF0, 0xE2, 0x4F, 0x29, 0xF0, +0xE4, 0x6B, 0xB7, 0xF8, 0xE5, 0x13, 0x18, 0x68, 0xE6, 0x62, 0x03, 0x78, 0xE7, 0x11, 0x4C, 0xE8, +0xE8, 0x2F, 0x70, 0x78, 0xE8, 0xE7, 0xF4, 0x68, 0xEA, 0x0F, 0x52, 0x78, 0xEA, 0xC7, 0xD6, 0x68, +0xEB, 0xEF, 0x34, 0x78, 0xEC, 0xA7, 0xB8, 0x68, 0xED, 0xCF, 0x16, 0x78, 0xEE, 0x87, 0x9A, 0x68, +0xF0, 0x35, 0x71, 0x78, 0x20, 0xA3, 0x60, 0x90, 0x21, 0x6E, 0x67, 0x90, 0x22, 0x83, 0x42, 0x90, +0x23, 0x4E, 0x49, 0x90, 0x01, 0x02, 0x03, 0x04, 0x01, 0x05, 0x01, 0x05, 0x01, 0x05, 0x01, 0x05, +0x01, 0x05, 0x01, 0x05, 0x01, 0x04, 0x06, 0x04, 0x06, 0x04, 0x00, 0x00, 0x77, 0x08, 0x00, 0x00, +0x00, 0x00, 0x77, 0x88, 0x00, 0x04, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x08, 0x00, 0x00, 0x7E, 0x90, +0x00, 0x0D, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x04, 0x00, 0x00, 0x85, 0x98, 0x01, 0x11, 0x00, 0x00, +0x8C, 0xA0, 0x01, 0x11, 0x4C, 0x4D, 0x54, 0x00, 0x4B, 0x53, 0x54, 0x00, 0x4A, 0x43, 0x53, 0x54, +0x00, 0x4A, 0x53, 0x54, 0x00, 0x4B, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, +0x00, 0x00, 0x00, /* Singapore */ 0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -18547,4 +18567,4 @@ const unsigned char timelib_timezone_db_data_builtin[263343] = { 0x00, 0x00, 0x55, 0x54, 0x43, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, }; -const timelib_tzdb timezonedb_builtin = { "2014.9", 583, timezonedb_idx_builtin, timelib_timezone_db_data_builtin }; +const timelib_tzdb timezonedb_builtin = { "2014.10", 583, timezonedb_idx_builtin, timelib_timezone_db_data_builtin }; diff --git a/ext/date/tests/002.phpt b/ext/date/tests/002.phpt index 92d0d5f10..adbea5e23 100644 --- a/ext/date/tests/002.phpt +++ b/ext/date/tests/002.phpt @@ -3,7 +3,7 @@ strtotime() function --SKIPIF-- <?php if (!@putenv("TZ=EST5") || getenv("TZ") != 'EST5') { - die("skip unable to change TZ enviroment variable\n"); + die("skip unable to change TZ environment variable\n"); } ?> --FILE-- diff --git a/ext/date/tests/DateTime_setISODate_variation1.phpt b/ext/date/tests/DateTime_setISODate_variation1.phpt index d685f27ed..a4e8865e7 100644 --- a/ext/date/tests/DateTime_setISODate_variation1.phpt +++ b/ext/date/tests/DateTime_setISODate_variation1.phpt @@ -145,7 +145,7 @@ object(DateTime)#%d (3) { -- int -12345 -- object(DateTime)#%d (3) { ["date"]=> - string(28) "-12345-02-15 08:34:10.000000" + string(28) "-12345-02-11 08:34:10.000000" ["timezone_type"]=> int(3) ["timezone"]=> @@ -165,7 +165,7 @@ object(DateTime)#%d (3) { -- float -10.5 -- object(DateTime)#%d (3) { ["date"]=> - string(27) "-0010-02-19 08:34:10.000000" + string(27) "-0010-02-14 08:34:10.000000" ["timezone_type"]=> int(3) ["timezone"]=> diff --git a/ext/date/tests/bug13142.phpt b/ext/date/tests/bug13142.phpt index 5254142ba..5849a9442 100644 --- a/ext/date/tests/bug13142.phpt +++ b/ext/date/tests/bug13142.phpt @@ -8,7 +8,7 @@ if (defined('PHP_WINDOWS_VERSION_MAJOR')) { die("skip. set TZ env is not supported at runtime."); } if (!@putenv("TZ=US/Eastern") || getenv("TZ") != 'US/Eastern') { - die("skip unable to change TZ enviroment variable\n"); + die("skip unable to change TZ environment variable\n"); } ?> --FILE-- diff --git a/ext/date/tests/bug26317.phpt b/ext/date/tests/bug26317.phpt index 5b79bec52..27d6ff125 100644 --- a/ext/date/tests/bug26317.phpt +++ b/ext/date/tests/bug26317.phpt @@ -4,7 +4,7 @@ Bug #26317 (military timezone offset signedness) date.timezone=GMT0 --SKIPIF-- if (!@putenv("TZ=GMT0") || getenv("TZ") != 'GMT0') { - die("skip unable to change TZ enviroment variable\n"); + die("skip unable to change TZ environment variable\n"); } --FILE-- <?php diff --git a/ext/date/tests/bug26320.phpt b/ext/date/tests/bug26320.phpt index c8aeb00c9..e742c39da 100644 --- a/ext/date/tests/bug26320.phpt +++ b/ext/date/tests/bug26320.phpt @@ -4,7 +4,7 @@ Bug #26320 (strtotime handling of XML Schema/ISO 8601 format) date.timezone=GMT0 --SKIPIF-- if (!@putenv("TZ=GMT0") || getenv("TZ") != 'GMT0') { - die("skip unable to change TZ enviroment variable\n"); + die("skip unable to change TZ environment variable\n"); } --FILE-- <?php diff --git a/ext/date/tests/bug49585.phpt b/ext/date/tests/bug49585.phpt index 2ec14245e..d21bba6c5 100644 --- a/ext/date/tests/bug49585.phpt +++ b/ext/date/tests/bug49585.phpt @@ -10,7 +10,8 @@ var_dump($date->format('r')); $date->setDate(-2147483648, 1, 1); var_dump($date->format('r')); var_dump($date->format('c')); +?> --EXPECT-- -string(32) "Sat, 01 Jan -1500 00:00:00 +0000" -string(42) "Unknown, 01 Jan -2147483648 00:00:00 +0000" +string(32) "Fri, 01 Jan -1500 00:00:00 +0000" +string(38) "Mon, 01 Jan -2147483648 00:00:00 +0000" string(32) "-2147483648-01-01T00:00:00+00:00" diff --git a/ext/date/tests/date_interval_create_from_date_string.phpt b/ext/date/tests/date_interval_create_from_date_string.phpt new file mode 100644 index 000000000..9a1745c9a --- /dev/null +++ b/ext/date/tests/date_interval_create_from_date_string.phpt @@ -0,0 +1,34 @@ +--TEST-- +Test date_interval_create_from_date_string() function : basic functionality +--CREDITS-- +Rodrigo Prado de Jesus <royopa [at] gmail [dot] com> +--FILE-- +<?php +$string = '1 day'; //P1D +$i = date_interval_create_from_date_string($string); +var_dump($i->d); + +$string = '2 weeks'; //14 days +$i = date_interval_create_from_date_string($string); +var_dump($i->d); + +$string = '3 months'; +$i = date_interval_create_from_date_string($string); +var_dump($i->m); + +$string = '4 years'; +$i = date_interval_create_from_date_string($string); +var_dump($i->y); + +$string = '1 year + 1 day'; +$i = date_interval_create_from_date_string($string); +var_dump($i->y); +var_dump($i->d); +?> +--EXPECTF-- +int(1) +int(14) +int(3) +int(4) +int(1) +int(1)
\ No newline at end of file diff --git a/ext/date/tests/date_interval_create_from_date_string_nullparam.phpt b/ext/date/tests/date_interval_create_from_date_string_nullparam.phpt new file mode 100644 index 000000000..369db5714 --- /dev/null +++ b/ext/date/tests/date_interval_create_from_date_string_nullparam.phpt @@ -0,0 +1,42 @@ +--TEST-- +Test date_interval_create_from_date_string() function : null parameter +--CREDITS-- +Rodrigo Prado de Jesus <royopa [at] gmail [dot] com> +--FILE-- +<?php +$i = date_interval_create_from_date_string(null); //returns a empty object +var_dump($i); +?> +--EXPECTF-- +object(DateInterval)#1 (15) { + ["y"]=> + int(0) + ["m"]=> + int(0) + ["d"]=> + int(0) + ["h"]=> + int(0) + ["i"]=> + int(0) + ["s"]=> + int(0) + ["weekday"]=> + int(0) + ["weekday_behavior"]=> + int(0) + ["first_last_day_of"]=> + int(0) + ["invert"]=> + int(0) + ["days"]=> + int(0) + ["special_type"]=> + int(0) + ["special_amount"]=> + int(0) + ["have_weekday_relative"]=> + int(0) + ["have_special_relative"]=> + int(0) +}
\ No newline at end of file diff --git a/ext/date/tests/date_interval_create_from_date_string_wrongparam_001.phpt b/ext/date/tests/date_interval_create_from_date_string_wrongparam_001.phpt new file mode 100644 index 000000000..15db95655 --- /dev/null +++ b/ext/date/tests/date_interval_create_from_date_string_wrongparam_001.phpt @@ -0,0 +1,11 @@ +--TEST-- +Test date_interval_create_from_date_string() function : wrong parameter (array) +--CREDITS-- +Rodrigo Prado de Jesus <royopa [at] gmail [dot] com> +--FILE-- +<?php +$wrong_parameter = array(); +$i = date_interval_create_from_date_string($wrong_parameter); +?> +--EXPECTF-- +Warning: date_interval_create_from_date_string() expects parameter 1 to be string, array given in %s on line %d
\ No newline at end of file diff --git a/ext/date/tests/date_interval_create_from_date_string_wrongparam_002.phpt b/ext/date/tests/date_interval_create_from_date_string_wrongparam_002.phpt new file mode 100644 index 000000000..a3407c396 --- /dev/null +++ b/ext/date/tests/date_interval_create_from_date_string_wrongparam_002.phpt @@ -0,0 +1,9 @@ +--TEST-- +Test date_interval_create_from_date_string() function : with 2 parameters (wrong). +Rodrigo Prado de Jesus <royopa [at] gmail [dot] com> +--FILE-- +<?php +$i = date_interval_create_from_date_string('1 year', 'wrong'); +?> +--EXPECTF-- +Warning: date_interval_create_from_date_string() expects exactly 1 parameter, 2 given in %s on line %d
\ No newline at end of file diff --git a/ext/date/tests/date_isodate_set_variation2.phpt b/ext/date/tests/date_isodate_set_variation2.phpt index 5b59a696c..3c3b6924b 100644 --- a/ext/date/tests/date_isodate_set_variation2.phpt +++ b/ext/date/tests/date_isodate_set_variation2.phpt @@ -145,7 +145,7 @@ object(DateTime)#%d (3) { -- int -12345 -- object(DateTime)#%d (3) { ["date"]=> - string(28) "-12345-02-15 08:34:10.000000" + string(28) "-12345-02-11 08:34:10.000000" ["timezone_type"]=> int(3) ["timezone"]=> @@ -165,7 +165,7 @@ object(DateTime)#%d (3) { -- float -10.5 -- object(DateTime)#%d (3) { ["date"]=> - string(27) "-0010-02-19 08:34:10.000000" + string(27) "-0010-02-14 08:34:10.000000" ["timezone_type"]=> int(3) ["timezone"]=> diff --git a/ext/date/tests/date_timestamp_set.phpt b/ext/date/tests/date_timestamp_set.phpt new file mode 100644 index 000000000..e01660193 --- /dev/null +++ b/ext/date/tests/date_timestamp_set.phpt @@ -0,0 +1,19 @@ +--TEST-- +Test the basics to function date_timestamp_set(). +--CREDITS-- +Rodrigo Prado de Jesus <royopa [at] gmail [dot] com> +--INI-- +date.timezone = UTC; +date_default_timezone_set("America/Sao_Paulo"); +--FILE-- +<?php +$dftz021 = date_default_timezone_get(); //UTC + +$dtms021 = date_create(); + +date_timestamp_set($dtms021, 1234567890); + +var_dump(date_format($dtms021, 'B => (U) => T Y-M-d H:i:s')); +?> +--EXPECTF-- +string(47) "021 => (1234567890) => UTC 2009-Feb-13 23:31:30"
\ No newline at end of file diff --git a/ext/date/tests/date_timestamp_set_nullparam.phpt b/ext/date/tests/date_timestamp_set_nullparam.phpt new file mode 100644 index 000000000..1bcb80024 --- /dev/null +++ b/ext/date/tests/date_timestamp_set_nullparam.phpt @@ -0,0 +1,17 @@ +--TEST-- +Test the function date_timestamp_set() with first null parameter. +--CREDITS-- +Rodrigo Prado de Jesus <royopa [at] gmail [dot] com> +--INI-- +date.timezone = UTC; +date_default_timezone_set("America/Sao_Paulo"); +--FILE-- +<?php +$dftz021 = date_default_timezone_get(); //UTC + +$dtms021 = date_create(); + +date_timestamp_set(null, 1234567890); +?> +--EXPECTF-- +Warning: date_timestamp_set() expects parameter 1 to be DateTime, null given in %s on line %d
\ No newline at end of file diff --git a/ext/date/tests/date_timestamp_set_nullparam2.phpt b/ext/date/tests/date_timestamp_set_nullparam2.phpt new file mode 100644 index 000000000..1442da442 --- /dev/null +++ b/ext/date/tests/date_timestamp_set_nullparam2.phpt @@ -0,0 +1,24 @@ +--TEST-- +Test the function date_timestamp_set() with second null parameter. +--CREDITS-- +Rodrigo Prado de Jesus <royopa [at] gmail [dot] com> +--INI-- +date.timezone = UTC; +date_default_timezone_set("America/Sao_Paulo"); +--FILE-- +<?php +$dftz021 = date_default_timezone_get(); //UTC + +$dtms021 = date_create(); + +var_dump(date_timestamp_set($dtms021, null)); +?> +--EXPECTF-- +object(DateTime)#1 (3) { + ["date"]=> + string(26) "1970-01-01 00:00:00.000000" + ["timezone_type"]=> + int(3) + ["timezone"]=> + string(3) "UTC" +}
\ No newline at end of file diff --git a/ext/date/tests/date_timestamp_set_wrongparam_001.phpt b/ext/date/tests/date_timestamp_set_wrongparam_001.phpt new file mode 100644 index 000000000..9a0fca99c --- /dev/null +++ b/ext/date/tests/date_timestamp_set_wrongparam_001.phpt @@ -0,0 +1,17 @@ +--TEST-- +Check the function date_timestamp_set() with first parameter wrong (array). +--CREDITS-- +Rodrigo Prado de Jesus <royopa [at] gmail [dot] com> +--INI-- +date.timezone = UTC; +date_default_timezone_set("America/Sao_Paulo"); +--FILE-- +<?php +$dftz021 = date_default_timezone_get(); //UTC + +$dtms021 = array(); + +date_timestamp_set($dtms021, 123456789); +?> +--EXPECTF-- +Warning: date_timestamp_set() expects parameter 1 to be DateTime, array given in %s on line %d
\ No newline at end of file diff --git a/ext/date/tests/date_timestamp_set_wrongparam_002.phpt b/ext/date/tests/date_timestamp_set_wrongparam_002.phpt new file mode 100644 index 000000000..ed31cb217 --- /dev/null +++ b/ext/date/tests/date_timestamp_set_wrongparam_002.phpt @@ -0,0 +1,15 @@ +--TEST-- +Check the function date_timestamp_set() with first parameter wrong (integer). +--CREDITS-- +Rodrigo Prado de Jesus <royopa [at] gmail [dot] com> +--INI-- +date.timezone = UTC; +date_default_timezone_set("America/Sao_Paulo"); +--FILE-- +<?php +$dftz021 = date_default_timezone_get(); //UTC + +date_timestamp_set(987654321, 123456789); +?> +--EXPECTF-- +Warning: date_timestamp_set() expects parameter 1 to be DateTime, integer given in %s on line %d
\ No newline at end of file diff --git a/ext/date/tests/date_timestamp_set_wrongparam_003.phpt b/ext/date/tests/date_timestamp_set_wrongparam_003.phpt new file mode 100644 index 000000000..f965334d9 --- /dev/null +++ b/ext/date/tests/date_timestamp_set_wrongparam_003.phpt @@ -0,0 +1,19 @@ +--TEST-- +Check the function date_timestamp_set() with second parameter wrong (array). +--CREDITS-- +Rodrigo Prado de Jesus <royopa [at] gmail [dot] com> +--INI-- +date.timezone = UTC; +date_default_timezone_set("America/Sao_Paulo"); +--FILE-- +<?php +$dftz021 = date_default_timezone_get(); //UTC + +$dtms021 = new DateTime(); + +$wrong_parameter = array(); + +date_timestamp_set($dtms021, $wrong_parameter); +?> +--EXPECTF-- +Warning: date_timestamp_set() expects parameter 2 to be long, array given in %s on line %d
\ No newline at end of file diff --git a/ext/date/tests/date_timestamp_set_wrongparam_004.phpt b/ext/date/tests/date_timestamp_set_wrongparam_004.phpt new file mode 100644 index 000000000..b171e98bd --- /dev/null +++ b/ext/date/tests/date_timestamp_set_wrongparam_004.phpt @@ -0,0 +1,17 @@ +--TEST-- +Check the function date_timestamp_set() with 3 parameters. +--CREDITS-- +Rodrigo Prado de Jesus <royopa [at] gmail [dot] com> +--INI-- +date.timezone = UTC; +date_default_timezone_set("America/Sao_Paulo"); +--FILE-- +<?php +$dftz021 = date_default_timezone_get(); //UTC + +$dtms021 = new DateTime(); + +date_timestamp_set($dtms021, 123456789, 'error'); +?> +--EXPECTF-- +Warning: date_timestamp_set() expects exactly 2 parameters, 3 given in %s on line %d
\ No newline at end of file diff --git a/ext/date/tests/getdate_variation7.phpt b/ext/date/tests/getdate_variation7.phpt index 5af2dd53f..2088fa179 100644 --- a/ext/date/tests/getdate_variation7.phpt +++ b/ext/date/tests/getdate_variation7.phpt @@ -61,7 +61,7 @@ array\(11\) { \["mday"\]=> int\((9|14|23)\) \["wday"\]=> - int\((6|-4)\) + int\(0\) \["mon"\]=> int\((10|12)\) \["year"\]=> @@ -69,7 +69,7 @@ array\(11\) { \["yday"\]=> int\((282|347|295)\) \["weekday"\]=> - string\((8|7)\) "(Saturday|Unknown)" + string\(6\) "Sunday" \["month"\]=> string\((7|8)\) "(October|December)" \[0\]=> diff --git a/ext/date/tests/localtime_variation3.phpt b/ext/date/tests/localtime_variation3.phpt index d941e3891..34d8f57f0 100644 --- a/ext/date/tests/localtime_variation3.phpt +++ b/ext/date/tests/localtime_variation3.phpt @@ -87,7 +87,7 @@ array\(9\) { \[5\]=> int\((104|1|-3843)\) \[6\]=> - int\((5|-5)\) + int\(6\) \[7\]=> int\((281|346|294)\) \[8\]=> @@ -107,7 +107,7 @@ array\(9\) { \["tm_year"\]=> int\((104|1|-3843)\) \["tm_wday"\]=> - int\((5|-5)\) + int\(6\) \["tm_yday"\]=> int\((281|346|294)\) \["tm_isdst"\]=> diff --git a/ext/date/tests/timezone_version_get.phpt b/ext/date/tests/timezone_version_get.phpt new file mode 100644 index 000000000..e07600428 --- /dev/null +++ b/ext/date/tests/timezone_version_get.phpt @@ -0,0 +1,13 @@ +--TEST-- +Test the basics to function timezone_version_get(). +--CREDITS-- +Rodrigo Prado de Jesus <royopa [at] gmail [dot] com> +--INI-- +date.timezone = UTC; +date_default_timezone_set("America/Sao_Paulo"); +--FILE-- +<?php +var_dump(timezone_version_get()); +?> +--EXPECTREGEX-- +string\([6-7]\) \"20[0-9][0-9]\.[1-9][0-9]?\"
\ No newline at end of file diff --git a/ext/date/tests/timezone_version_get_basic1.phpt b/ext/date/tests/timezone_version_get_basic1.phpt new file mode 100644 index 000000000..27224e3d4 --- /dev/null +++ b/ext/date/tests/timezone_version_get_basic1.phpt @@ -0,0 +1,12 @@ +--TEST-- +timezone_version_get: Test that timezone_location_get returns a date concatenated with a dot and a version number +--CREDITS-- +Rodrigo Wanderley de Melo Cardoso <rodrigogepem@gmail.com> +#PHPTestFest2014 São Paulo 2014-07-05 +--INI-- +date.timezone=UTC +--FILE-- +<?php $versionTimezone = timezone_version_get(); +echo $versionTimezone; ?> +--EXPECTREGEX-- +^[12][0-9]{3}.[0-9]+$
\ No newline at end of file diff --git a/ext/exif/tests/bug68113.phpt b/ext/exif/tests/bug68113.phpt index 0fa4c4aca..e4a1cbf53 100644 --- a/ext/exif/tests/bug68113.phpt +++ b/ext/exif/tests/bug68113.phpt @@ -10,8 +10,8 @@ var_dump(exif_thumbnail(__DIR__."/bug68113.jpg")); ?> Done --EXPECTF-- -Warning: exif_thumbnail(bug68113.jpg): File structure corrupted in %s/bug68113.php on line 2 +Warning: exif_thumbnail(bug68113.jpg): File structure corrupted in %s%ebug68113.php on line 2 -Warning: exif_thumbnail(bug68113.jpg): Invalid JPEG file in %s/bug68113.php on line 2 +Warning: exif_thumbnail(bug68113.jpg): Invalid JPEG file in %s%ebug68113.php on line 2 bool(false) -Done
\ No newline at end of file +Done diff --git a/ext/fileinfo/fileinfo.php b/ext/fileinfo/fileinfo.php index 1ee9efbeb..791d03a21 100644 --- a/ext/fileinfo/fileinfo.php +++ b/ext/fileinfo/fileinfo.php @@ -3,7 +3,7 @@ if(!extension_loaded('fileinfo')) { dl('fileinfo.' . PHP_SHLIB_SUFFIX); } if(!extension_loaded('fileinfo')) { - die("fileinfo extension is not avaliable, please compile it.\n"); + die("fileinfo extension is not available, please compile it.\n"); } // normal operation diff --git a/ext/fileinfo/libmagic/patchlevel.h b/ext/fileinfo/libmagic/patchlevel.h index a53c6830d..65551b402 100644 --- a/ext/fileinfo/libmagic/patchlevel.h +++ b/ext/fileinfo/libmagic/patchlevel.h @@ -351,7 +351,7 @@ * * Revision 1.8 93/02/19 15:01:26 ian * Numerous changes from Guy Harris too numerous to mention but including - * byte-order independance, fixing "old-style masking", etc. etc. A bugfix + * byte-order independence, fixing "old-style masking", etc. etc. A bugfix * for broken symlinks from martin@@d255s004.zfe.siemens.de. * * Revision 1.7 93/01/05 14:57:27 ian diff --git a/ext/fileinfo/tests/magic b/ext/fileinfo/tests/magic index dc80e8d37..1718e9d60 100644 --- a/ext/fileinfo/tests/magic +++ b/ext/fileinfo/tests/magic @@ -3918,7 +3918,7 @@ >7 string x version %.2s # We skip the path here, because it is often long (so file will # truncate it) and mostly redundant. -# The inverted index functionality was added some time betwen +# The inverted index functionality was added some time between # versions 11 and 15, so look for -q if version is above 14: >7 string >14 >>10 search/100 \ -q\ with inverted index @@ -3972,7 +3972,7 @@ # .cwk 0 string \002\000\210\003\102\117\102\117\000\001\206 Claris works document # .plt -0 string \020\341\000\000\010\010 Claris Works pallete files .plt +0 string \020\341\000\000\010\010 Claris Works palette files .plt # .msp a dictionary file I am not sure about this I have only one .msp file 0 string \002\271\262\000\040\002\000\164 Claris works dictionary @@ -4443,9 +4443,9 @@ >6 byte&0x04 =0x8 \b, [4-Scr] #------------------------------------------------------------------------------ -# gameboy: file(1) magic for the Nintendo (Color) Gameboy raw ROM format +# game boy: file(1) magic for the Nintendo (Color) Game Boy raw ROM format # -0x104 belong 0xCEED6666 Gameboy ROM: +0x104 belong 0xCEED6666 Game Boy ROM: >0x134 string >\0 "%.16s" >0x146 byte 0x03 \b,[SGB] >0x147 byte 0x00 \b, [ROM ONLY] @@ -4605,8 +4605,8 @@ 0 string \x01ZZZZZ\x01 3DO "Opera" file system # From Gurkan Sengun <gurkan@linuks.mine.nu>, www.linuks.mine.nu -0 string GBS Nintendo Gameboy Music/Audio Data -12 string GameBoy\ Music\ Module Nintendo Gameboy Music Module +0 string GBS Nintendo Game Boy Music/Audio Data +12 string GameBoy\ Music\ Module Nintendo Game Boy Music Module # Playstations Patch Files from: From: Thomas Klausner <tk@giga.or.at> 0 string PPF30 Playstation Patch File version 3.0 @@ -15279,7 +15279,7 @@ # $File: oasis,v 1.1 2011/03/15 02:09:38 christos Exp $ # OASIS # Summary: OASIS stream file -# Long descripton: Open Artwork System Interchange Standard +# Long description: Open Artwork System Interchange Standard # File extension: .oas # Full name: Ben Cowley (bcowley@broadcom.com) # Philip Dixon (pdixon@broadcom.com) diff --git a/ext/filter/filter.c b/ext/filter/filter.c index 4d3899e08..a408ee30d 100644 --- a/ext/filter/filter.c +++ b/ext/filter/filter.c @@ -791,7 +791,7 @@ PHP_FUNCTION(filter_input) /* }}} */ /* {{{ proto mixed filter_var(mixed variable [, long filter [, mixed options]]) - * Returns the filtered version of the vriable. + * Returns the filtered version of the variable. */ PHP_FUNCTION(filter_var) { diff --git a/ext/ftp/ftp.h b/ext/ftp/ftp.h index 2759ce2af..acf3917bd 100644 --- a/ext/ftp/ftp.h +++ b/ext/ftp/ftp.h @@ -69,8 +69,8 @@ typedef struct ftpbuf ftptype_t type; /* current transfer type */ int pasv; /* 0=off; 1=pasv; 2=ready */ php_sockaddr_storage pasvaddr; /* passive mode address */ - long timeout_sec; /* User configureable timeout (seconds) */ - int autoseek; /* User configureable autoseek flag */ + long timeout_sec; /* User configurable timeout (seconds) */ + int autoseek; /* User configurable autoseek flag */ int nb; /* "nonblocking" transfer in progress */ databuf_t *data; /* Data connection for "nonblocking" transfers */ diff --git a/ext/gd/libgd/gd.h b/ext/gd/libgd/gd.h index b61d972e8..0ace31ba0 100644 --- a/ext/gd/libgd/gd.h +++ b/ext/gd/libgd/gd.h @@ -782,7 +782,7 @@ int gdImageBrightness(gdImagePtr src, int brightness); /* Set the contrast level <contrast> for the image <src> */ int gdImageContrast(gdImagePtr src, double contrast); -/* Simply adds or substracts respectively red, green or blue to a pixel */ +/* Simply adds or subtracts respectively red, green or blue to a pixel */ int gdImageColor(gdImagePtr src, const int red, const int green, const int blue, const int alpha); /* Image convolution by a 3x3 custom matrix */ diff --git a/ext/gd/libgd/gd_arc_f_buggy.c b/ext/gd/libgd/gd_arc_f_buggy.c index c26e42171..ffab55123 100644 --- a/ext/gd/libgd/gd_arc_f_buggy.c +++ b/ext/gd/libgd/gd_arc_f_buggy.c @@ -1,6 +1,6 @@ /* This is potentially great stuff, but fails against the test program at the end. This would probably be much more - efficent than the implementation currently in gd.c if the + efficient than the implementation currently in gd.c if the errors in the output were corrected. TBB */ #if 0 diff --git a/ext/gd/libgd/gdft.c b/ext/gd/libgd/gdft.c index 3d7b46c41..ba905dc0a 100644 --- a/ext/gd/libgd/gdft.c +++ b/ext/gd/libgd/gdft.c @@ -464,7 +464,7 @@ static void *fontFetch (char **error, void *key) return NULL; } - /* FIXME - This mapping stuff is imcomplete - where is the spec? */ + /* FIXME - This mapping stuff is incomplete - where is the spec? */ /* EAM - It's worse than that. It's pointless to match character encodings here. * As currently written, the stored a->face->charmap only matches one of * the actual charmaps and we cannot know at this stage if it is the right diff --git a/ext/gd/libgd/webpimg.c b/ext/gd/libgd/webpimg.c index 01bef93c4..95a8081e0 100644 --- a/ext/gd/libgd/webpimg.c +++ b/ext/gd/libgd/webpimg.c @@ -169,7 +169,7 @@ static inline uint32 get_le32(const uint8* const data) { * Y2/U2/V2: The Y/U/V data of the second image * * Returns the PSNR (http://en.wikipedia.org/wiki/Peak_signal-to-noise_ratio) - * value computed bewteen the two images + * value computed between the two images */ double GetPSNRYuv(const uint8* Y1, const uint8* U1, @@ -210,7 +210,7 @@ double GetPSNRYuv(const uint8* Y1, * imgdata: data buffer containing webp image * imgdata_size: size of the imgdata buffer * - * Returns the PSNR value computed bewteen the two images + * Returns the PSNR value computed between the two images */ double WebPGetPSNR(const uint8* Y1, const uint8* U1, diff --git a/ext/gd/libgd/webpimg.h b/ext/gd/libgd/webpimg.h index db23de5bb..bc0f9722b 100644 --- a/ext/gd/libgd/webpimg.h +++ b/ext/gd/libgd/webpimg.h @@ -57,7 +57,7 @@ typedef enum WebPResultType { * 3. p_Y/p_U/p_V : pointer to the Y/U/V data buffer (this routine will * allocate memory for the buffer, fill the buffer with * appropriate data and transfer owner ship of the buffer - * to caller. Caller is reponsible for freeing the memory). + * to caller. Caller is responsible for freeing the memory). * Note that the memory for Y, U, V buffers is alloacted * in one chunk, hence one should call free(*p_Y) only. * Do not try to free the U and V buffers. diff --git a/ext/gd/tests/imagealphablending_error1.phpt b/ext/gd/tests/imagealphablending_error1.phpt new file mode 100644 index 000000000..6d49f32b0 --- /dev/null +++ b/ext/gd/tests/imagealphablending_error1.phpt @@ -0,0 +1,19 @@ +--TEST-- +test imagealphablending without arguments + +--CREDITS-- +Marcelo Diniz <marcelo.leo27 [at] gmail [dot] com +#phpspMaisTestFest PHPSP on 2014-07-05 + +--SKIPIF-- +<?php + if (!extension_loaded('gd')) die("skip gd extension not available."); +?> + +--FILE-- +<?php +imagealphablending(); +?> + +--EXPECTF-- +Warning: imagealphablending() expects exactly 2 parameters, 0 given in %s on line %d
\ No newline at end of file diff --git a/ext/gd/tests/imagecolorresolvealpha_error3.phpt b/ext/gd/tests/imagecolorresolvealpha_error3.phpt new file mode 100644 index 000000000..735b4c97d --- /dev/null +++ b/ext/gd/tests/imagecolorresolvealpha_error3.phpt @@ -0,0 +1,19 @@ +--TEST-- +test imagecolorresolvealpha without arguments + +--CREDITS-- +Marcelo Diniz <marcelo.leo27 [at] gmail [dot] com +#phpspMaisTestFest PHPSP on 2014-07-05 + +--SKIPIF-- +<?php + if (!extension_loaded('gd')) die("skip gd extension not available."); +?> + +--FILE-- +<?php +imagecolorresolvealpha(); +?> + +--EXPECTF-- +Warning: imagecolorresolvealpha() expects exactly 5 parameters, 0 given in %s on line %d
\ No newline at end of file diff --git a/ext/gd/tests/imagesavealpha_error2.phpt b/ext/gd/tests/imagesavealpha_error2.phpt new file mode 100644 index 000000000..1a7083d52 --- /dev/null +++ b/ext/gd/tests/imagesavealpha_error2.phpt @@ -0,0 +1,19 @@ +--TEST-- +test imagesavealpha without arguments + +--CREDITS-- +Marcelo Diniz <marcelo.leo27 [at] gmail [dot] com +#phpspMaisTestFest PHPSP on 2014-07-05 + +--SKIPIF-- +<?php + if (!extension_loaded('gd')) die("skip gd extension not available."); +?> + +--FILE-- +<?php +imagesavealpha(); +?> + +--EXPECTF-- +Warning: imagesavealpha() expects exactly 2 parameters, 0 given in %s on line %d
\ No newline at end of file diff --git a/ext/gettext/tests/66265/de_DE/LC_MESSAGES/domain.mo b/ext/gettext/tests/66265/de_DE/LC_MESSAGES/domain.mo Binary files differnew file mode 100644 index 000000000..1aaba7b27 --- /dev/null +++ b/ext/gettext/tests/66265/de_DE/LC_MESSAGES/domain.mo diff --git a/ext/gettext/tests/66265/de_DE/LC_MESSAGES/domain.po b/ext/gettext/tests/66265/de_DE/LC_MESSAGES/domain.po new file mode 100644 index 000000000..d2496d78f --- /dev/null +++ b/ext/gettext/tests/66265/de_DE/LC_MESSAGES/domain.po @@ -0,0 +1,17 @@ +msgid "" +msgstr "" +"Project-Id-Version: bugs.php.net/66265\n" +"POT-Creation-Date: 2014-11-20 16:33+0100\n" +"PO-Revision-Date: 2014-11-20 16:40+0100\n" +"Last-Translator: <ab@php.net>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 1.6.10\n" +"X-Poedit-Basepath: .\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"Language: de_DE\n" + +msgid "hello" +msgstr "hallo" diff --git a/ext/gettext/tests/66265/en_US/LC_MESSAGES/domain.mo b/ext/gettext/tests/66265/en_US/LC_MESSAGES/domain.mo Binary files differnew file mode 100644 index 000000000..79d02c173 --- /dev/null +++ b/ext/gettext/tests/66265/en_US/LC_MESSAGES/domain.mo diff --git a/ext/gettext/tests/66265/en_US/LC_MESSAGES/domain.po b/ext/gettext/tests/66265/en_US/LC_MESSAGES/domain.po new file mode 100644 index 000000000..670d7ddad --- /dev/null +++ b/ext/gettext/tests/66265/en_US/LC_MESSAGES/domain.po @@ -0,0 +1,17 @@ +msgid "" +msgstr "" +"Project-Id-Version: bugs.php.net/66265\n" +"POT-Creation-Date: 2014-11-20 16:33+0100\n" +"PO-Revision-Date: 2014-11-20 16:40+0100\n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 1.6.10\n" +"X-Poedit-Basepath: .\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"Language: en_US\n" + +msgid "hello" +msgstr "hello" diff --git a/ext/gettext/tests/66265/fr_FR/LC_MESSAGES/domain.mo b/ext/gettext/tests/66265/fr_FR/LC_MESSAGES/domain.mo Binary files differnew file mode 100644 index 000000000..c2f3cdd6b --- /dev/null +++ b/ext/gettext/tests/66265/fr_FR/LC_MESSAGES/domain.mo diff --git a/ext/gettext/tests/66265/fr_FR/LC_MESSAGES/domain.po b/ext/gettext/tests/66265/fr_FR/LC_MESSAGES/domain.po new file mode 100644 index 000000000..c2f708c52 --- /dev/null +++ b/ext/gettext/tests/66265/fr_FR/LC_MESSAGES/domain.po @@ -0,0 +1,17 @@ +msgid "" +msgstr "" +"Project-Id-Version: bugs.php.net/66265\n" +"POT-Creation-Date: 2014-11-20 16:33+0100\n" +"PO-Revision-Date: 2014-11-20 16:59+0100\n" +"Last-Translator: <ab@php.net>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 1.6.10\n" +"X-Poedit-Basepath: .\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"Language: fr_FR\n" + +msgid "hello" +msgstr "salut" diff --git a/ext/gettext/tests/bug66267.phpt b/ext/gettext/tests/bug66267.phpt new file mode 100644 index 000000000..26963acb7 --- /dev/null +++ b/ext/gettext/tests/bug66267.phpt @@ -0,0 +1,55 @@ +--TEST-- +#66265: gettext doesn't switch locales within the same script +--SKIPIF-- +<?php +if (!extension_loaded("gettext")) { + die("skip\n"); +} +if (PHP_ZTS) { + /* this is supposed to fail on the TS build at least on Windows, + should be even XFAIL till it's fixed there */ + die("skip NTS only"); +} +if (substr(PHP_OS, 0, 3) != 'WIN') { + $loc = ["de_DE", "fr_FR", "en_US"]; + foreach($loc as $l) { + if (!setlocale(LC_ALL, $l)) { + die("SKIP '$l' locale not supported."); + } + } +} +?> +--FILE-- +<?php + +$domain = 'domain'; + +$loc = ["de_DE", "fr_FR", "en_US"]; + +foreach ($loc as $l) { + putenv("LC_ALL=$l"); + + $path = realpath(dirname(__FILE__) . DIRECTORY_SEPARATOR . "66265"); + bindtextdomain($domain, $path); + bind_textdomain_codeset($domain, "UTF-8"); + textdomain($domain); + + echo 'LC_ALL=', getenv('LC_ALL'), "\n"; + echo 'hello=', _('hello'), "\n"; + echo "\n"; +} + +?> +==DONE== +--EXPECTF-- +LC_ALL=de_DE +hello=hallo + +LC_ALL=fr_FR +hello=salut + +LC_ALL=en_US +hello=hello + +==DONE== + diff --git a/ext/gmp/gmp.c b/ext/gmp/gmp.c index e9c1ad341..de61f1ca5 100644 --- a/ext/gmp/gmp.c +++ b/ext/gmp/gmp.c @@ -1776,7 +1776,7 @@ static void gmp_init_random(TSRMLS_D) #if GMP_42_OR_NEWER gmp_randinit_mt(GMPG(rand_state)); #else - gmp_randinit_lc_2exp(GMPG(rand_state), 32L); + gmp_randinit_lc_2exp_size(GMPG(rand_state), 32L); #endif /* Seed */ gmp_randseed_ui(GMPG(rand_state), GENERATE_SEED()); diff --git a/ext/iconv/tests/iconv_basic_001-win32.phpt b/ext/iconv/tests/iconv_basic_001-win32.phpt new file mode 100644 index 000000000..59a3dbd86 --- /dev/null +++ b/ext/iconv/tests/iconv_basic_001-win32.phpt @@ -0,0 +1,19 @@ +--TEST-- +Test the basics to function iconv. +--CREDITS-- +Rodrigo Prado de Jesus <royopa [at] gmail [dot] com> +--SKIPIF-- +<?php extension_loaded('iconv') or die('skip iconv extension is not available'); ?> +<?php if(substr(PHP_OS, 0, 3) != 'WIN' ) {die('skip windows only test');} ?> +--FILE-- +<?php +$in_charset = 'UTF-8'; +$out_charset = 'ASCII//TRANSLIT'; +$string_to_translate = 'Žluťoučký kůň\n'; + +$string_out = iconv($in_charset, $out_charset, $string_to_translate); + +var_dump($string_out); +?> +--EXPECT-- +string(16) "Zlutouck'y kun\n" diff --git a/ext/iconv/tests/iconv_basic_001.phpt b/ext/iconv/tests/iconv_basic_001.phpt new file mode 100644 index 000000000..6fcb5dbe8 --- /dev/null +++ b/ext/iconv/tests/iconv_basic_001.phpt @@ -0,0 +1,19 @@ +--TEST-- +Test the basics to function iconv. +--CREDITS-- +Rodrigo Prado de Jesus <royopa [at] gmail [dot] com> +--SKIPIF-- +<?php extension_loaded('iconv') or die('skip iconv extension is not available'); ?> +<?php if(substr(PHP_OS, 0, 3) == 'WIN' ) {die('skip not for windows');} ?> +--FILE-- +<?php +$in_charset = 'UTF-8'; +$out_charset = 'ASCII//TRANSLIT'; +$string_to_translate = 'Žluťoučký kůň\n'; + +$string_out = iconv($in_charset, $out_charset, $string_to_translate); + +var_dump($string_out); +?> +--EXPECT-- +string(15) "Zlutoucky kun\n" diff --git a/ext/interbase/tests/005.phpt b/ext/interbase/tests/005.phpt index c5167c132..08b8e53ef 100644 --- a/ext/interbase/tests/005.phpt +++ b/ext/interbase/tests/005.phpt @@ -63,7 +63,7 @@ simple default transaction test without ibase_trans() /* default transaction on default link First open transaction on link will be default. -$tr_def_l1 may be ommited. All queryes without link and trans +$tr_def_l1 may be omitted. All queryes without link and trans parameters run in this context */ diff --git a/ext/intl/tests/bug67052-win32.phpt b/ext/intl/tests/bug67052-win32.phpt new file mode 100644 index 000000000..5bc6497be --- /dev/null +++ b/ext/intl/tests/bug67052-win32.phpt @@ -0,0 +1,30 @@ +--TEST-- +Bug #67052 - NumberFormatter::parse() resets LC_NUMERIC setting +--SKIPIF-- +<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?> +<?php +if (substr(PHP_OS, 0, 3) != 'WIN') { + die("skip Valid only on Windows"); +} +?> +--FILE-- +<?php + +function ut_main() +{ + setlocale(LC_ALL, 'de-de'); + $fmt = new NumberFormatter( 'sl_SI.UTF-8', NumberFormatter::DECIMAL); + $num = "1.234.567,891"; + $res_str = $fmt->parse($num)."\n"; + $res_str .= setlocale(LC_NUMERIC, 0); + return $res_str; +} + +include_once( 'ut_common.inc' ); +ut_run(); + +?> +--EXPECT-- +1234567,891 +de-de + diff --git a/ext/intl/tests/bug67052.phpt b/ext/intl/tests/bug67052.phpt index c8363b9c7..8edd65de7 100644 --- a/ext/intl/tests/bug67052.phpt +++ b/ext/intl/tests/bug67052.phpt @@ -2,6 +2,11 @@ Bug #67052 - NumberFormatter::parse() resets LC_NUMERIC setting --SKIPIF-- <?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?> +<?php +if (substr(PHP_OS, 0, 3) == 'WIN') { + die("skip Valid only on non Windows"); +} +?> --FILE-- <?php diff --git a/ext/intl/tests/collator_create3.phpt b/ext/intl/tests/collator_create3.phpt index c602e794c..5041e635f 100644 --- a/ext/intl/tests/collator_create3.phpt +++ b/ext/intl/tests/collator_create3.phpt @@ -1,8 +1,9 @@ --TEST-- -create() icu >= 53.1 +create() icu >= 53.1 && icu < 54.1 --SKIPIF-- <?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?> <?php if (version_compare(INTL_ICU_VERSION, '53.1') < 0) die('skip for ICU >= 53.1'); ?> +<?php if (version_compare(INTL_ICU_VERSION, '54.1') >= 0) die('skip for ICU < 54.1'); ?> --FILE-- <?php diff --git a/ext/intl/tests/collator_create4.phpt b/ext/intl/tests/collator_create4.phpt new file mode 100644 index 000000000..2c22e6a44 --- /dev/null +++ b/ext/intl/tests/collator_create4.phpt @@ -0,0 +1,79 @@ +--TEST-- +create() icu >= 53.1 +--SKIPIF-- +<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?> +<?php if (version_compare(INTL_ICU_VERSION, '54.1') < 0) die('skip for ICU >= 54.1'); ?> +--FILE-- +<?php + +/* + * Try creating collator with different locales + * with Procedural and Object methods. + */ + +function ut_main() +{ + $res_str = ''; + + $locales = array( + 'EN-US-ODESSA', + 'UK_UA_ODESSA', + 'uk-ua_CALIFORNIA@currency=;currency=GRN', + '', + 'root', + 'uk@currency=EURO', + '1234567891113151719212325272931333537394143454749515357596163656769717375777981838587899193959799' + ); + + foreach( $locales as $locale ) + { + // Create Collator with the current locale. + $coll = ut_coll_create( $locale ); + if( !is_object($coll) ) + { + $res_str .= "Error creating collator with '$locale' locale: " . + intl_get_error_message() . "\n"; + continue; + } + + // Get the requested, valid and actual locales. + $vloc = ut_coll_get_locale( $coll, Locale::VALID_LOCALE ); + $aloc = ut_coll_get_locale( $coll, Locale::ACTUAL_LOCALE ); + + // Show them. + $res_str .= "Locale: '$locale'\n" . + " ULOC_REQUESTED_LOCALE = '$locale'\n" . + " ULOC_VALID_LOCALE = '$vloc'\n" . + " ULOC_ACTUAL_LOCALE = '$aloc'\n"; + } + + return $res_str; +} + +include_once( 'ut_common.inc' ); +ut_run(); + +?> +--EXPECTF-- +Locale: 'EN-US-ODESSA' + ULOC_REQUESTED_LOCALE = 'EN-US-ODESSA' + ULOC_VALID_LOCALE = 'en_US' + ULOC_ACTUAL_LOCALE = 'root' +Locale: 'UK_UA_ODESSA' + ULOC_REQUESTED_LOCALE = 'UK_UA_ODESSA' + ULOC_VALID_LOCALE = 'uk' + ULOC_ACTUAL_LOCALE = 'uk' +Error creating collator with 'uk-ua_CALIFORNIA@currency=;currency=GRN' locale: collator_create: unable to open ICU collator: U_ILLEGAL_ARGUMENT_ERROR +Locale: '' + ULOC_REQUESTED_LOCALE = '' + ULOC_VALID_LOCALE = '%s' + ULOC_ACTUAL_LOCALE = '%s' +Locale: 'root' + ULOC_REQUESTED_LOCALE = 'root' + ULOC_VALID_LOCALE = 'root' + ULOC_ACTUAL_LOCALE = 'root' +Locale: 'uk@currency=EURO' + ULOC_REQUESTED_LOCALE = 'uk@currency=EURO' + ULOC_VALID_LOCALE = 'uk' + ULOC_ACTUAL_LOCALE = 'uk' +Error creating collator with '1234567891113151719212325272931333537394143454749515357596163656769717375777981838587899193959799' locale: Locale string too long, should be no longer than 80 characters: U_ILLEGAL_ARGUMENT_ERROR diff --git a/ext/intl/tests/collator_get_sort_key_variant3.phpt b/ext/intl/tests/collator_get_sort_key_variant3.phpt index cc2a23b2b..f4cb88e3e 100644 --- a/ext/intl/tests/collator_get_sort_key_variant3.phpt +++ b/ext/intl/tests/collator_get_sort_key_variant3.phpt @@ -1,8 +1,9 @@ --TEST-- -collator_get_sort_key() +collator_get_sort_key() icu >= 53.1 && icu < 54.1 --SKIPIF-- <?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?> <?php if (version_compare(INTL_ICU_VERSION, '53.1') < 0) die('skip for ICU >= 53.1'); ?> +<?php if (version_compare(INTL_ICU_VERSION, '54.1') >= 0) die('skip for ICU < 54.1'); ?> --FILE-- <?php diff --git a/ext/intl/tests/collator_get_sort_key_variant4.phpt b/ext/intl/tests/collator_get_sort_key_variant4.phpt new file mode 100644 index 000000000..2c86f2111 --- /dev/null +++ b/ext/intl/tests/collator_get_sort_key_variant4.phpt @@ -0,0 +1,98 @@ +--TEST-- +collator_get_sort_key() icu >= 54.1 +--SKIPIF-- +<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?> +<?php if (version_compare(INTL_ICU_VERSION, '54.1') < 0) die('skip for ICU >= 54.1'); ?> +--FILE-- +<?php + +/* + * Get sort keys using various locales + */ +function sort_arrays( $locale, $data ) +{ + $res_str = ''; + + $coll = ut_coll_create( $locale ); + + foreach($data as $value) { + $res_val = ut_coll_get_sort_key( $coll, $value ); + $res_str .= "source: ".$value."\n". + "key: ".bin2hex($res_val)."\n"; + } + + return $res_str; +} + + +function ut_main() +{ + $res_str = ''; + + // Regular strings keys + $test_params = array( + 'abc', 'abd', 'aaa', + 'аа', 'а', 'z', + '', null , '3', + 'y' , 'i' , 'k' + ); + + $res_str .= sort_arrays( 'en_US', $test_params ); + + // Sort a non-ASCII array using ru_RU locale. + $test_params = array( + 'абг', 'абв', 'жжж', 'эюя' + ); + + $res_str .= sort_arrays( 'ru_RU', $test_params ); + + // Sort an array using Lithuanian locale. + $res_str .= sort_arrays( 'lt_LT', $test_params ); + + return $res_str . "\n"; +} + +include_once( 'ut_common.inc' ); +ut_run(); +?> +--EXPECT-- +source: abc +key: 292b2d01070107 +source: abd +key: 292b2f01070107 +source: aaa +key: 29292901070107 +source: аа +key: 5e060601060106 +source: а +key: 5e0601050105 +source: z +key: 5b01050105 +source: +key: 0101 +source: +key: 0101 +source: 3 +key: 1a01050105 +source: y +key: 5901050105 +source: i +key: 3901050105 +source: k +key: 3d01050105 +source: абг +key: 2806101401070107 +source: абв +key: 2806101201070107 +source: жжж +key: 2830303001070107 +source: эюя +key: 28ccd0d401070107 +source: абг +key: 5e06101401070107 +source: абв +key: 5e06101201070107 +source: жжж +key: 5e30303001070107 +source: эюя +key: 5eccd0d401070107 diff --git a/ext/intl/tests/dateformat_calendars_variant2.phpt b/ext/intl/tests/dateformat_calendars_variant2.phpt index 61cdea840..b3b1701c5 100644 --- a/ext/intl/tests/dateformat_calendars_variant2.phpt +++ b/ext/intl/tests/dateformat_calendars_variant2.phpt @@ -6,6 +6,7 @@ date.timezone=Atlantic/Azores <?php if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?> <?php if (version_compare(INTL_ICU_VERSION, '51.2') < 0) die('skip for ICU >= 51.2'); ?> +<?php if (version_compare(INTL_ICU_VERSION, '54.1') >= 0) die('skip for ICU < 54.1'); ?> --FILE-- <?php ini_set("intl.error_level", E_WARNING); diff --git a/ext/intl/tests/dateformat_calendars_variant3.phpt b/ext/intl/tests/dateformat_calendars_variant3.phpt new file mode 100644 index 000000000..36a67e6f0 --- /dev/null +++ b/ext/intl/tests/dateformat_calendars_variant3.phpt @@ -0,0 +1,45 @@ +--TEST-- +IntlDateFormatter, calendars and time zone +--INI-- +date.timezone=Atlantic/Azores +--SKIPIF-- +<?php +if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?> +<?php if (version_compare(INTL_ICU_VERSION, '54.1') < 0) die('skip for ICU >= 54.1'); ?> +--FILE-- +<?php +ini_set("intl.error_level", E_WARNING); + +$fmt1 = new IntlDateFormatter('en_US', + IntlDateFormatter::FULL, + IntlDateFormatter::FULL, + 'GMT+05:12', + IntlDateFormatter::TRADITIONAL); +$fmt2 = new IntlDateFormatter('en_US', + IntlDateFormatter::FULL, + IntlDateFormatter::FULL, + 'GMT+05:12', + IntlDateFormatter::GREGORIAN); +$fmt3 = new IntlDateFormatter('en_US@calendar=hebrew', + IntlDateFormatter::FULL, + IntlDateFormatter::FULL, + 'GMT+05:12', + IntlDateFormatter::TRADITIONAL); +var_dump($fmt1->format(strtotime('2012-01-01 00:00:00 +0000'))); +var_dump($fmt2->format(strtotime('2012-01-01 00:00:00 +0000'))); +var_dump($fmt3->format(strtotime('2012-01-01 00:00:00 +0000'))); + +new IntlDateFormatter('en_US@calendar=hebrew', + IntlDateFormatter::FULL, + IntlDateFormatter::FULL, + 'GMT+05:12', + -1); +?> +==DONE== +--EXPECTF-- +string(47) "Sunday, January 1, 2012 at 5:12:00 AM GMT+05:12" +string(47) "Sunday, January 1, 2012 at 5:12:00 AM GMT+05:12" +string(44) "Sunday, 6 Tevet 5772 at 5:12:00 AM GMT+05:12" + +Warning: IntlDateFormatter::__construct(): datefmt_create: invalid value for calendar type; it must be one of IntlDateFormatter::TRADITIONAL (locale's default calendar) or IntlDateFormatter::GREGORIAN. Alternatively, it can be an IntlCalendar object in %sdateformat_calendars_variant%d.php on line %d +==DONE== diff --git a/ext/intl/tests/dateformat_create_cal_arg_variant3.phpt b/ext/intl/tests/dateformat_create_cal_arg_variant3.phpt index 8a8c45d41..1beff145d 100644 --- a/ext/intl/tests/dateformat_create_cal_arg_variant3.phpt +++ b/ext/intl/tests/dateformat_create_cal_arg_variant3.phpt @@ -4,6 +4,7 @@ IntlDateFormatter: several forms of the calendar arg <?php if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?> <?php if (version_compare(INTL_ICU_VERSION, '52.1') < 0) die('skip for ICU >= 52.1'); ?> +<?php if (version_compare(INTL_ICU_VERSION, '54.1') >= 0) die('skip for ICU < 54.1'); ?> --FILE-- <?php ini_set("intl.error_level", E_WARNING); diff --git a/ext/intl/tests/dateformat_create_cal_arg_variant4.phpt b/ext/intl/tests/dateformat_create_cal_arg_variant4.phpt new file mode 100644 index 000000000..4086e4558 --- /dev/null +++ b/ext/intl/tests/dateformat_create_cal_arg_variant4.phpt @@ -0,0 +1,53 @@ +--TEST-- +IntlDateFormatter: several forms of the calendar arg +--SKIPIF-- +<?php +if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?> +<?php if (version_compare(INTL_ICU_VERSION, '54.1') < 0) die('skip for ICU >= 54.1'); ?> +--FILE-- +<?php +ini_set("intl.error_level", E_WARNING); +ini_set("intl.default_locale", "pt_PT"); +ini_set("date.timezone", 'Atlantic/Azores'); + +$ts = strtotime('2012-01-01 00:00:00 UTC'); + +$cal = new IntlGregorianCalendar('UTC', NULL); +$df = new IntlDateFormatter('es_ES', 0, 0, NULL, $cal); +echo $df->format($ts), "\n"; + +$cal = IntlCalendar::createInstance('UTC', 'en@calendar=islamic'); +$df = new IntlDateFormatter('es_ES', 0, 0, NULL, $cal); +echo $df->format($ts), "\n"; + +//override calendar's timezone +$cal = new IntlGregorianCalendar('UTC', NULL); +$df = new IntlDateFormatter('es_ES', 0, 0, 'Europe/Madrid', $cal); +echo $df->format($ts), "\n"; + +//default calendar is gregorian +$df = new IntlDateFormatter('es_ES@calendar=islamic', 0, 0); +echo $df->format($ts), "\n"; + +//try now with traditional +$df = new IntlDateFormatter('es_ES@calendar=islamic', 0, 0, NULL, IntlDateFormatter::TRADITIONAL); +echo $df->format($ts), "\n"; + +//the timezone can be overridden when not specifying a calendar +$df = new IntlDateFormatter('es_ES@calendar=islamic', 0, 0, 'UTC', IntlDateFormatter::TRADITIONAL); +echo $df->format($ts), "\n"; + +$df = new IntlDateFormatter('es_ES', 0, 0, 'UTC', 0); +echo $df->format($ts), "\n"; + +?> +==DONE== +--EXPECTF-- +domingo%S 1 de enero de 2012, 0:00:00 (GMT) +domingo%S 8 de Safar de 1433, 0:00:00 (GMT) +domingo, 1 de enero de 2012, 1:00:00 (hora estándar de Europa central) +sábado, 31 de diciembre de 2011 d. C., 23:00:00 (hora estándar de las Azores) +sábado, 7 de Safar de 1433 AH, 23:00:00 (hora estándar de las Azores) +domingo%S 8 de Safar de 1433 AH, 0:00:00 (GMT) +domingo%S 1 de enero de 2012, 0:00:00 (GMT) +==DONE== diff --git a/ext/intl/tests/dateformat_formatObject_calendar_variant3.phpt b/ext/intl/tests/dateformat_formatObject_calendar_variant3.phpt index 0c5486263..031252414 100644 --- a/ext/intl/tests/dateformat_formatObject_calendar_variant3.phpt +++ b/ext/intl/tests/dateformat_formatObject_calendar_variant3.phpt @@ -4,6 +4,7 @@ IntlDateFormatter::formatObject(): IntlCalendar tests <?php if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?> <?php if (version_compare(INTL_ICU_VERSION, '52.1') < 0) die('skip for ICU >= 52.1'); ?> +<?php if (version_compare(INTL_ICU_VERSION, '54.1') >= 0) die('skip for ICU < 54.1'); ?> --FILE-- <?php ini_set("intl.error_level", E_WARNING); diff --git a/ext/intl/tests/dateformat_formatObject_calendar_variant4.phpt b/ext/intl/tests/dateformat_formatObject_calendar_variant4.phpt new file mode 100644 index 000000000..2ca57c245 --- /dev/null +++ b/ext/intl/tests/dateformat_formatObject_calendar_variant4.phpt @@ -0,0 +1,40 @@ +--TEST-- +IntlDateFormatter::formatObject(): IntlCalendar tests +--SKIPIF-- +<?php +if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?> +<?php if (version_compare(INTL_ICU_VERSION, '54.1') < 0) die('skip for ICU >= 54.1'); ?> +--FILE-- +<?php +ini_set("intl.error_level", E_WARNING); +ini_set("intl.default_locale", "pt_PT"); +ini_set("date.timezone", "Europe/Lisbon"); + +$cal = IntlCalendar::fromDateTime('2012-01-01 00:00:00'); //Europe/Lisbon +echo IntlDateFormatter::formatObject($cal), "\n"; +echo IntlDateFormatter::formatObject($cal, IntlDateFormatter::FULL), "\n"; +echo IntlDateFormatter::formatObject($cal, null, "en-US"), "\n"; +echo IntlDateFormatter::formatObject($cal, array(IntlDateFormatter::SHORT, IntlDateFormatter::FULL), "en-US"), "\n"; +echo IntlDateFormatter::formatObject($cal, 'E y-MM-d HH,mm,ss.SSS v', "en-US"), "\n"; + +$cal = IntlCalendar::fromDateTime('2012-01-01 05:00:00+03:00'); +echo datefmt_format_object($cal, IntlDateFormatter::FULL), "\n"; + +$cal = IntlCalendar::createInstance(null,'en-US@calendar=islamic-civil'); +$cal->setTime(strtotime('2012-01-01 00:00:00')*1000.); +echo IntlDateFormatter::formatObject($cal), "\n"; +echo IntlDateFormatter::formatObject($cal, IntlDateFormatter::FULL, "en-US"), "\n"; + +?> +==DONE== + +--EXPECTF-- +01/01/2012, 00:00:00 +domingo, 1 de janeiro de 2012 às 00:00:00 Hora Padrão %Sda Europa Ocidental +Jan 1, 2012, 12:00:00 AM +1/1/12, 12:00:00 AM Western European Standard %STime +Sun 2012-01-1 00,00,00.000 Portugal Time +domingo, 1 de janeiro de 2012 às 05:00:00 GMT+03:00 +06/02/1433, 00:00:00 +Sunday, Safar 6, 1433 at 12:00:00 AM Western European Standard Time +==DONE== diff --git a/ext/intl/tests/dateformat_formatObject_datetime_variant3.phpt b/ext/intl/tests/dateformat_formatObject_datetime_variant3.phpt index fec88e9d1..5ee72446f 100644 --- a/ext/intl/tests/dateformat_formatObject_datetime_variant3.phpt +++ b/ext/intl/tests/dateformat_formatObject_datetime_variant3.phpt @@ -4,6 +4,7 @@ IntlDateFormatter::formatObject(): DateTime tests <?php if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?> <?php if (version_compare(INTL_ICU_VERSION, '52.1') < 0) die('skip for ICU >= 52.1'); ?> +<?php if (version_compare(INTL_ICU_VERSION, '54.1') >= 0) die('skip for ICU < 54.1'); ?> --FILE-- <?php ini_set("intl.error_level", E_WARNING); diff --git a/ext/intl/tests/dateformat_formatObject_datetime_variant4.phpt b/ext/intl/tests/dateformat_formatObject_datetime_variant4.phpt new file mode 100644 index 000000000..c47e2b59b --- /dev/null +++ b/ext/intl/tests/dateformat_formatObject_datetime_variant4.phpt @@ -0,0 +1,33 @@ +--TEST-- +IntlDateFormatter::formatObject(): DateTime tests +--SKIPIF-- +<?php +if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?> +<?php if (version_compare(INTL_ICU_VERSION, '54.1') < 0) die('skip for ICU >= 54.1'); ?> +--FILE-- +<?php +ini_set("intl.error_level", E_WARNING); +ini_set("intl.default_locale", "pt_PT"); +ini_set("date.timezone", "Europe/Lisbon"); + +$dt = new DateTime('2012-01-01 00:00:00'); //Europe/Lisbon +echo IntlDateFormatter::formatObject($dt), "\n"; +echo IntlDateFormatter::formatObject($dt, IntlDateFormatter::FULL), "\n"; +echo IntlDateFormatter::formatObject($dt, null, "en-US"), "\n"; +echo IntlDateFormatter::formatObject($dt, array(IntlDateFormatter::SHORT, IntlDateFormatter::FULL), "en-US"), "\n"; +echo IntlDateFormatter::formatObject($dt, 'E y-MM-d HH,mm,ss.SSS v', "en-US"), "\n"; + +$dt = new DateTime('2012-01-01 05:00:00+03:00'); +echo IntlDateFormatter::formatObject($dt, IntlDateFormatter::FULL), "\n"; + +?> +==DONE== + +--EXPECTF-- +01/01/2012, 00:00:00 +domingo, 1 de janeiro de 2012 às 00:00:00 Hora Padrão %Sda Europa Ocidental +Jan 1, 2012, 12:00:00 AM +1/1/12, 12:00:00 AM Western European Standard %STime +Sun 2012-01-1 00,00,00.000 Portugal Time +domingo, 1 de janeiro de 2012 às 05:00:00 GMT+03:00 +==DONE== diff --git a/ext/intl/tests/dateformat_get_set_calendar_variant3.phpt b/ext/intl/tests/dateformat_get_set_calendar_variant3.phpt index 5dee52db9..97f2911cf 100644 --- a/ext/intl/tests/dateformat_get_set_calendar_variant3.phpt +++ b/ext/intl/tests/dateformat_get_set_calendar_variant3.phpt @@ -4,6 +4,7 @@ IntlDateFormatter: setCalendar()/getCalendar()/getCalendarObject() <?php if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?> <?php if (version_compare(INTL_ICU_VERSION, '52.1') < 0) die('skip for ICU >= 52.1'); ?> +<?php if (version_compare(INTL_ICU_VERSION, '54.1') >= 0) die('skip for ICU < 54.1'); ?> --FILE-- <?php ini_set("intl.error_level", E_WARNING); diff --git a/ext/intl/tests/dateformat_get_set_calendar_variant4.phpt b/ext/intl/tests/dateformat_get_set_calendar_variant4.phpt new file mode 100644 index 000000000..dc9db0974 --- /dev/null +++ b/ext/intl/tests/dateformat_get_set_calendar_variant4.phpt @@ -0,0 +1,55 @@ +--TEST-- +IntlDateFormatter: setCalendar()/getCalendar()/getCalendarObject() +--SKIPIF-- +<?php +if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?> +<?php if (version_compare(INTL_ICU_VERSION, '54.1') < 0) die('skip for ICU >= 54.1'); ?> +--FILE-- +<?php +ini_set("intl.error_level", E_WARNING); +ini_set("intl.default_locale", "pt_PT"); +ini_set("date.timezone", 'Atlantic/Azores'); + +$ts = strtotime('2012-01-01 00:00:00 UTC'); + +function d(IntlDateFormatter $df) { +global $ts; +echo $df->format($ts), "\n"; +var_dump($df->getCalendar(), +$df->getCalendarObject()->getType(), +$df->getCalendarObject()->getTimeZone()->getId()); +echo "\n"; +} + +$df = new IntlDateFormatter('fr@calendar=islamic', 0, 0, 'Europe/Minsk'); +d($df); + + +//changing the calendar with a cal type should not change tz +$df->setCalendar(IntlDateFormatter::TRADITIONAL); +d($df); + +//but changing with an actual calendar should +$cal = IntlCalendar::createInstance("UTC"); +$df->setCalendar($cal); +d($df); + +?> +==DONE== +--EXPECT-- +dimanche 1 janvier 2012 ap. J.-C. à 03:00:00 heure de Kaliningrad +int(1) +string(9) "gregorian" +string(12) "Europe/Minsk" + +dimanche 8 safar 1433 AH à 03:00:00 heure de Kaliningrad +int(0) +string(7) "islamic" +string(12) "Europe/Minsk" + +dimanche 1 janvier 2012 ap. J.-C. à 00:00:00 UTC +bool(false) +string(9) "gregorian" +string(3) "UTC" + +==DONE== diff --git a/ext/intl/tests/dateformat_get_set_timezone_variant3.phpt b/ext/intl/tests/dateformat_get_set_timezone_variant3.phpt index fe0663e06..a06bbc1ea 100644 --- a/ext/intl/tests/dateformat_get_set_timezone_variant3.phpt +++ b/ext/intl/tests/dateformat_get_set_timezone_variant3.phpt @@ -4,6 +4,7 @@ IntlDateFormatter: get/setTimeZone() <?php if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?> <?php if (version_compare(INTL_ICU_VERSION, '52.1') < 0) die('skip for ICU >= 52.1'); ?> +<?php if (version_compare(INTL_ICU_VERSION, '54.1') >= 0) die('skip for ICU < 54.1'); ?> --FILE-- <?php ini_set("intl.error_level", E_WARNING); diff --git a/ext/intl/tests/dateformat_get_set_timezone_variant4.phpt b/ext/intl/tests/dateformat_get_set_timezone_variant4.phpt new file mode 100644 index 000000000..adedd7496 --- /dev/null +++ b/ext/intl/tests/dateformat_get_set_timezone_variant4.phpt @@ -0,0 +1,62 @@ +--TEST-- +IntlDateFormatter: get/setTimeZone() +--SKIPIF-- +<?php +if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?> +<?php if (version_compare(INTL_ICU_VERSION, '54.1') < 0) die('skip for ICU >= 54.1'); ?> +--FILE-- +<?php +ini_set("intl.error_level", E_WARNING); +ini_set("intl.default_locale", "pt_PT"); +ini_set("date.timezone", 'Atlantic/Azores'); + +$ts = strtotime('2012-01-01 00:00:00 UTC'); + +function d(IntlDateFormatter $df) { +global $ts; +echo $df->format($ts), "\n"; +var_dump( +$df->getTimeZoneID(), +$df->getTimeZone()->getID()); +echo "\n"; +} + +$df = new IntlDateFormatter('pt_PT', 0, 0, 'Europe/Minsk'); +d($df); + +$df->setTimeZone(NULL); +d($df); + +$df->setTimeZone('Europe/Madrid'); +d($df); + +$df->setTimeZone(IntlTimeZone::createTimeZone('Europe/Paris')); +d($df); + +$df->setTimeZone(new DateTimeZone('Europe/Amsterdam')); +d($df); + +?> +==DONE== +--EXPECTF-- +domingo, 1 de janeiro de 2012 às 03:00:00 Hor%s do Extremo Leste da Europa +string(12) "Europe/Minsk" +string(12) "Europe/Minsk" + +sábado, 31 de dezembro de 2011 às 23:00:00 Hor%s Padrão %Sdos Açores +string(15) "Atlantic/Azores" +string(15) "Atlantic/Azores" + +domingo, 1 de janeiro de 2012 às 01:00:00 Hor%s Padrão %Sda Europa Central +string(13) "Europe/Madrid" +string(13) "Europe/Madrid" + +domingo, 1 de janeiro de 2012 às 01:00:00 Hor%s Padrão %Sda Europa Central +string(12) "Europe/Paris" +string(12) "Europe/Paris" + +domingo, 1 de janeiro de 2012 às 01:00:00 Hor%s Padrão %Sda Europa Central +string(16) "Europe/Amsterdam" +string(16) "Europe/Amsterdam" + +==DONE== diff --git a/ext/intl/tests/dateformat_timezone_arg_variations3.phpt b/ext/intl/tests/dateformat_timezone_arg_variations3.phpt index 0ef743ea4..f8aaf2bd4 100644 --- a/ext/intl/tests/dateformat_timezone_arg_variations3.phpt +++ b/ext/intl/tests/dateformat_timezone_arg_variations3.phpt @@ -4,6 +4,7 @@ IntlDateFormatter: several forms of the timezone arg <?php if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?> <?php if (version_compare(INTL_ICU_VERSION, '52.1') < 0) die('skip for ICU >= 52.1'); ?> +<?php if (version_compare(INTL_ICU_VERSION, '54.1') >= 0) die('skip for ICU < 54.1'); ?> --FILE-- <?php ini_set("intl.error_level", E_WARNING); diff --git a/ext/intl/tests/dateformat_timezone_arg_variations4.phpt b/ext/intl/tests/dateformat_timezone_arg_variations4.phpt new file mode 100644 index 000000000..7be709a66 --- /dev/null +++ b/ext/intl/tests/dateformat_timezone_arg_variations4.phpt @@ -0,0 +1,46 @@ +--TEST-- +IntlDateFormatter: several forms of the timezone arg +--SKIPIF-- +<?php +if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?> +<?php if (version_compare(INTL_ICU_VERSION, '54.1') < 0) die('skip for ICU >= 54.1'); ?> +--FILE-- +<?php +ini_set("intl.error_level", E_WARNING); +ini_set("date.timezone", 'Atlantic/Azores'); + +$ts = strtotime('2012-01-01 00:00:00 UTC'); + +//should use Atlantic/Azores +$df = new IntlDateFormatter('es_ES', 0, 0, NULL); +echo $df->format($ts), "\n"; + +$df = new IntlDateFormatter('es_ES', 0, 0, 'Europe/Amsterdam'); +echo $df->format($ts), "\n"; + +$df = new IntlDateFormatter('es_ES', 0, 0, new DateTimeZone('Europe/Lisbon')); +echo $df->format($ts), "\n"; + +$df = new IntlDateFormatter('es_ES', 0, 0, IntlTimeZone::createTimeZone('America/New_York')); +echo $df->format($ts), "\n"; + +//time zone has priority +$df = new IntlDateFormatter('es_ES', 0, 0, 'Europe/Amsterdam', new IntlGregorianCalendar('Europe/Lisbon')); +echo $df->format($ts), "\n"; + +//calendar has priority +$df = new IntlDateFormatter('es_ES', 0, 0, NULL, new IntlGregorianCalendar('Europe/Lisbon')); +echo $df->format($ts), "\n"; + +$df = new IntlDateFormatter('es_ES', 0, 0, 'Europe/Amsterdam', 0); +echo $df->format($ts), "\n"; + +--EXPECTF-- +sábado, 31 de diciembre de 2011, 23:00:00 (hora estándar de las Azores) +domingo, 1 de enero de 2012, 1:00:00 (hora estándar de Europa central) +domingo, 1 de enero de 2012, 0:00:00 (hora estándar de Europa occidental) +sábado, 31 de diciembre de 2011, 19:00:00 (hora estándar oriental) +domingo, 1 de enero de 2012, 1:00:00 (hora estándar de Europa central) +domingo, 1 de enero de 2012, 0:00:00 (hora estándar de Europa occidental) +domingo, 1 de enero de 2012, 1:00:00 (hora estándar de Europa central) + diff --git a/ext/intl/tests/formatter_format4.phpt b/ext/intl/tests/formatter_format4.phpt index 88d457bdb..96dd7be53 100644 --- a/ext/intl/tests/formatter_format4.phpt +++ b/ext/intl/tests/formatter_format4.phpt @@ -1,8 +1,9 @@ --TEST-- -numfmt_format() icu >= 53.1 +numfmt_format() icu >= 53.1 && icu < 54.1 --SKIPIF-- <?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?> <?php if (version_compare(INTL_ICU_VERSION, '53.1') < 0) die('skip for ICU >= 53.1'); ?> +<?php if (version_compare(INTL_ICU_VERSION, '54.1') >= 0) die('skip for ICU < 54.1'); ?> --FILE-- <?php diff --git a/ext/intl/tests/formatter_format5.phpt b/ext/intl/tests/formatter_format5.phpt new file mode 100644 index 000000000..cbaf140a0 --- /dev/null +++ b/ext/intl/tests/formatter_format5.phpt @@ -0,0 +1,130 @@ +--TEST-- +numfmt_format() icu >= 54.1 +--SKIPIF-- +<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?> +<?php if (version_compare(INTL_ICU_VERSION, '54.1') < 0) die('skip for ICU >= 54.1'); ?> +--FILE-- +<?php + +/* + * Format a number using misc locales/patterns. + */ + +/* + * TODO: doesn't pass on ICU 3.6 because 'ru' and 'de' locales changed + * currency and percent formatting. + */ + +function ut_main() +{ + $styles = array( + NumberFormatter::PATTERN_DECIMAL => '##.#####################', + NumberFormatter::DECIMAL => '', + NumberFormatter::CURRENCY => '', + NumberFormatter::PERCENT => '', + NumberFormatter::SCIENTIFIC => '', + NumberFormatter::SPELLOUT => '@@@@@@@', + NumberFormatter::ORDINAL => '', + NumberFormatter::DURATION => '', + NumberFormatter::PATTERN_RULEBASED => '#####.###', + 1234999, // bad one + ); + + $integer = array( + NumberFormatter::ORDINAL => '', + NumberFormatter::DURATION => '', + ); + $locales = array( + 'en_US', + 'ru_UA', + 'de', + 'fr', + 'en_UK' + ); + + $str_res = ''; + $number = 1234567.891234567890000; + + foreach( $locales as $locale ) + { + $str_res .= "\nLocale is: $locale\n"; + foreach( $styles as $style => $pattern ) + { + $fmt = ut_nfmt_create( $locale, $style, $pattern ); + + if(!$fmt) { + $str_res .= "Bad formatter!\n"; + continue; + } + $str_res .= dump( isset($integer[$style])?ut_nfmt_format( $fmt, $number, NumberFormatter::TYPE_INT32):ut_nfmt_format( $fmt, $number ) ) . "\n"; + } + } + return $str_res; +} + +include_once( 'ut_common.inc' ); + +// Run the test +ut_run(); + +?> +--EXPECTREGEX-- +Locale is: en_US +'1234567.89123457' +'1,234,567.891' +'\$1,234,567.89' +'123,456,789%' +'1.23456789123457E6' +'one million,? two hundred (and )?thirty-four thousand,? five hundred (and )?sixty-seven point eight nine one two three four five seven' +'1,234,567(th|ᵗʰ)' +'342:56:07' +'#####.###' +'USD1,234,567.89' + +Locale is: ru_UA +'1234567,89123457' +'1 234 567,891' +'1 234 567,89 ?(грн\.|₴)' +'123 456 789 ?%' +'1,23456789123457E6' +'один миллион двести тридцать четыре тысячи пятьсот шестьдесят семь запятая восемь девять один два три четыре пять семь' +'1 234 567.?' +'1 234 567' +'#####.###' +'1 234 567,89 UAH' + +Locale is: de +'1234567,89123457' +'1.234.567,891' +'(¤ )?1.234.567,89( ¤)?' +'123\.456\.789 %' +'1,23456789123457E6' +'eine Million zweihundertvierunddreißigtausendfünfhundertsiebenundsechzig Komma acht neun eins zwei drei vier fünf sieben' +'1.234.567.?' +'1.234.567' +'#####.###' +'1.234.567,89 ¤¤' + +Locale is: fr +'1234567,89123457' +'1 234 567,891' +'1 234 567,89 ¤' +'123 456 789 ?%' +'1,23456789123457E6' +'un million deux cent trente-quatre mille cinq cent soixante-sept virgule huit neuf un deux trois quatre cinq sept' +'1 234 567e' +'1 234 567' +'#####.###' +'1 234 567,89 ¤¤' + +Locale is: en_UK +'1234567.89123457' +'1,234,567.891' +'¤1,234,567.89' +'123,456,789%' +'1.23456789123457E6' +'one million,? two hundred (and )?thirty-four thousand,? five hundred (and )?sixty-seven point eight nine one two three four five seven' +'1,234,567(th|ᵗʰ)' +'342:56:07' +'#####.###' +'¤¤1,234,567.89' diff --git a/ext/intl/tests/msgfmt_format_intlcalendar_variant3.phpt b/ext/intl/tests/msgfmt_format_intlcalendar_variant3.phpt index c390366b5..766c508d3 100644 --- a/ext/intl/tests/msgfmt_format_intlcalendar_variant3.phpt +++ b/ext/intl/tests/msgfmt_format_intlcalendar_variant3.phpt @@ -4,6 +4,7 @@ MessageFormat accepts IntlCalendar args <?php if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?> <?php if (version_compare(INTL_ICU_VERSION, '52.1') < 0) die('skip for ICU >= 52.1'); ?> +<?php if (version_compare(INTL_ICU_VERSION, '54.1') >= 0) die('skip for ICU < 54.1'); ?> --FILE-- <?php ini_set("intl.error_level", E_WARNING); diff --git a/ext/intl/tests/msgfmt_format_intlcalendar_variant4.phpt b/ext/intl/tests/msgfmt_format_intlcalendar_variant4.phpt new file mode 100644 index 000000000..8f778b902 --- /dev/null +++ b/ext/intl/tests/msgfmt_format_intlcalendar_variant4.phpt @@ -0,0 +1,30 @@ +--TEST-- +MessageFormat accepts IntlCalendar args +--SKIPIF-- +<?php +if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?> +<?php if (version_compare(INTL_ICU_VERSION, '54.1') < 0) die('skip for ICU >= 54.1'); ?> +--FILE-- +<?php +ini_set("intl.error_level", E_WARNING); +//ini_set("intl.default_locale", "nl"); +ini_set('date.timezone', 'Europe/Lisbon'); + +$cal = new IntlGregorianCalendar(2012,04,17,17,35,36); + +$msgf = new MessageFormatter('pt_PT', '{0,date,full} {0,time,h:m:s a V}'); +echo $msgf->format(array($cal)), "\n"; + +//NOT FIXED: +/*$msgf = new MessageFormatter('en_US', +'{1, select, date {{0,date,full}} other {{0,time,h:m:s a V}}}'); + +echo "msgf2: ", $msgf->format(array($time, 'date')), " ", + $msgf->format(array($time, 'time')), "\n"; +*/ + +?> +==DONE== +--EXPECT-- +quinta-feira, 17 de maio de 2012 5:35:36 da tarde ptlis +==DONE== diff --git a/ext/libxml/libxml.c b/ext/libxml/libxml.c index 3114b2519..3c9f21edb 100644 --- a/ext/libxml/libxml.c +++ b/ext/libxml/libxml.c @@ -1138,7 +1138,7 @@ int php_libxml_register_export(zend_class_entry *ce, php_libxml_export_node expo { php_libxml_func_handler export_hnd; - /* Initialize in case this module hasnt been loaded yet */ + /* Initialize in case this module hasn't been loaded yet */ php_libxml_initialize(); export_hnd.export_func = export_function; diff --git a/ext/mbstring/README_PHP3-i18n-ja b/ext/mbstring/README_PHP3-i18n-ja index 869fe3e49..eabe9e90f 100644 --- a/ext/mbstring/README_PHP3-i18n-ja +++ b/ext/mbstring/README_PHP3-i18n-ja @@ -371,7 +371,7 @@ o i18n.internal_encoding - internal encoding encodings, following conditions have to be satisfied in order to use them: - per byte encoding - - single byte charactor in range of 00h-7fh which is compatible + - single byte character in range of 00h-7fh which is compatible with ASCII - multibyte without 00h-7fh In case of Japanese, EUC-JP and UTF-8 are the only encoding that @@ -408,7 +408,7 @@ o i18n.script_encoding - script encoding entering the script parser. Be aware that auto detection may fail under some conditions. - For best auto detection, add multibyte charactor at beginning of + For best auto detection, add multibyte character at beginning of script. diff --git a/ext/mbstring/libmbfl/filters/unicode_prop.h b/ext/mbstring/libmbfl/filters/unicode_prop.h index d21ec61df..4feb5756e 100644 --- a/ext/mbstring/libmbfl/filters/unicode_prop.h +++ b/ext/mbstring/libmbfl/filters/unicode_prop.h @@ -22,7 +22,7 @@ * */ -/* charactor property table */ +/* character property table */ #define MBFL_CHP_CTL 0x01 #define MBFL_CHP_DIGIT 0x02 #define MBFL_CHP_UALPHA 0x04 diff --git a/ext/mbstring/libmbfl/mbfl/mbfl_consts.h b/ext/mbstring/libmbfl/mbfl/mbfl_consts.h index 6a630c8fc..b11119a80 100644 --- a/ext/mbstring/libmbfl/mbfl/mbfl_consts.h +++ b/ext/mbstring/libmbfl/mbfl/mbfl_consts.h @@ -45,7 +45,7 @@ #define MBFL_ENCTYPE_ENC_STRM 0x00002000 #define MBFL_ENCTYPE_GL_UNSAFE 0x00004000 -/* wchar plane, special charactor */ +/* wchar plane, special character */ #define MBFL_WCSPLANE_MASK 0xffff #define MBFL_WCSPLANE_UCS2MAX 0x00010000 #define MBFL_WCSPLANE_UTF32MAX 0x00110000 diff --git a/ext/mbstring/tests/mb_strtolower_variation3.phpt b/ext/mbstring/tests/mb_strtolower_variation3.phpt index 08b346785..99256e1ec 100644 --- a/ext/mbstring/tests/mb_strtolower_variation3.phpt +++ b/ext/mbstring/tests/mb_strtolower_variation3.phpt @@ -14,7 +14,7 @@ function_exists('mb_strtolower') or die("skip mb_strtolower() is not available i /* * Pass a Japanese string and a mixed Japanese and ASCII string to mb_strtolower - * to check correct conversion is occuring (Japanese characters should not be converted). + * to check correct conversion is occurring (Japanese characters should not be converted). */ echo "*** Testing mb_strtolower() : usage variations ***\n"; diff --git a/ext/mbstring/tests/mb_strtoupper_variation3.phpt b/ext/mbstring/tests/mb_strtoupper_variation3.phpt index a4bf3b128..f0cb0fa47 100644 --- a/ext/mbstring/tests/mb_strtoupper_variation3.phpt +++ b/ext/mbstring/tests/mb_strtoupper_variation3.phpt @@ -14,7 +14,7 @@ function_exists('mb_strtoupper') or die("skip mb_strtoupper() is not available i /* * Pass a Japanese string and a mixed Japanese and ASCII string to mb_strtolower - * to check correct conversion is occuring (Japanese characters should not be converted). + * to check correct conversion is occurring (Japanese characters should not be converted). */ echo "*** Testing mb_strtoupper() : usage variations ***\n"; diff --git a/ext/mcrypt/mcrypt.c b/ext/mcrypt/mcrypt.c index 5fc632b05..f336ba8b7 100644 --- a/ext/mcrypt/mcrypt.c +++ b/ext/mcrypt/mcrypt.c @@ -578,8 +578,11 @@ PHP_FUNCTION(mcrypt_generic_init) if (iv_len != iv_size) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Iv size incorrect; supplied length: %d, needed: %d", iv_len, iv_size); + if (iv_len > iv_size) { + iv_len = iv_size; + } } - memcpy(iv_s, iv, iv_size); + memcpy(iv_s, iv, iv_len); mcrypt_generic_deinit(pm->td); result = mcrypt_generic_init(pm->td, key_s, key_size, iv_s); @@ -600,8 +603,9 @@ PHP_FUNCTION(mcrypt_generic_init) php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown error"); break; } + } else { + pm->init = 1; } - pm->init = 1; RETVAL_LONG(result); efree(iv_s); diff --git a/ext/mcrypt/tests/mcrypt_ecb_3des_decrypt.phpt b/ext/mcrypt/tests/mcrypt_ecb_3des_decrypt.phpt index e718107b9..ace9f829d 100644 --- a/ext/mcrypt/tests/mcrypt_ecb_3des_decrypt.phpt +++ b/ext/mcrypt/tests/mcrypt_ecb_3des_decrypt.phpt @@ -23,7 +23,7 @@ $cipher = MCRYPT_TRIPLEDES; $data = b"This is the secret message which must be encrypted"; $mode = MCRYPT_DECRYPT; -// tripledes uses keys upto 192 bits (24 bytes) +// tripledes uses keys up to 192 bits (24 bytes) $keys = array( b'12345678', b'12345678901234567890', diff --git a/ext/mcrypt/tests/mcrypt_ecb_3des_encrypt.phpt b/ext/mcrypt/tests/mcrypt_ecb_3des_encrypt.phpt index 7e2957977..65ef3ad8e 100644 --- a/ext/mcrypt/tests/mcrypt_ecb_3des_encrypt.phpt +++ b/ext/mcrypt/tests/mcrypt_ecb_3des_encrypt.phpt @@ -23,7 +23,7 @@ $cipher = MCRYPT_TRIPLEDES; $data = b"This is the secret message which must be encrypted"; $mode = MCRYPT_ENCRYPT; -// tripledes uses keys upto 192 bits (24 bytes) +// tripledes uses keys up to 192 bits (24 bytes) $keys = array( b'12345678', b'12345678901234567890', diff --git a/ext/mcrypt/tests/mcrypt_encrypt_3des_cbc.phpt b/ext/mcrypt/tests/mcrypt_encrypt_3des_cbc.phpt index 51a64943b..8b3cbd836 100644 --- a/ext/mcrypt/tests/mcrypt_encrypt_3des_cbc.phpt +++ b/ext/mcrypt/tests/mcrypt_encrypt_3des_cbc.phpt @@ -21,13 +21,13 @@ echo "*** Testing mcrypt_encrypt() : TripleDES functionality ***\n"; //test tripledes, aes //test different lengths of key, iv //test no iv being passed on CBC, ECB -//test upto 32 bytes with unlimited strength +//test up to 32 bytes with unlimited strength $cipher = MCRYPT_TRIPLEDES; $mode = MCRYPT_MODE_CBC; $data = b'This is the secret message which must be encrypted'; -// tripledes uses keys upto 192 bits (24 bytes) +// tripledes uses keys up to 192 bits (24 bytes) $keys = array( b'12345678', b'12345678901234567890', diff --git a/ext/mcrypt/tests/mcrypt_encrypt_3des_ecb.phpt b/ext/mcrypt/tests/mcrypt_encrypt_3des_ecb.phpt index 941eb7935..ea6b2c216 100644 --- a/ext/mcrypt/tests/mcrypt_encrypt_3des_ecb.phpt +++ b/ext/mcrypt/tests/mcrypt_encrypt_3des_ecb.phpt @@ -20,7 +20,7 @@ $cipher = MCRYPT_TRIPLEDES; $mode = MCRYPT_MODE_ECB; $data = b'This is the secret message which must be encrypted'; -// tripledes uses keys upto 192 bits (24 bytes) +// tripledes uses keys up to 192 bits (24 bytes) $keys = array( b'12345678', b'12345678901234567890', diff --git a/ext/mcrypt/tests/mcrypt_rijndael128_128BitKey.phpt b/ext/mcrypt/tests/mcrypt_rijndael128_128BitKey.phpt index 621f7b1db..5f5a4bea5 100644 --- a/ext/mcrypt/tests/mcrypt_rijndael128_128BitKey.phpt +++ b/ext/mcrypt/tests/mcrypt_rijndael128_128BitKey.phpt @@ -30,7 +30,7 @@ $cipher = MCRYPT_RIJNDAEL_128; $mode = MCRYPT_MODE_CBC; $data = b'This is the secret message which must be encrypted'; -// keys upto 128 bits (16 bytes) +// keys up to 128 bits (16 bytes) $keys = array( null, '', diff --git a/ext/mysqli/tests/mysqli_ps_select_union.phpt b/ext/mysqli/tests/mysqli_ps_select_union.phpt index fed81b309..a4659c426 100644 --- a/ext/mysqli/tests/mysqli_ps_select_union.phpt +++ b/ext/mysqli/tests/mysqli_ps_select_union.phpt @@ -44,8 +44,8 @@ require_once('skipifconnectfailure.inc'); if ($IS_MYSQLND) { /* Advantage mysqlnd - - The metadata mysqlnd has availabe after prepare is better than - the one made availabe by the MySQL Client Library (libmysql). + The metadata mysqlnd has available after prepare is better than + the one made available by the MySQL Client Library (libmysql). "libmysql" will give wrong results and that is OK - http://bugs.mysql.com/bug.php?id=47483 */ diff --git a/ext/mysqli/tests/mysqli_result_references.phpt b/ext/mysqli/tests/mysqli_result_references.phpt index b6bce0d98..1cf0ffe09 100644 --- a/ext/mysqli/tests/mysqli_result_references.phpt +++ b/ext/mysqli/tests/mysqli_result_references.phpt @@ -19,7 +19,7 @@ require_once('skipifconnectfailure.inc'); $idx = 0; while ($row = mysqli_fetch_assoc($res)) { - /* mysqlnd: force seperation - create copies */ + /* mysqlnd: force separation - create copies */ $references[$idx] = array( 'id' => &$row['id'], 'label' => $row['label'] . ''); @@ -30,7 +30,7 @@ require_once('skipifconnectfailure.inc'); mysqli_data_seek($res, 0); while ($row = mysqli_fetch_assoc($res)) { - /* mysqlnd: force seperation - create copies */ + /* mysqlnd: force separation - create copies */ $references[$idx] = array( 'id' => &$row['id'], 'label' => $row['label'] . ''); @@ -48,7 +48,7 @@ require_once('skipifconnectfailure.inc'); printf("[003] [%d] %s\n", mysqli_errno($link), mysqli_error($link)); while ($row = mysqli_fetch_assoc($res)) { - /* mysqlnd: force seperation - create copies*/ + /* mysqlnd: force separation - create copies*/ $references[$idx] = array( 'id' => &$row['id'], 'label' => $row['label'] . ''); @@ -151,4 +151,4 @@ array(1) refcount(2){ %unicode|string%(1) "a" refcount(1) } } -done!
\ No newline at end of file +done! diff --git a/ext/mysqli/tests/mysqli_result_references_mysqlnd.phpt b/ext/mysqli/tests/mysqli_result_references_mysqlnd.phpt index 384f85fbb..c100c4a29 100644 --- a/ext/mysqli/tests/mysqli_result_references_mysqlnd.phpt +++ b/ext/mysqli/tests/mysqli_result_references_mysqlnd.phpt @@ -48,7 +48,7 @@ if ((version_compare(PHP_VERSION, '5.9.9', '>') == 1)) $references[$idx]['row_copy'] = $rows[$i]; $references[$idx]['id_ref'] = &$rows[$i]['id']; $references[$idx]['id_copy'] = $rows[$i]['id']; - /* enforce seperation */ + /* enforce separation */ $references[$idx]['id_copy_mod']= $rows[$i]['id'] + 0; } mysqli_free_result($res); @@ -116,4 +116,4 @@ array(2) refcount(2){ long(2) refcount(1) } } -done!
\ No newline at end of file +done! diff --git a/ext/mysqli/tests/mysqli_stmt_bind_param_check_param_no_change.phpt b/ext/mysqli/tests/mysqli_stmt_bind_param_check_param_no_change.phpt index 03d15902a..e7bce112a 100644 --- a/ext/mysqli/tests/mysqli_stmt_bind_param_check_param_no_change.phpt +++ b/ext/mysqli/tests/mysqli_stmt_bind_param_check_param_no_change.phpt @@ -21,9 +21,9 @@ require_once('skipifconnectfailure.inc'); echo "Test 1:\n"; $stmt = $link->prepare("SELECT ? FOO"); - var_dump($foo); // here you can see the bar member var beeing a string + var_dump($foo); // here you can see the bar member var being a string $stmt->bind_param("s", $foo->bar); - var_dump($foo); // this will show $foo->bar beeing a reference string + var_dump($foo); // this will show $foo->bar being a reference string $stmt->bind_result($one); $stmt->execute(); $stmt->fetch(); diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c index faa3641eb..42b4e913b 100644 --- a/ext/opcache/ZendAccelerator.c +++ b/ext/opcache/ZendAccelerator.c @@ -890,12 +890,12 @@ static inline int do_validate_timestamps(zend_persistent_script *persistent_scri int validate_timestamp_and_record(zend_persistent_script *persistent_script, zend_file_handle *file_handle TSRMLS_DC) { if (ZCG(accel_directives).revalidate_freq && - (persistent_script->dynamic_members.revalidate >= ZCSG(revalidate_at))) { + persistent_script->dynamic_members.revalidate >= ZCG(request_time)) { return SUCCESS; } else if (do_validate_timestamps(persistent_script, file_handle TSRMLS_CC) == FAILURE) { return FAILURE; } else { - persistent_script->dynamic_members.revalidate = ZCSG(revalidate_at); + persistent_script->dynamic_members.revalidate = ZCG(request_time) + ZCG(accel_directives).revalidate_freq; return SUCCESS; } } @@ -1462,7 +1462,7 @@ static zend_persistent_script *compile_and_cache_file(zend_file_handle *file_han * otherwise we have a race-condition. */ new_persistent_script->timestamp = timestamp; - new_persistent_script->dynamic_members.revalidate = ZCSG(revalidate_at); + new_persistent_script->dynamic_members.revalidate = ZCG(request_time) + ZCG(accel_directives).revalidate_freq; } if (file_handle->opened_path) { @@ -2168,13 +2168,6 @@ static void accel_activate(void) zend_accel_error(ACCEL_LOG_WARNING, "Internal functions count changed - was %d, now %d", ZCG(internal_functions_count), zend_hash_num_elements(&ZCG(function_table))); } - if (ZCG(accel_directives).validate_timestamps) { - time_t now = ZCG(request_time); - if (now > ZCSG(revalidate_at) + (time_t)ZCG(accel_directives).revalidate_freq) { - ZCSG(revalidate_at) = now; - } - } - ZCG(cwd) = NULL; SHM_PROTECT(); @@ -2637,10 +2630,6 @@ static int accel_startup(zend_extension *extension) zend_resolve_path = persistent_zend_resolve_path; #endif - if (ZCG(accel_directives).validate_timestamps) { - ZCSG(revalidate_at) = zend_accel_get_time() + ZCG(accel_directives).revalidate_freq; - } - /* Override chdir() function */ if (zend_hash_find(CG(function_table), "chdir", sizeof("chdir"), (void**)&func) == SUCCESS && func->type == ZEND_INTERNAL_FUNCTION) { diff --git a/ext/opcache/ZendAccelerator.h b/ext/opcache/ZendAccelerator.h index a25e76624..008e222e4 100644 --- a/ext/opcache/ZendAccelerator.h +++ b/ext/opcache/ZendAccelerator.h @@ -298,7 +298,6 @@ typedef struct _zend_accel_shared_globals { unsigned long restart_in; #endif zend_bool restart_in_progress; - time_t revalidate_at; #if ZEND_EXTENSION_API_NO > PHP_5_3_X_API_NO /* Interned Strings Support */ char *interned_strings_start; diff --git a/ext/opcache/tests/bug68104.phpt b/ext/opcache/tests/bug68104.phpt new file mode 100644 index 000000000..8d3bf70a4 --- /dev/null +++ b/ext/opcache/tests/bug68104.phpt @@ -0,0 +1,19 @@ +--TEST-- +Bug #68104 (Segfault while pre-evaluating a disabled function) +--CREDITS-- +manuel <manuel@mausz.at> +--INI-- +opcache.enable=1 +opcache.enable_cli=1 +disable_functions=dl +--SKIPIF-- +<?php require_once('skipif.inc'); ?> +--FILE-- +<?php +var_dump(is_callable("dl")); +dl("a.so"); +?> +--EXPECTF-- +bool(true) + +Warning: dl() has been disabled for security reasons in %sbug68104.php on line %d diff --git a/ext/openssl/tests/bug64802.phpt b/ext/openssl/tests/bug64802.phpt index be0b5f9b5..3a1e4fb03 100644 --- a/ext/openssl/tests/bug64802.phpt +++ b/ext/openssl/tests/bug64802.phpt @@ -3,7 +3,7 @@ Bug #64802: openssl_x509_parse fails to parse subject properly in some cases --SKIPIF-- <?php if (!extension_loaded("openssl")) die("skip"); -if (!defined(OPENSSL_KEYTYPE_EC)) die("skip no EC available); +if (!defined('OPENSSL_KEYTYPE_EC')) die("skip no EC available"); ?> --FILE-- <?php diff --git a/ext/pcntl/README b/ext/pcntl/README index cadd11121..7b80924e4 100644 --- a/ext/pcntl/README +++ b/ext/pcntl/README @@ -1,7 +1,7 @@ Process Control Module for PHP (pcntl) This module will attempt to implement all features related to process spawning and -control (fork(), waitpid(), signal(), WIF's, etc). This is extremly experimental, +control (fork(), waitpid(), signal(), WIF's, etc). This is extremely experimental, with hope to become stable on most UNIX's. I greatly apreciate any feedback, fixes, and or suggestions on how to improve/better implement this functionality. diff --git a/ext/pcre/pcrelib/ChangeLog b/ext/pcre/pcrelib/ChangeLog index 1e5fd3274..93e4cdfcc 100644 --- a/ext/pcre/pcrelib/ChangeLog +++ b/ext/pcre/pcrelib/ChangeLog @@ -1424,7 +1424,7 @@ Version 8.10 25-Jun-2010 7. Minor change to pcretest.c to avoid a compiler warning. -8. Added four artifical Unicode properties to help with an option to make +8. Added four artificial Unicode properties to help with an option to make \s etc use properties (see next item). The new properties are: Xan (alphanumeric), Xsp (Perl space), Xps (POSIX space), and Xwd (word). @@ -4049,7 +4049,7 @@ Version 4.3 21-May-03 (i) The utf8_table... variables are now declared "const". (ii) The code for \cx, which used the "case flipping" table to upper case - lower case letters, now just substracts 32. This is ASCII-specific, + lower case letters, now just subtracts 32. This is ASCII-specific, but the whole concept of \cx is ASCII-specific, so it seems reasonable. diff --git a/ext/pcre/pcrelib/HACKING b/ext/pcre/pcrelib/HACKING index 691b7a14e..839550421 100644 --- a/ext/pcre/pcrelib/HACKING +++ b/ext/pcre/pcrelib/HACKING @@ -360,7 +360,7 @@ reference number if the reference is to a unique capturing group (either by number or by name). When named groups are used, there may be more than one group with the same name. In this case, a reference by name generates OP_DNREF or OP_DNREFI. These are followed by two counts: the index (not the byte offset) -in the group name table of the first entry for the requred name, followed by +in the group name table of the first entry for the required name, followed by the number of groups with the same name. diff --git a/ext/pcre/pcrelib/README b/ext/pcre/pcrelib/README index 51197df72..fb7f034f6 100644 --- a/ext/pcre/pcrelib/README +++ b/ext/pcre/pcrelib/README @@ -391,7 +391,7 @@ library. They are also documented in the pcrebuild man page. avoided by linking with libedit (which has a BSD licence) instead. Enabling libreadline causes the -lreadline option to be added to the pcretest - build. In many operating environments with a sytem-installed readline + build. In many operating environments with a system-installed readline library this is sufficient. However, in some environments (e.g. if an unmodified distribution version of readline is in use), it may be necessary to specify something like LIBS="-lncurses" as well. This is because, to quote diff --git a/ext/pcre/pcrelib/doc/pcre.txt b/ext/pcre/pcrelib/doc/pcre.txt index 9d69515c3..fa1aba013 100644 --- a/ext/pcre/pcrelib/doc/pcre.txt +++ b/ext/pcre/pcrelib/doc/pcre.txt @@ -1240,7 +1240,7 @@ PCRETEST OPTION FOR LIBREADLINE SUPPORT pcretest linked in this way, there may be licensing issues. Setting this option causes the -lreadline option to be added to the - pcretest build. In many operating environments with a sytem-installed + pcretest build. In many operating environments with a system-installed libreadline this is sufficient. However, in some environments (e.g. if an unmodified distribution version of readline is in use), some extra configuration may be necessary. The INSTALL file for libreadline says diff --git a/ext/pcre/pcrelib/pcre_exec.c b/ext/pcre/pcrelib/pcre_exec.c index a3f0c1923..2d0230f4f 100644 --- a/ext/pcre/pcrelib/pcre_exec.c +++ b/ext/pcre/pcrelib/pcre_exec.c @@ -1040,7 +1040,7 @@ for (;;) the result of a recursive call to match() whatever happened so it was possible to reduce stack usage by turning this into a tail recursion, except in the case of a possibly empty group. However, now that there is - the possiblity of (*THEN) occurring in the final alternative, this + the possibility of (*THEN) occurring in the final alternative, this optimization is no longer always possible. We can optimize if we know there are no (*THEN)s in the pattern; at present diff --git a/ext/pcre/pcrelib/pcre_study.c b/ext/pcre/pcrelib/pcre_study.c index c2aff517a..5884c1ec4 100644 --- a/ext/pcre/pcrelib/pcre_study.c +++ b/ext/pcre/pcrelib/pcre_study.c @@ -993,7 +993,7 @@ do tcode = set_table_bit(start_bits, tcode + 1, TRUE, cd, utf); break; - /* Single-char upto sets the bit and tries the next */ + /* Single-char up to sets the bit and tries the next */ case OP_UPTO: case OP_MINUPTO: diff --git a/ext/pcre/pcrelib/pcredemo.c b/ext/pcre/pcrelib/pcredemo.c index 946aba45c..1ca77f153 100644 --- a/ext/pcre/pcrelib/pcredemo.c +++ b/ext/pcre/pcrelib/pcredemo.c @@ -144,7 +144,7 @@ if (rc < 0) return 1; } -/* Match succeded */ +/* Match succeeded */ printf("\nMatch succeeded at offset %d\n", ovector[0]); @@ -362,7 +362,7 @@ for (;;) return 1; } - /* Match succeded */ + /* Match succeeded */ printf("\nMatch succeeded again at offset %d\n", ovector[0]); diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c index 52d43ced3..55aa3de2e 100644 --- a/ext/pcre/php_pcre.c +++ b/ext/pcre/php_pcre.c @@ -646,7 +646,7 @@ PHPAPI void php_pcre_match_impl(pcre_cache_entry *pce, char *subject, int subjec } offsets = (int *)safe_emalloc(size_offsets, sizeof(int), 0); - + memset(offsets, 0, size_offsets*sizeof(int)); /* Allocate match sets array and initialize the values. */ if (global && subpats && subpats_order == PREG_PATTERN_ORDER) { match_sets = (zval **)safe_emalloc(num_subpats, sizeof(zval *), 0); diff --git a/ext/pdo/pdo_dbh.c b/ext/pdo/pdo_dbh.c index 32e6e1bdd..dc4babf0d 100644 --- a/ext/pdo/pdo_dbh.c +++ b/ext/pdo/pdo_dbh.c @@ -494,7 +494,7 @@ static void pdo_stmt_construct(pdo_stmt_t *stmt, zval *object, zend_class_entry } /* }}} */ -/* {{{ proto object PDO::prepare(string statment [, array options]) +/* {{{ proto object PDO::prepare(string statement [, array options]) Prepares a statement for execution and returns a statement object */ static PHP_METHOD(PDO, prepare) { diff --git a/ext/pdo/pdo_stmt.c b/ext/pdo/pdo_stmt.c index 2593d02e9..7579a7ad6 100644 --- a/ext/pdo/pdo_stmt.c +++ b/ext/pdo/pdo_stmt.c @@ -2049,7 +2049,7 @@ static PHP_METHOD(PDOStatement, setFetchMode) /* }}} */ /* {{{ proto bool PDOStatement::nextRowset() - Advances to the next rowset in a multi-rowset statement handle. Returns true if it succeded, false otherwise */ + Advances to the next rowset in a multi-rowset statement handle. Returns true if it succeeded, false otherwise */ static int pdo_stmt_do_next_rowset(pdo_stmt_t *stmt TSRMLS_DC) { diff --git a/ext/pdo/tests/bug_39656.phpt b/ext/pdo/tests/bug_39656.phpt index 7d113ef4a..9ee54916b 100644 --- a/ext/pdo/tests/bug_39656.phpt +++ b/ext/pdo/tests/bug_39656.phpt @@ -1,5 +1,5 @@ --TEST-- -PDO Common: Bug #39656 (Crash when calling fetch() on a PDO statment object after closeCursor()) +PDO Common: Bug #39656 (Crash when calling fetch() on a PDO statement object after closeCursor()) --SKIPIF-- <?php if (!extension_loaded('pdo')) die('skip'); diff --git a/ext/pdo_mysql/tests/pdo_mysql_stmt_blobs.phpt b/ext/pdo_mysql/tests/pdo_mysql_stmt_blobs.phpt index 96489ef86..f809e02b1 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_stmt_blobs.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_stmt_blobs.phpt @@ -49,7 +49,7 @@ MySQLPDOTest::skip(); } if ($label !== $value) { - printf("[%03d + 3] Returned value seems to be wrong (%d vs. %d charachters). Check manually\n", + printf("[%03d + 3] Returned value seems to be wrong (%d vs. %d characters). Check manually\n", $offset, strlen($label), strlen($value)); return false; } @@ -64,7 +64,7 @@ MySQLPDOTest::skip(); $ret = $stmt->fetch(PDO::FETCH_ASSOC); if ($ret['label'] !== $value) { - printf("[%03d + 3] Returned value seems to be wrong (%d vs. %d charachters). Check manually\n", + printf("[%03d + 3] Returned value seems to be wrong (%d vs. %d characters). Check manually\n", $offset, strlen($ret['label']), strlen($value)); return false; } diff --git a/ext/pdo_pgsql/pgsql_driver.c b/ext/pdo_pgsql/pgsql_driver.c index 657218d00..f347aaa0e 100644 --- a/ext/pdo_pgsql/pgsql_driver.c +++ b/ext/pdo_pgsql/pgsql_driver.c @@ -465,6 +465,15 @@ static int pdo_pgsql_check_liveness(pdo_dbh_t *dbh TSRMLS_DC) } /* }}} */ +static int pgsql_handle_in_transaction(pdo_dbh_t *dbh TSRMLS_DC) +{ + pdo_pgsql_db_handle *H; + + H = (pdo_pgsql_db_handle *)dbh->driver_data; + + return PQtransactionStatus(H->server) > PQTRANS_IDLE; +} + static int pdo_pgsql_transaction_cmd(const char *cmd, pdo_dbh_t *dbh TSRMLS_DC) { pdo_pgsql_db_handle *H = (pdo_pgsql_db_handle *)dbh->driver_data; @@ -489,7 +498,15 @@ static int pgsql_handle_begin(pdo_dbh_t *dbh TSRMLS_DC) static int pgsql_handle_commit(pdo_dbh_t *dbh TSRMLS_DC) { - return pdo_pgsql_transaction_cmd("COMMIT", dbh TSRMLS_CC); + int ret = pdo_pgsql_transaction_cmd("COMMIT", dbh TSRMLS_CC); + + /* When deferred constraints are used the commit could + fail, and a ROLLBACK implicitly ran. See bug #67462 */ + if (!ret) { + dbh->in_txn = pgsql_handle_in_transaction(dbh TSRMLS_CC); + } + + return ret; } static int pgsql_handle_rollback(pdo_dbh_t *dbh TSRMLS_DC) @@ -497,15 +514,6 @@ static int pgsql_handle_rollback(pdo_dbh_t *dbh TSRMLS_DC) return pdo_pgsql_transaction_cmd("ROLLBACK", dbh TSRMLS_CC); } -static int pgsql_handle_in_transaction(pdo_dbh_t *dbh TSRMLS_DC) -{ - pdo_pgsql_db_handle *H; - - H = (pdo_pgsql_db_handle *)dbh->driver_data; - - return PQtransactionStatus(H->server); -} - /* {{{ proto string PDO::pgsqlCopyFromArray(string $table_name , array $rows [, string $delimiter [, string $null_as ] [, string $fields]) Returns true if the copy worked fine or false if error */ static PHP_METHOD(PDO, pgsqlCopyFromArray) diff --git a/ext/pdo_pgsql/pgsql_statement.c b/ext/pdo_pgsql/pgsql_statement.c index 7da130d52..265658685 100644 --- a/ext/pdo_pgsql/pgsql_statement.c +++ b/ext/pdo_pgsql/pgsql_statement.c @@ -371,6 +371,7 @@ static int pgsql_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data * ((param->param_type & PDO_PARAM_INPUT_OUTPUT) != PDO_PARAM_INPUT_OUTPUT)) { SEPARATE_ZVAL(¶m->parameter); param->param_type = PDO_PARAM_STR; + convert_to_boolean(param->parameter); ZVAL_STRINGL(param->parameter, Z_BVAL_P(param->parameter) ? "t" : "f", 1, 1); } } diff --git a/ext/pdo_pgsql/tests/bug62593.phpt b/ext/pdo_pgsql/tests/bug62593.phpt index e3ebf46ed..4ab4566f0 100644 --- a/ext/pdo_pgsql/tests/bug62593.phpt +++ b/ext/pdo_pgsql/tests/bug62593.phpt @@ -34,6 +34,19 @@ $query->execute(); $errors[] = $query->errorInfo(); var_dump($value); +// Try with strings - Bug #68351 +$value = '0'; +$query->bindParam(':foo', $value, PDO::PARAM_BOOL); +$query->execute(); +$errors[] = $query->errorInfo(); +var_dump($query->fetchColumn()); + +$value = "abc"; +$query->bindParam(':foo', $value, PDO::PARAM_BOOL); +$query->execute(); +$errors[] = $query->errorInfo(); +var_dump($query->fetchColumn()); + $expect = 'No errors found'; foreach ($errors as $error) @@ -48,4 +61,6 @@ echo $expect; --EXPECTF-- bool(true) bool(false) +bool(true) +bool(false) No errors found diff --git a/ext/pdo_pgsql/tests/bug67462.phpt b/ext/pdo_pgsql/tests/bug67462.phpt new file mode 100644 index 000000000..888b19c24 --- /dev/null +++ b/ext/pdo_pgsql/tests/bug67462.phpt @@ -0,0 +1,34 @@ +--TEST-- +PDO PgSQL Bug #67462 (PDO_PGSQL::beginTransaction() wrongly throws exception when not in transaction) +--SKIPIF-- +<?php +if (!extension_loaded('pdo') || !extension_loaded('pdo_pgsql')) die('skip not loaded'); +require dirname(__FILE__) . '/config.inc'; +require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc'; +PDOTest::skip(); +?> +--FILE-- +<?php + +require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc'; +$pdo = PDOTest::test_factory(dirname(__FILE__) . '/common.phpt'); +$pdo->setAttribute (\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION); + +$pdo->beginTransaction(); + +try { + $pdo->query("CREATE TABLE b67462 (a int NOT NULL PRIMARY KEY DEFERRABLE INITIALLY DEFERRED)"); + $pdo->query("INSERT INTO b67462 VALUES (1), (1)"); + + var_dump($pdo->inTransaction()); + $pdo->commit(); // This should fail! +} catch (\Exception $e) { + var_dump($pdo->inTransaction()); + var_dump($pdo->beginTransaction()); +} + +?> +--EXPECT-- +bool(true) +bool(false) +bool(true) diff --git a/ext/pgsql/README b/ext/pgsql/README index 785b4f034..86df804fb 100644 --- a/ext/pgsql/README +++ b/ext/pgsql/README @@ -43,7 +43,7 @@ module with specific version. You need to install PostgreSQL somewhere in your system to build PHP with PostgreSQL support. ==== Note For PostgreSQL 7.2 ==== -I've tested upto 7.2.2. +I've tested up to 7.2.2. ==== TODO List === Make pg_convert() smater. diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c index 6a433af0f..c0558e502 100644 --- a/ext/pgsql/pgsql.c +++ b/ext/pgsql/pgsql.c @@ -1370,7 +1370,7 @@ static void php_pgsql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) /* ensure that the link did not die */ if (PGG(auto_reset_persistent) & 1) { /* need to send & get something from backend to - make sure we catch CONNECTION_BAD everytime */ + make sure we catch CONNECTION_BAD every time */ PGresult *pg_result; pg_result = PQexec(le->ptr, "select 1"); PQclear(pg_result); @@ -1478,7 +1478,7 @@ static void php_pgsql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) } PGG(num_links)++; } - /* set notice processer */ + /* set notice processor */ if (! PGG(ignore_notices) && Z_TYPE_P(return_value) == IS_RESOURCE) { PQsetNoticeProcessor(pgsql, _php_pgsql_notice_handler, (void*)Z_RESVAL_P(return_value)); } @@ -4358,7 +4358,7 @@ PHP_FUNCTION(pg_escape_bytea) #endif to = (char *)PQescapeBytea((unsigned char*)from, from_len, &to_len); - RETVAL_STRINGL(to, to_len-1, 1); /* to_len includes addtional '\0' */ + RETVAL_STRINGL(to, to_len-1, 1); /* to_len includes additional '\0' */ PQfreemem(to); } /* }}} */ diff --git a/ext/pgsql/tests/config.inc b/ext/pgsql/tests/config.inc index 367f1ef9b..e9944de79 100644 --- a/ext/pgsql/tests/config.inc +++ b/ext/pgsql/tests/config.inc @@ -1,10 +1,12 @@ <?php + // These vars are used to connect db and create test table. -// values can be set to meet your environment +// values can be set to meet your environment with the +// environment var PGSQL_TEST_CONNSTR + +// "test" database must exist. i.e. "createdb test" before testing +$conn_str = getenv('PGSQL_TEST_CONNSTR') ?: "host=localhost dbname=test port=5432"; // connection string -// "test" database must be existed. i.e. "createdb test" before testing -// PostgreSQL uses login name as username, user must have access to "test" database. -$conn_str = "host=localhost dbname=test port=5432"; // connection string $table_name = "php_pgsql_test"; // test table that will be created $table_name_92 = "php_pgsql_test_92"; // test table that will be created $num_test_record = 1000; // Number of records to create diff --git a/ext/phar/Makefile.frag b/ext/phar/Makefile.frag index faa9db0c7..6516ddfab 100644 --- a/ext/phar/Makefile.frag +++ b/ext/phar/Makefile.frag @@ -39,7 +39,7 @@ install-pharcmd: pharcmd -@$(mkinstalldirs) $(INSTALL_ROOT)$(bindir) $(INSTALL) $(builddir)/phar.phar $(INSTALL_ROOT)$(bindir) -@rm -f $(INSTALL_ROOT)$(bindir)/phar - $(LN_S) -f $(bindir)/phar.phar $(INSTALL_ROOT)$(bindir)/phar + $(LN_S) -f $(INSTALL_ROOT)$(bindir)/phar.phar $(INSTALL_ROOT)$(bindir)/phar @$(mkinstalldirs) $(INSTALL_ROOT)$(mandir)/man1 @$(INSTALL_DATA) $(builddir)/phar.1 $(INSTALL_ROOT)$(mandir)/man1/phar.1 @$(INSTALL_DATA) $(builddir)/phar.phar.1 $(INSTALL_ROOT)$(mandir)/man1/phar.phar.1 diff --git a/ext/phar/func_interceptors.c b/ext/phar/func_interceptors.c index 87411fc98..0d6cc4387 100644 --- a/ext/phar/func_interceptors.c +++ b/ext/phar/func_interceptors.c @@ -570,7 +570,7 @@ static void phar_fancy_stat(struct stat *stat_sb, int type, zval *return_value T #else MAKE_LONG_ZVAL_INCREF(stat_blocks,-1); #endif - /* Store numeric indexes in propper order */ + /* Store numeric indexes in proper order */ zend_hash_next_index_insert(HASH_OF(return_value), (void *)&stat_dev, sizeof(zval *), NULL); zend_hash_next_index_insert(HASH_OF(return_value), (void *)&stat_ino, sizeof(zval *), NULL); zend_hash_next_index_insert(HASH_OF(return_value), (void *)&stat_mode, sizeof(zval *), NULL); diff --git a/ext/readline/tests/readline_read_history_error_001.phpt b/ext/readline/tests/readline_read_history_error_001.phpt new file mode 100644 index 000000000..0a65a66d5 --- /dev/null +++ b/ext/readline/tests/readline_read_history_error_001.phpt @@ -0,0 +1,14 @@ +--TEST-- +readline_read_history() function - Error cases +--CREDITS-- +Pedro Manoel Evangelista <pedro.evangelista at gmail dot com> +--SKIPIF-- +<?php if (!extension_loaded("readline") || !function_exists('readline_read_history')) die("skip"); ?> +--FILE-- +<?php +var_dump(readline_read_history()); +var_dump(readline_read_history('nofile')); +?> +--EXPECT-- +bool(false) +bool(false) diff --git a/ext/reflection/tests/ReflectionParameter_canBePassedByValue.phpt b/ext/reflection/tests/ReflectionParameter_canBePassedByValue.phpt index 4772f6548..5655d1997 100644 --- a/ext/reflection/tests/ReflectionParameter_canBePassedByValue.phpt +++ b/ext/reflection/tests/ReflectionParameter_canBePassedByValue.phpt @@ -41,11 +41,11 @@ Name: arr1 Is passed by reference: yes
Can be passed by value: yes
-Name: SORT_ASC_or_SORT_DESC
+Name: sort_order
Is passed by reference: yes
Can be passed by value: yes
-Name: SORT_REGULAR_or_SORT_NUMERIC_or_SORT_STRING
+Name: sort_flags
Is passed by reference: yes
Can be passed by value: yes
@@ -53,18 +53,6 @@ Name: arr2 Is passed by reference: yes
Can be passed by value: yes
-Name: SORT_ASC_or_SORT_DESC
-Is passed by reference: yes
-Can be passed by value: yes
-
-Name: SORT_REGULAR_or_SORT_NUMERIC_or_SORT_STRING
-Is passed by reference: yes
-Can be passed by value: yes
-
-Name: more_array_and_sort_options
-Is passed by reference: yes
-Can be passed by value: yes
-
=> sort:
Name: arg
diff --git a/ext/session/session.c b/ext/session/session.c index d440e6fdd..d561c558b 100644 --- a/ext/session/session.c +++ b/ext/session/session.c @@ -514,17 +514,8 @@ static void php_session_initialize(TSRMLS_D) /* {{{ */ PS(session_status) = php_session_active; } if (val) { - PHP_MD5_CTX context; - - /* Store read data's MD5 hash */ - PHP_MD5Init(&context); - PHP_MD5Update(&context, val, vallen); - PHP_MD5Final(PS(session_data_hash), &context); - php_session_decode(val, vallen TSRMLS_CC); str_efree(val); - } else { - memset(PS(session_data_hash),'\0', 16); } if (!PS(use_cookies) && PS(send_cookie)) { @@ -547,19 +538,7 @@ static void php_session_save_current_state(TSRMLS_D) /* {{{ */ val = php_session_encode(&vallen TSRMLS_CC); if (val) { - PHP_MD5_CTX context; - unsigned char digest[16]; - - /* Generate data's MD5 hash */ - PHP_MD5Init(&context); - PHP_MD5Update(&context, val, vallen); - PHP_MD5Final(digest, &context); - /* Write only when save is required */ - if (memcmp(digest, PS(session_data_hash), 16)) { - ret = PS(mod)->s_write(&PS(mod_data), PS(id), val, vallen TSRMLS_CC); - } else { - ret = SUCCESS; - } + ret = PS(mod)->s_write(&PS(mod_data), PS(id), val, vallen TSRMLS_CC); efree(val); } else { ret = PS(mod)->s_write(&PS(mod_data), PS(id), "", 0 TSRMLS_CC); @@ -1994,7 +1973,6 @@ static PHP_FUNCTION(session_regenerate_id) RETURN_FALSE; } efree(PS(id)); - memset(PS(session_data_hash),'\0', 16); } PS(id) = PS(mod)->s_create_sid(&PS(mod_data), NULL TSRMLS_CC); diff --git a/ext/session/tests/session_set_save_handler_write_short_circuit.phpt b/ext/session/tests/session_set_save_handler_write_short_circuit.phpt index 02ca182ec..08da29a8f 100644 --- a/ext/session/tests/session_set_save_handler_write_short_circuit.phpt +++ b/ext/session/tests/session_set_save_handler_write_short_circuit.phpt @@ -5,6 +5,7 @@ session.save_path= session.name=PHPSESSID --SKIPIF-- <?php include('skipif.inc'); ?> +skip - Waiting RFC patch merge --FILE-- <?php diff --git a/ext/shmop/README b/ext/shmop/README index a8ea03af9..c4970376b 100644 --- a/ext/shmop/README +++ b/ext/shmop/README @@ -6,7 +6,7 @@ Shared Memory Operations Extension to PHP to communicate the deamon via SHM. PHP already had a shared memory extension (sysvshm) written by Christian Cartus <cartus@atrior.de>, unfortunately this extension was designed with PHP only in mind and - offers high level features which are extremly bothersome for basic SHM + offers high level features which are extremely bothersome for basic SHM we had in mind. After spending a day trying to reverse engineer and figure out the format of sysvshm we decided that it would be much easier to add our own extension to php for simple SHM operations, we were right :)). diff --git a/ext/snmp/snmp.c b/ext/snmp/snmp.c index 4dd4badcd..06df7d81b 100644 --- a/ext/snmp/snmp.c +++ b/ext/snmp/snmp.c @@ -1588,7 +1588,7 @@ PHP_FUNCTION(snmpwalk) /* }}} */ /* {{{ proto mixed snmprealwalk(string host, string community, mixed object_id [, int timeout [, int retries]]) - Return all objects including their respective object id withing the specified one */ + Return all objects including their respective object id within the specified one */ PHP_FUNCTION(snmprealwalk) { php_snmp(INTERNAL_FUNCTION_PARAM_PASSTHRU, SNMP_CMD_WALK, SNMP_VERSION_1); @@ -1616,7 +1616,7 @@ PHP_FUNCTION(snmp_get_quick_print) /* }}} */ /* {{{ proto bool snmp_set_quick_print(int quick_print) - Return all objects including their respective object id withing the specified one */ + Return all objects including their respective object id within the specified one */ PHP_FUNCTION(snmp_set_quick_print) { long a1; @@ -1698,7 +1698,7 @@ PHP_FUNCTION(snmp2_walk) /* }}} */ /* {{{ proto mixed snmp2_real_walk(string host, string community, mixed object_id [, int timeout [, int retries]]) - Return all objects including their respective object id withing the specified one */ + Return all objects including their respective object id within the specified one */ PHP_FUNCTION(snmp2_real_walk) { php_snmp(INTERNAL_FUNCTION_PARAM_PASSTHRU, SNMP_CMD_WALK, SNMP_VERSION_2c); @@ -1893,7 +1893,7 @@ PHP_METHOD(snmp, getnext) /* }}} */ /* {{{ proto mixed SNMP::walk(mixed object_id [, bool $suffix_as_key = FALSE [, int $max_repetitions [, int $non_repeaters]]) - Return all objects including their respective object id withing the specified one as array of oid->value pairs */ + Return all objects including their respective object id within the specified one as array of oid->value pairs */ PHP_METHOD(snmp, walk) { php_snmp(INTERNAL_FUNCTION_PARAM_PASSTHRU, SNMP_CMD_WALK, (-1)); diff --git a/ext/soap/TODO.old b/ext/soap/TODO.old index b219c61f8..821dc3107 100644 --- a/ext/soap/TODO.old +++ b/ext/soap/TODO.old @@ -18,7 +18,7 @@ when using wsdls and function names are similar find the best match void test(int); void test(string); maybe use the same alogrithim as ext/java. -investigate further http keep_alive... inital testing proved slower.. maybe php_streams will speed things up.. +investigate further http keep_alive... initial testing proved slower.. maybe php_streams will speed things up.. provide schema 1999/2001 support.... through memory leak testing possible using shared memory for sdl caching... diff --git a/ext/soap/interop/client_round2_interop.php b/ext/soap/interop/client_round2_interop.php index fd5767cc1..bd52f2877 100644 --- a/ext/soap/interop/client_round2_interop.php +++ b/ext/soap/interop/client_round2_interop.php @@ -93,7 +93,7 @@ class Interop_Client function _fetchEndpoints(&$soapclient, $test) { $this->_getEndpoints($test, 1); - // retreive endpoints from the endpoint server + // retrieve endpoints from the endpoint server $endpointArray = $soapclient->__soapCall("GetEndpointInfo",array("groupName"=>$test),array('soapaction'=>"http://soapinterop.org/",'uri'=>"http://soapinterop.org/")); if (is_soap_fault($endpointArray) || PEAR::isError($endpointArray)) { if ($this->html) print "<pre>"; @@ -133,7 +133,7 @@ class Interop_Client /** * fetchEndpoints - * retreive endpoints interop server + * retrieve endpoints interop server * * @return boolean result * @access private @@ -158,7 +158,7 @@ class Interop_Client } return NULL; } - // retreive all endpoints now + // retrieve all endpoints now $this->currentTest = $test; $x = $this->_getEndpoints($test); return $x; @@ -166,7 +166,7 @@ class Interop_Client /** * getEndpoints - * retreive endpoints from either database or interop server + * retrieve endpoints from either database or interop server * * @param string base (see local var $tests) * @param boolean all (if false, only get valid endpoints, status=1) @@ -182,7 +182,7 @@ class Interop_Client /** * _getEndpoints - * retreive endpoints from database + * retrieve endpoints from database * * @param string base (see local var $tests) * @param boolean all (if false, only get valid endpoints, status=1) @@ -222,7 +222,7 @@ class Interop_Client /** * getResults - * retreive results from the database, stuff them into the endpoint array + * retrieve results from the database, stuff them into the endpoint array * * @access private */ @@ -230,7 +230,7 @@ class Interop_Client // be sure we have the right endpoints for this test result $this->getEndpoints($test); - // retreive the results and put them into the endpoint info + // retrieve the results and put them into the endpoint info $sql = "select * from results where class='$test' and type='$type' and wsdl=$wsdl"; $results = $this->dbc->getAll($sql,NULL, DB_FETCHMODE_ASSOC ); foreach ($results as $result) { @@ -657,12 +657,12 @@ try { /** * getResults - * retreive results from the database, stuff them into the endpoint array + * retrieve results from the database, stuff them into the endpoint array * * @access private */ function getMethodList($test = 'base') { - // retreive the results and put them into the endpoint info + // retrieve the results and put them into the endpoint info $sql = "select distinct(function) from results where class='$test' order by function"; $results = $this->dbc->getAll($sql); $ar = array(); diff --git a/ext/soap/package.xml b/ext/soap/package.xml index e43fd3602..6c68f8dd4 100644 --- a/ext/soap/package.xml +++ b/ext/soap/package.xml @@ -34,7 +34,7 @@ <date>2002-07-07</date> <state>alpha</state> <notes> - - First offical PEAR/PECL release + - First official PEAR/PECL release </notes> </release> <filelist> diff --git a/ext/soap/php_sdl.h b/ext/soap/php_sdl.h index fd2d78db9..fb7a459b8 100644 --- a/ext/soap/php_sdl.h +++ b/ext/soap/php_sdl.h @@ -87,7 +87,7 @@ struct _sdlBinding { void *bindingAttributes; /* sdlSoapBindingPtr */ }; -/* Soap Binding Specfic stuff */ +/* Soap Binding Specific stuff */ struct _sdlSoapBinding { sdlEncodingStyle style; sdlTransport transport; /* not implemented yet */ diff --git a/ext/soap/soap.c b/ext/soap/soap.c index 0453dc28e..79084ed26 100644 --- a/ext/soap/soap.c +++ b/ext/soap/soap.c @@ -3121,7 +3121,7 @@ PHP_METHOD(SoapClient, __doRequest) /* {{{ proto void SoapClient::__setCookie(string name [, strung value]) Sets cookie thet will sent with SOAP request. - The call to this function will effect all folowing calls of SOAP methods. + The call to this function will effect all following calls of SOAP methods. If value is not specified cookie is removed. */ PHP_METHOD(SoapClient, __setCookie) { @@ -4745,6 +4745,7 @@ static void type_to_string(sdlTypePtr type, smart_str *buf, int level) zend_hash_find(type->attributes, SOAP_1_1_ENC_NAMESPACE":arrayType", sizeof(SOAP_1_1_ENC_NAMESPACE":arrayType"), (void **)&attr) == SUCCESS && + (*attr)->extraAttributes && zend_hash_find((*attr)->extraAttributes, WSDL_NAMESPACE":arrayType", sizeof(WSDL_NAMESPACE":arrayType"), (void **)&ext) == SUCCESS) { char *end = strchr((*ext)->val, '['); int len; @@ -4769,6 +4770,7 @@ static void type_to_string(sdlTypePtr type, smart_str *buf, int level) zend_hash_find(type->attributes, SOAP_1_2_ENC_NAMESPACE":itemType", sizeof(SOAP_1_2_ENC_NAMESPACE":itemType"), (void **)&attr) == SUCCESS && + (*attr)->extraAttributes && zend_hash_find((*attr)->extraAttributes, WSDL_NAMESPACE":itemType", sizeof(WSDL_NAMESPACE":arrayType"), (void **)&ext) == SUCCESS) { smart_str_appends(buf, (*ext)->val); smart_str_appendc(buf, ' '); @@ -4788,6 +4790,7 @@ static void type_to_string(sdlTypePtr type, smart_str *buf, int level) zend_hash_find(type->attributes, SOAP_1_2_ENC_NAMESPACE":arraySize", sizeof(SOAP_1_2_ENC_NAMESPACE":arraySize"), (void **)&attr) == SUCCESS && + (*attr)->extraAttributes && zend_hash_find((*attr)->extraAttributes, WSDL_NAMESPACE":itemType", sizeof(WSDL_NAMESPACE":arraySize"), (void **)&ext) == SUCCESS) { smart_str_appendc(buf, '['); smart_str_appends(buf, (*ext)->val); diff --git a/ext/soap/tests/bug68361.phpt b/ext/soap/tests/bug68361.phpt new file mode 100644 index 000000000..6dbba8a42 --- /dev/null +++ b/ext/soap/tests/bug68361.phpt @@ -0,0 +1,114 @@ +--TEST-- +Bug #68361 Segmentation fault on SoapClient::__getTypes +--SKIPIF-- +<?php require_once('skipif.inc'); ?> +--FILE-- +<?php + +$xml = <<<XML +<?xml version="1.0" encoding="UTF-8"?> +<definitions name="TestServer" targetNamespace="http://foo.bar/testserver" xmlns:tns="http://foo.bar/testserver" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:ns="http://foo.bar/testserver/types"> + <types> + <xsd:schema targetNamespace="http://foo.bar/testserver/types" xmlns="http://foo.bar/testserver/types"> + <xsd:complexType name="ArrayOfEmployeeReturn"> + <xsd:complexContent> + <xsd:restriction base="soapenc:Array"> + <xsd:attribute ref="soapenc:arrayType" arrayType="ns:Employee[]"/> + </xsd:restriction> + </xsd:complexContent> + </xsd:complexType> + <xsd:complexType name="Employee"> + <xsd:sequence> + <xsd:element name="id" type="xsd:int"/> + <xsd:element name="department" type="xsd:string"/> + <xsd:element name="name" type="xsd:string"/> + <xsd:element name="age" type="xsd:int"/> + </xsd:sequence> + </xsd:complexType> + <xsd:element name="Employee" nillable="true" type="ns:Employee"/> + <xsd:complexType name="User"> + <xsd:sequence> + <xsd:element name="name" type="xsd:string"/> + <xsd:element name="age" type="xsd:int"/> + </xsd:sequence> + </xsd:complexType> + <xsd:element name="User" nillable="true" type="ns:User"/> + </xsd:schema> + </types> + <message name="getEmployeeRequest"> + <part name="name" type="xsd:name"/> + </message> + <message name="getEmployeeResponse"> + <part name="employeeReturn" type="ns:ArrayOfEmployeeReturn"/> + </message> + <message name="getUserRequest"> + <part name="id" type="xsd:id"/> + </message> + <message name="getUserResponse"> + <part name="userReturn" element="ns:User"/> + </message> + <portType name="TestServerPortType"> + <operation name="getEmployee"> + <input message="tns:getEmployeeRequest"/> + <output message="tns:getEmployeeResponse"/> + </operation> + <operation name="getUser"> + <input message="tns:getUserRequest"/> + <output message="tns:getUserResponse"/> + </operation> + </portType> + <binding name="TestServerBinding" type="tns:TestServerPortType"> + <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> + <operation name="getEmployee"> + <soap:operation soapAction="http://foo.bar/testserver/#getEmployee"/> + <input> + <soap:body use="literal" namespace="http://foo.bar/testserver"/> + </input> + <output> + <soap:body use="literal" namespace="http://foo.bar/testserver"/> + </output> + </operation> + <operation name="getUser"> + <soap:operation soapAction="http://foo.bar/testserver/#getUser"/> + <input> + <soap:body use="literal" namespace="http://foo.bar/testserver"/> + </input> + <output> + <soap:body use="literal" namespace="http://foo.bar/testserver"/> + </output> + </operation> + </binding> + <service name="TestServerService"> + <port name="TestServerPort" binding="tns:TestServerBinding"> + <soap:address location="http://localhost/wsdl-creator/TestClass.php"/> + </port> + </service> +</definitions> +XML; + +file_put_contents(__DIR__ . "/bug68361.xml", $xml); +$client = new SoapClient(__DIR__ . "/bug68361.xml"); + +$res = $client->__getTypes(); // Segmentation fault here + +print_r($res); +?> +--CLEAN-- +<?php +unlink(__DIR__ . "/bug68361.xml"); +?> +--EXPECT-- +Array +( + [0] => anyType ArrayOfEmployeeReturn[] + [1] => struct Employee { + int id; + string department; + string name; + int age; +} + [2] => struct User { + string name; + int age; +} +) diff --git a/ext/soap/tests/bugs/bug27742.wsdl b/ext/soap/tests/bugs/bug27742.wsdl index 7f1514acb..a9429981c 100644 --- a/ext/soap/tests/bugs/bug27742.wsdl +++ b/ext/soap/tests/bugs/bug27742.wsdl @@ -726,7 +726,7 @@ </element>
<element name="genres">
<annotation>
- <documentation xml:lang="en">Containes genre information where available for the program records. A program may have more than one genre with different relevence factors.</documentation>
+ <documentation xml:lang="en">Contains genre information where available for the program records. A program may have more than one genre with different relevance factors.</documentation>
</annotation>
<complexType>
<sequence maxOccurs="unbounded">
@@ -749,7 +749,7 @@ </element>
<element name="relevance" type="xsd:int">
<annotation>
- <documentation xml:lang="en">A relevence factor that applies to the genre classification for the program. A relevence factor of 1 indicates that this is the top-level genre under which the program is classified.</documentation>
+ <documentation xml:lang="en">A relevance factor that applies to the genre classification for the program. A relevance factor of 1 indicates that this is the top-level genre under which the program is classified.</documentation>
</annotation>
</element>
</sequence>
diff --git a/ext/soap/tests/bugs/bug50698_2.phpt b/ext/soap/tests/bugs/bug50698_2.phpt index a39f4b56b..7ff667423 100644 --- a/ext/soap/tests/bugs/bug50698_2.phpt +++ b/ext/soap/tests/bugs/bug50698_2.phpt @@ -1,5 +1,5 @@ --TEST-- -Request #50698_2 (SoapClient should handle wsdls with some incompatiable endpoints -- EDGECASE: Large mix of compatiable and incompatiable endpoints.) +Request #50698_2 (SoapClient should handle wsdls with some incompatiable endpoints -- EDGECASE: Large mix of compatible and incompatiable endpoints.) --SKIPIF-- <?php require_once('skipif.inc'); ?> --INI-- diff --git a/ext/sockets/tests/mcast_ipv4_send.phpt b/ext/sockets/tests/mcast_ipv4_send.phpt index ac5bce916..0dd858f29 100644 --- a/ext/sockets/tests/mcast_ipv4_send.phpt +++ b/ext/sockets/tests/mcast_ipv4_send.phpt @@ -1,65 +1,66 @@ ---TEST--
-Multicast support: IPv4 send options
---SKIPIF--
-<?php
-if (!extension_loaded('sockets')) {
- die('skip sockets extension not available.');
-}
-if (socket_set_option($s, $level, IP_MULTICAST_IF, 1) === false) {
- die("skip interface 1 either doesn't exist or has no ipv4 address");
-}
---FILE--
-<?php
-$domain = AF_INET;
-$level = IPPROTO_IP;
-$s = socket_create($domain, SOCK_DGRAM, SOL_UDP) or die("err");
-
-echo "Setting IP_MULTICAST_TTL\n";
-$r = socket_set_option($s, $level, IP_MULTICAST_TTL, 9);
-var_dump($r);
-$r = socket_get_option($s, $level, IP_MULTICAST_TTL);
-var_dump($r);
-echo "\n";
-
-echo "Setting IP_MULTICAST_LOOP\n";
-$r = socket_set_option($s, $level, IP_MULTICAST_LOOP, 0);
-var_dump($r);
-$r = socket_get_option($s, $level, IP_MULTICAST_LOOP);
-var_dump($r);
-$r = socket_set_option($s, $level, IP_MULTICAST_LOOP, 1);
-var_dump($r);
-$r = socket_get_option($s, $level, IP_MULTICAST_LOOP);
-var_dump($r);
-echo "\n";
-
-echo "Setting IP_MULTICAST_IF\n";
-echo "interface 0:\n";
-$r = socket_set_option($s, $level, IP_MULTICAST_IF, 0);
-var_dump($r);
-$r = socket_get_option($s, $level, IP_MULTICAST_IF);
-var_dump($r);
-echo "interface 1:\n";
-$r = socket_set_option($s, $level, IP_MULTICAST_IF, 1);
-var_dump($r);
-$r = socket_get_option($s, $level, IP_MULTICAST_IF);
-var_dump($r);
-echo "\n";
-
---EXPECT--
-Setting IP_MULTICAST_TTL
-bool(true)
-int(9)
-
-Setting IP_MULTICAST_LOOP
-bool(true)
-int(0)
-bool(true)
-int(1)
-
-Setting IP_MULTICAST_IF
-interface 0:
-bool(true)
-int(0)
-interface 1:
-bool(true)
-int(1)
+--TEST-- +Multicast support: IPv4 send options +--SKIPIF-- +<?php +if (!extension_loaded('sockets')) { + die('skip sockets extension not available.'); +} +$s = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP) or die("err"); +if (socket_set_option($s, IPPROTO_IP, IP_MULTICAST_IF, 1) === false) { + die("skip interface 1 either doesn't exist or has no ipv4 address"); +} +--FILE-- +<?php +$domain = AF_INET; +$level = IPPROTO_IP; +$s = socket_create($domain, SOCK_DGRAM, SOL_UDP) or die("err"); + +echo "Setting IP_MULTICAST_TTL\n"; +$r = socket_set_option($s, $level, IP_MULTICAST_TTL, 9); +var_dump($r); +$r = socket_get_option($s, $level, IP_MULTICAST_TTL); +var_dump($r); +echo "\n"; + +echo "Setting IP_MULTICAST_LOOP\n"; +$r = socket_set_option($s, $level, IP_MULTICAST_LOOP, 0); +var_dump($r); +$r = socket_get_option($s, $level, IP_MULTICAST_LOOP); +var_dump($r); +$r = socket_set_option($s, $level, IP_MULTICAST_LOOP, 1); +var_dump($r); +$r = socket_get_option($s, $level, IP_MULTICAST_LOOP); +var_dump($r); +echo "\n"; + +echo "Setting IP_MULTICAST_IF\n"; +echo "interface 0:\n"; +$r = socket_set_option($s, $level, IP_MULTICAST_IF, 0); +var_dump($r); +$r = socket_get_option($s, $level, IP_MULTICAST_IF); +var_dump($r); +echo "interface 1:\n"; +$r = socket_set_option($s, $level, IP_MULTICAST_IF, 1); +var_dump($r); +$r = socket_get_option($s, $level, IP_MULTICAST_IF); +var_dump($r); +echo "\n"; + +--EXPECT-- +Setting IP_MULTICAST_TTL +bool(true) +int(9) + +Setting IP_MULTICAST_LOOP +bool(true) +int(0) +bool(true) +int(1) + +Setting IP_MULTICAST_IF +interface 0: +bool(true) +int(0) +interface 1: +bool(true) +int(1) diff --git a/ext/spl/internal/recursivecachingiterator.inc b/ext/spl/internal/recursivecachingiterator.inc index 0676d435f..cd5d3e31f 100644 --- a/ext/spl/internal/recursivecachingiterator.inc +++ b/ext/spl/internal/recursivecachingiterator.inc @@ -80,7 +80,7 @@ class RecursiveCachingIterator extends CachingIterator implements RecursiveItera /** @return whether the current element has children * @note The check whether the Iterator for the children can be created was * already executed. Hence when flag CATCH_GET_CHILD was given in - * constructor this fucntion returns false so that getChildren does + * constructor this function returns false so that getChildren does * not try to access those children. */ function hasChildren() diff --git a/ext/spl/spl.php b/ext/spl/spl.php index c276f1f2e..ff9d1b6bb 100755 --- a/ext/spl/spl.php +++ b/ext/spl/spl.php @@ -958,7 +958,7 @@ class SplFileInfo * * @param mode open mode * @param use_include_path whether to search include paths (don't use) - * @param context resource context to pased to open function + * @param context resource context to passed to open function * @throw RuntimeException if file cannot be opened (e.g. insufficient * access rights). * @return The opened file as a SplFileObject instance diff --git a/ext/spl/tests/SplFixedArray_fromarray_param_multiarray.phpt b/ext/spl/tests/SplFixedArray_fromarray_param_multiarray.phpt index f57fe78fb..659f61c80 100644 --- a/ext/spl/tests/SplFixedArray_fromarray_param_multiarray.phpt +++ b/ext/spl/tests/SplFixedArray_fromarray_param_multiarray.phpt @@ -1,5 +1,5 @@ --TEST-- -Tries to create a SplFixedArray using the fromArray() function and a multi dimentional array. +Tries to create a SplFixedArray using the fromArray() function and a multi dimensional array. --CREDITS-- Philip Norton philipnorton42@gmail.com --FILE-- diff --git a/ext/spl/tests/bug53071.phpt b/ext/spl/tests/bug53071.phpt index c2c2605e2..9d5dac4cd 100644 --- a/ext/spl/tests/bug53071.phpt +++ b/ext/spl/tests/bug53071.phpt @@ -12,7 +12,7 @@ function LimitedScope() $myA = new myClass(); $myB = new SplObjectStorage(); $myC = new myClass(); - $myC->member = $myA; // myC has a referece to myA + $myC->member = $myA; // myC has a reference to myA $myB->Attach($myC); // myB attaches myC $myA->member = $myB; // myA has myB, comleting the cycle } diff --git a/ext/sqlite3/libsqlite/sqlite3.c b/ext/sqlite3/libsqlite/sqlite3.c index e5aa96f6b..99aeccc46 100644 --- a/ext/sqlite3/libsqlite/sqlite3.c +++ b/ext/sqlite3/libsqlite/sqlite3.c @@ -10022,7 +10022,7 @@ SQLITE_PRIVATE void sqlite3PCacheSetDefault(void); ** shared locks begins at SHARED_FIRST. ** ** The same locking strategy and -** byte ranges are used for Unix. This leaves open the possiblity of having +** byte ranges are used for Unix. This leaves open the possibility of having ** clients on win95, winNT, and unix all talking to the same shared file ** and all locking correctly. To do so would require that samba (or whatever ** tool is being used for file sharing) implements locks correctly between @@ -11971,7 +11971,7 @@ struct TriggerStep { u8 op; /* One of TK_DELETE, TK_UPDATE, TK_INSERT, TK_SELECT */ u8 orconf; /* OE_Rollback etc. */ Trigger *pTrig; /* The trigger that this step is a part of */ - Select *pSelect; /* SELECT statment or RHS of INSERT INTO .. SELECT ... */ + Select *pSelect; /* SELECT statement or RHS of INSERT INTO .. SELECT ... */ Token target; /* Target table for DELETE, UPDATE, INSERT */ Expr *pWhere; /* The WHERE clause for DELETE or UPDATE steps */ ExprList *pExprList; /* SET clause for UPDATE. */ @@ -13019,7 +13019,7 @@ SQLITE_PRIVATE int sqlite3MemdebugNoType(void*,u8); ** ************************************************************************* ** -** This file contains definitions of global variables and contants. +** This file contains definitions of global variables and constants. */ /* An array to map all upper-case characters into their corresponding @@ -13908,7 +13908,7 @@ struct Mem { #endif /* -** Each auxilliary data pointer stored by a user defined function +** Each auxiliary data pointer stored by a user defined function ** implementation calling sqlite3_set_auxdata() is stored in an instance ** of this structure. All such structures associated with a single VM ** are stored in a linked list headed at Vdbe.pAuxData. All are destroyed @@ -17632,7 +17632,7 @@ SQLITE_PRIVATE const sqlite3_mem_methods *sqlite3MemGetMemsys3(void){ ** 1. All memory allocations sizes are rounded up to a power of 2. ** ** 2. If two adjacent free blocks are the halves of a larger block, -** then the two blocks are coalesed into the single larger block. +** then the two blocks are coalesced into the single larger block. ** ** 3. New memory is allocated from the first available free block. ** @@ -18570,7 +18570,7 @@ SQLITE_PRIVATE sqlite3_mutex_methods const *sqlite3DefaultMutex(void){ /* ** The sqlite3_mutex.id, sqlite3_mutex.nRef, and sqlite3_mutex.owner fields -** are necessary under two condidtions: (1) Debug builds and (2) using +** are necessary under two conditions: (1) Debug builds and (2) using ** home-grown mutexes. Encapsulate these conditions into a single #define. */ #if defined(SQLITE_DEBUG) || defined(SQLITE_HOMEGROWN_RECURSIVE_MUTEX) @@ -21904,7 +21904,7 @@ SQLITE_PRIVATE void sqlite3ErrorMsg(Parse *pParse, const char *zFormat, ...){ ** occur. ** ** 2002-Feb-14: This routine is extended to remove MS-Access style -** brackets from around identifers. For example: "[a-b-c]" becomes +** brackets from around identifiers. For example: "[a-b-c]" becomes ** "a-b-c". */ SQLITE_PRIVATE int sqlite3Dequote(char *z){ @@ -22146,7 +22146,7 @@ do_atof_calc: /* store the result */ *pResult = result; - /* return true if number and no extra non-whitespace chracters after */ + /* return true if number and no extra non-whitespace characters after */ return z>=zEnd && nDigits>0 && eValid && nonNum==0; #else return !sqlite3Atoi64(z, pResult, length, enc); @@ -22837,7 +22837,7 @@ SQLITE_PRIVATE int sqlite3SafetyCheckSickOrOk(sqlite3 *db){ } /* -** Attempt to add, substract, or multiply the 64-bit signed value iB against +** Attempt to add, subtract, or multiply the 64-bit signed value iB against ** the other 64-bit signed integer at *pA and store the result in *pA. ** Return 0 on success. Or if the operation would have resulted in an ** overflow, leave *pA unchanged and return 1. @@ -26863,7 +26863,7 @@ static int unixRead( #endif #if SQLITE_MAX_MMAP_SIZE>0 - /* Deal with as much of this read request as possible by transfering + /* Deal with as much of this read request as possible by transferring ** data from the memory mapping using memcpy(). */ if( offset<pFile->mmapSize ){ if( offset+amt <= pFile->mmapSize ){ @@ -26998,7 +26998,7 @@ static int unixWrite( #endif #if SQLITE_MAX_MMAP_SIZE>0 - /* Deal with as much of this write request as possible by transfering + /* Deal with as much of this write request as possible by transferring ** data from the memory mapping using memcpy(). */ if( offset<pFile->mmapSize ){ if( offset+amt <= pFile->mmapSize ){ @@ -28557,7 +28557,7 @@ static int unixUnfetch(sqlite3_file *fd, i64 iOff, void *p){ ** looks at the filesystem type and tries to guess the best locking ** strategy from that. ** -** For finder-funtion F, two objects are created: +** For finder-function F, two objects are created: ** ** (1) The real finder-function named "FImpt()". ** @@ -29998,7 +29998,7 @@ static int unixGetLastError(sqlite3_vfs *NotUsed, int NotUsed2, char *NotUsed3){ ** setting the environment variable SQLITE_FORCE_PROXY_LOCKING to 1 will ** force proxy locking to be used for every database file opened, and 0 ** will force automatic proxy locking to be disabled for all database -** files (explicity calling the SQLITE_SET_LOCKPROXYFILE pragma or +** files (explicitly calling the SQLITE_SET_LOCKPROXYFILE pragma or ** sqlite_file_control API is not affected by SQLITE_FORCE_PROXY_LOCKING). */ @@ -30529,7 +30529,7 @@ static int proxyTakeConch(unixFile *pFile){ fprintf(stderr, "fchmod %o FAILED with %d %s\n", cmode, code, strerror(code)); } else { - fprintf(stderr, "fchmod %o SUCCEDED\n",cmode); + fprintf(stderr, "fchmod %o SUCCEEDED\n",cmode); } }else{ int code = errno; @@ -33761,7 +33761,7 @@ static int winRead( pFile->h, pBuf, amt, offset, pFile->locktype)); #if SQLITE_MAX_MMAP_SIZE>0 - /* Deal with as much of this read request as possible by transfering + /* Deal with as much of this read request as possible by transferring ** data from the memory mapping using memcpy(). */ if( offset<pFile->mmapSize ){ if( offset+amt <= pFile->mmapSize ){ @@ -33833,7 +33833,7 @@ static int winWrite( pFile->h, pBuf, amt, offset, pFile->locktype)); #if SQLITE_MAX_MMAP_SIZE>0 - /* Deal with as much of this write request as possible by transfering + /* Deal with as much of this write request as possible by transferring ** data from the memory mapping using memcpy(). */ if( offset<pFile->mmapSize ){ if( offset+amt <= pFile->mmapSize ){ @@ -33965,7 +33965,7 @@ static int winTruncate(sqlite3_file *id, sqlite3_int64 nByte){ #ifdef SQLITE_TEST /* ** Count the number of fullsyncs and normal syncs. This is used to test -** that syncs and fullsyncs are occuring at the right times. +** that syncs and fullsyncs are occurring at the right times. */ SQLITE_API int sqlite3_sync_count = 0; SQLITE_API int sqlite3_fullsync_count = 0; @@ -39330,8 +39330,8 @@ SQLITE_PRIVATE int sqlite3RowSetNext(RowSet *p, i64 *pRowid){ ** Check to see if element iRowid was inserted into the rowset as ** part of any insert batch prior to iBatch. Return 1 or 0. ** -** If this is the first test of a new batch and if there exist entires -** on pRowSet->pEntry, then sort those entires into the forest at +** If this is the first test of a new batch and if there exist entries +** on pRowSet->pEntry, then sort those entries into the forest at ** pRowSet->pForest so that they can be tested. */ SQLITE_PRIVATE int sqlite3RowSetTest(RowSet *pRowSet, u8 iBatch, sqlite3_int64 iRowid){ @@ -39613,7 +39613,7 @@ SQLITE_PRIVATE int sqlite3WalFramesize(Wal *pWal); ** Definition: Two databases (or the same database at two points it time) ** are said to be "logically equivalent" if they give the same answer to ** all queries. Note in particular the content of freelist leaf -** pages can be changed arbitarily without effecting the logical equivalence +** pages can be changed arbitrarily without effecting the logical equivalence ** of the database. ** ** (7) At any time, if any subset, including the empty set and the total set, @@ -39838,7 +39838,7 @@ int sqlite3PagerTrace=1; /* True to enable tracing */ ** outstanding transactions have been abandoned, the pager is able to ** transition back to OPEN state, discarding the contents of the ** page-cache and any other in-memory state at the same time. Everything -** is reloaded from disk (and, if necessary, hot-journal rollback peformed) +** is reloaded from disk (and, if necessary, hot-journal rollback performed) ** when a read-transaction is next opened on the pager (transitioning ** the pager into READER state). At that point the system has recovered ** from the error. @@ -41196,7 +41196,7 @@ static int writeMasterJournal(Pager *pPager, const char *zMaster){ } pPager->journalOff += (nMaster+20); - /* If the pager is in peristent-journal mode, then the physical + /* If the pager is in persistent-journal mode, then the physical ** journal-file may extend past the end of the master-journal name ** and 8 bytes of magic data just written to the file. This is ** dangerous because the code to rollback a hot-journal file @@ -41369,7 +41369,7 @@ static void pager_unlock(Pager *pPager){ /* ** This function is called whenever an IOERR or FULL error that requires -** the pager to transition into the ERROR state may ahve occurred. +** the pager to transition into the ERROR state may have occurred. ** The first argument is a pointer to the pager structure, the second ** the error-code about to be returned by a pager API function. The ** value returned is a copy of the second argument to this function. @@ -48080,7 +48080,7 @@ SQLITE_PRIVATE int sqlite3WalOpen( } /* -** Change the size to which the WAL file is trucated on each reset. +** Change the size to which the WAL file is truncated on each reset. */ SQLITE_PRIVATE void sqlite3WalLimit(Wal *pWal, i64 iLimit){ if( pWal ) pWal->mxWalSize = iLimit; @@ -54531,7 +54531,7 @@ SQLITE_PRIVATE int sqlite3BtreeCloseCursor(BtCursor *pCur){ ** compiler to crash when getCellInfo() is implemented as a macro. ** But there is a measureable speed advantage to using the macro on gcc ** (when less compiler optimizations like -Os or -O0 are used and the -** compiler is not doing agressive inlining.) So we use a real function +** compiler is not doing aggressive inlining.) So we use a real function ** for MSVC and a macro for everything else. Ticket #2457. */ #ifndef NDEBUG @@ -54929,7 +54929,7 @@ static int accessPayload( /* ** Read part of the key associated with cursor pCur. Exactly -** "amt" bytes will be transfered into pBuf[]. The transfer +** "amt" bytes will be transferred into pBuf[]. The transfer ** begins at "offset". ** ** The caller must ensure that pCur is pointing to a valid row @@ -54949,7 +54949,7 @@ SQLITE_PRIVATE int sqlite3BtreeKey(BtCursor *pCur, u32 offset, u32 amt, void *pB /* ** Read part of the data associated with cursor pCur. Exactly -** "amt" bytes will be transfered into pBuf[]. The transfer +** "amt" bytes will be transferred into pBuf[]. The transfer ** begins at "offset". ** ** Return SQLITE_OK on success or an error code if anything goes @@ -62945,7 +62945,7 @@ SQLITE_PRIVATE void sqlite3VdbeRewind(Vdbe *p){ ** ** This function may be called exact once on a each virtual machine. ** After this routine is called the VM has been "packaged" and is ready -** to run. After this routine is called, futher calls to +** to run. After this routine is called, further calls to ** sqlite3VdbeAddOp() functions are prohibited. This routine disconnects ** the Vdbe from the Parse object that helped generate it so that the ** the Vdbe becomes an independent entity and the Parse object can be @@ -62997,7 +62997,7 @@ SQLITE_PRIVATE void sqlite3VdbeMakeReady( /* Allocate space for memory registers, SQL variables, VDBE cursors and ** an array to marshal SQL function arguments in. */ - zCsr = (u8*)&p->aOp[p->nOp]; /* Memory avaliable for allocation */ + zCsr = (u8*)&p->aOp[p->nOp]; /* Memory available for allocation */ zEnd = (u8*)&p->aOp[pParse->nOpAlloc]; /* First byte past end of zCsr[] */ resolveP2Values(p, &nArg); @@ -63323,7 +63323,7 @@ static int vdbeCommit(sqlite3 *db, Vdbe *p){ /* The complex case - There is a multi-file write-transaction active. ** This requires a master journal file to ensure the transaction is - ** committed atomicly. + ** committed atomically. */ #ifndef SQLITE_OMIT_DISKIO else{ @@ -65560,7 +65560,7 @@ SQLITE_API int sqlite3_value_type(sqlite3_value* pVal){ ** The following routines are used by user-defined functions to specify ** the function result. ** -** The setStrOrError() funtion calls sqlite3VdbeMemSetStr() to store the +** The setStrOrError() function calls sqlite3VdbeMemSetStr() to store the ** result as a string or blob but if the string or blob is too large, it ** then sets the error code to SQLITE_TOOBIG */ @@ -65981,7 +65981,7 @@ SQLITE_API void *sqlite3_aggregate_context(sqlite3_context *p, int nByte){ } /* -** Return the auxilary data pointer, if any, for the iArg'th argument to +** Return the auxiliary data pointer, if any, for the iArg'th argument to ** the user-function defined by pCtx. */ SQLITE_API void *sqlite3_get_auxdata(sqlite3_context *pCtx, int iArg){ @@ -65996,7 +65996,7 @@ SQLITE_API void *sqlite3_get_auxdata(sqlite3_context *pCtx, int iArg){ } /* -** Set the auxilary data pointer and delete function, for the iArg'th +** Set the auxiliary data pointer and delete function, for the iArg'th ** argument to the user-function defined by pCtx. Any previous value is ** deleted by calling the delete function specified when it was set. */ @@ -75506,7 +75506,7 @@ SQLITE_PRIVATE int sqlite3MemJournalSize(void){ /* ** Walk an expression tree. Invoke the callback once for each node -** of the expression, while decending. (In other words, the callback +** of the expression, while descending. (In other words, the callback ** is invoked before visiting children.) ** ** The return value from the callback should be one of the WRC_* @@ -77026,7 +77026,7 @@ SQLITE_PRIVATE int sqlite3ResolveExprNames( /* ** Resolve all names in all expressions of a SELECT and in all -** decendents of the SELECT, including compounds off of p->pPrior, +** descendants of the SELECT, including compounds off of p->pPrior, ** subqueries in expressions, and subqueries used as FROM clause ** terms. ** @@ -77119,7 +77119,7 @@ SQLITE_PRIVATE void sqlite3ResolveSelfReference( ** affinity of that column is returned. Otherwise, 0x00 is returned, ** indicating no affinity for the expression. ** -** i.e. the WHERE clause expresssions in the following statements all +** i.e. the WHERE clause expressions in the following statements all ** have an affinity: ** ** CREATE TABLE t1(a); @@ -77835,7 +77835,7 @@ static int exprStructSize(Expr *p){ ** Note that with flags==EXPRDUP_REDUCE, this routines works on full-size ** (unreduced) Expr objects as they or originally constructed by the parser. ** During expression analysis, extra information is computed and moved into -** later parts of teh Expr object and that extra information might get chopped +** later parts of the Expr object and that extra information might get chopped ** off if the expression is reduced. Note also that it does not work to ** make a EXPRDUP_REDUCE copy of a reduced expression. It is only legal ** to reduce a pristine expression tree from the parser. The implementation @@ -81503,7 +81503,7 @@ static void renameParentFunc( ** ALTER TABLE command. The first argument is the text of a CREATE TRIGGER ** statement. The second is a table name. The table name in the CREATE ** TRIGGER statement is replaced with the third argument and the result -** returned. This is analagous to renameTableFunc() above, except for CREATE +** returned. This is analogous to renameTableFunc() above, except for CREATE ** TRIGGER, not CREATE INDEX and CREATE TABLE. */ static void renameTriggerFunc( @@ -83682,7 +83682,7 @@ static void initAvgEq(Index *pIdx){ /* Set nSum to the number of distinct (iCol+1) field prefixes that ** occur in the stat4 table for this index before pFinal. Set ** sumEq to the sum of the nEq values for column iCol for the same - ** set (adding the value only once where there exist dupicate + ** set (adding the value only once where there exist duplicate ** prefixes). */ for(i=0; i<(pIdx->nSample-1); i++){ if( aSample[i].anDLt[iCol]!=aSample[i+1].anDLt[iCol] ){ @@ -95333,7 +95333,7 @@ static int xferOptimization( } #endif #ifndef SQLITE_OMIT_FOREIGN_KEY - /* Disallow the transfer optimization if the destination table constains + /* Disallow the transfer optimization if the destination table contains ** any foreign key constraints. This is more restrictive than necessary. ** But the main beneficiary of the transfer optimization is the VACUUM ** command, and the VACUUM command disables foreign key constraints. So @@ -96561,7 +96561,7 @@ static int sqlite3LoadExtension( ** entry point name "sqlite3_extension_init" was not found, then ** construct an entry point name "sqlite3_X_init" where the X is ** replaced by the lowercase value of every ASCII alphabetic - ** character in the filename after the last "/" upto the first ".", + ** character in the filename after the last "/" up to the first ".", ** and eliding the first three characters if they are "lib". ** Examples: ** @@ -101878,7 +101878,7 @@ static void generateWithRecursiveQuery( int iQueue; /* The Queue table */ int iDistinct = 0; /* To ensure unique results if UNION */ int eDest = SRT_Table; /* How to write to Queue */ - SelectDest destQueue; /* SelectDest targetting the Queue table */ + SelectDest destQueue; /* SelectDest targeting the Queue table */ int i; /* Loop counter */ int rc; /* Result code */ ExprList *pOrderBy; /* The ORDER BY clause */ @@ -102383,7 +102383,7 @@ multi_select_end: /* ** Code an output subroutine for a coroutine implementation of a -** SELECT statment. +** SELECT statement. ** ** The data to be output is contained in pIn->iSdst. There are ** pIn->nSdst columns to be output. pDest is where the output should @@ -103184,7 +103184,7 @@ static int flattenSubquery( pSubSrc = pSub->pSrc; assert( pSubSrc ); /* Prior to version 3.1.2, when LIMIT and OFFSET had to be simple constants, - ** not arbitrary expresssions, we allowed some combining of LIMIT and OFFSET + ** not arbitrary expressions, we allowed some combining of LIMIT and OFFSET ** because they could be computed at compile-time. But when LIMIT and OFFSET ** became arbitrary expressions, we were forced to add restrictions (13) ** and (14). */ @@ -103570,7 +103570,7 @@ static u8 minMaxQuery(AggInfo *pAggInfo, ExprList **ppMinMax){ /* ** The select statement passed as the first argument is an aggregate query. -** The second argment is the associated aggregate-info object. This +** The second argument is the associated aggregate-info object. This ** function tests if the SELECT is of the form: ** ** SELECT count(*) FROM <tbl> @@ -103903,7 +103903,7 @@ static void selectPopWith(Walker *pWalker, Select *p){ ** without worrying about messing up the presistent representation ** of the view. ** -** (3) Add terms to the WHERE clause to accomodate the NATURAL keyword +** (3) Add terms to the WHERE clause to accommodate the NATURAL keyword ** on joins and the ON and USING clause of joins. ** ** (4) Scan the list of columns in the result set (pEList) looking @@ -104871,7 +104871,7 @@ SQLITE_PRIVATE int sqlite3Select( */ if( pGroupBy ){ KeyInfo *pKeyInfo; /* Keying information for the group by clause */ - int j1; /* A-vs-B comparision jump */ + int j1; /* A-vs-B comparison jump */ int addrOutputRow; /* Start of subroutine that outputs a result row */ int regOutputRow; /* Return address register for output subroutine */ int addrSetAbort; /* Set the abort flag and return */ @@ -107168,7 +107168,7 @@ SQLITE_PRIVATE void sqlite3Update( } /* Populate the array of registers beginning at regNew with the new - ** row data. This array is used to check constaints, create the new + ** row data. This array is used to check constraints, create the new ** table and index records, and as the values for any new.* references ** made by triggers. ** @@ -107542,7 +107542,7 @@ static int execExecSql(sqlite3 *db, char **pzErrMsg, const char *zSql){ ** step (3) requires additional temporary disk space approximately equal ** to the size of the original database for the rollback journal. ** Hence, temporary disk space that is approximately 2x the size of the -** orginal database is required. Every page of the database is written +** original database is required. Every page of the database is written ** approximately 3 times: Once for step (2) and twice for step (3). ** Two writes per page are required in step (3) because the original ** database content must be written into the rollback journal prior to @@ -109122,7 +109122,7 @@ static int whereLoopResize(sqlite3*, WhereLoop*, int); ** 1. Then using those as a basis to compute the N best WherePath objects ** of length 2. And so forth until the length of WherePaths equals the ** number of nodes in the FROM clause. The best (lowest cost) WherePath -** at the end is the choosen query plan. +** at the end is the chosen query plan. */ struct WherePath { Bitmask maskLoop; /* Bitmask of all WhereLoop objects in this path */ @@ -110367,7 +110367,7 @@ static void exprAnalyzeOrTerm( } if( (chngToIN & getMask(&pWInfo->sMaskSet, pOrTerm->leftCursor))==0 ){ /* This term must be of the form t1.a==t2.b where t2 is in the - ** chngToIN set but t1 is not. This term will be either preceeded + ** chngToIN set but t1 is not. This term will be either preceded ** or follwed by an inverted copy (t2.b==t1.a). Skip this term ** and use its inversion. */ testcase( pOrTerm->wtFlags & TERM_COPIED ); @@ -111396,7 +111396,7 @@ static void whereKeyStats( ** number of rows that the index scan is expected to visit without ** considering the range constraints. If nEq is 0, this is the number of ** rows in the index. Assuming no error occurs, *pnOut is adjusted (reduced) -** to account for the range contraints pLower and pUpper. +** to account for the range constraints pLower and pUpper. ** ** In the absence of sqlite_stat4 ANALYZE data, or if such data cannot be ** used, each range inequality reduces the search space by a factor of 4. @@ -114067,7 +114067,7 @@ static int whereLoopAddAll(WhereLoopBuilder *pBuilder){ ** strict. With GROUP BY and DISTINCT the only requirement is that ** equivalent rows appear immediately adjacent to one another. GROUP BY ** and DISTINT do not require rows to appear in any particular order as long -** as equivelent rows are grouped together. Thus for GROUP BY and DISTINCT +** as equivalent rows are grouped together. Thus for GROUP BY and DISTINCT ** the pOrderBy terms can be matched in any order. With ORDER BY, the ** pOrderBy terms must be matched in strict left-to-right order. */ @@ -119734,7 +119734,7 @@ SQLITE_PRIVATE const char sqlite3IsEbcdicIdChar[]; ** a statement. ** ** (4) CREATE The keyword CREATE has been seen at the beginning of a -** statement, possibly preceeded by EXPLAIN and/or followed by +** statement, possibly preceded by EXPLAIN and/or followed by ** TEMP or TEMPORARY ** ** (5) TRIGGER We are in the middle of a trigger definition that must be @@ -119787,7 +119787,7 @@ SQLITE_API int sqlite3_complete(const char *zSql){ }; #else /* If triggers are not supported by this compile then the statement machine - ** used to detect the end of a statement is much simplier + ** used to detect the end of a statement is much simpler */ static const u8 trans[3][3] = { /* Token: */ @@ -124622,7 +124622,7 @@ struct Fts3Table { #endif #ifdef SQLITE_TEST - /* True to disable the incremental doclist optimization. This is controled + /* True to disable the incremental doclist optimization. This is controlled ** by special insert command 'test-no-incr-doclist'. */ int bNoIncrDoclist; #endif @@ -124665,7 +124665,7 @@ struct Fts3Cursor { /* ** The Fts3Cursor.eSearch member is always set to one of the following. -** Actualy, Fts3Cursor.eSearch can be greater than or equal to +** Actually, Fts3Cursor.eSearch can be greater than or equal to ** FTS3_FULLTEXT_SEARCH. If so, then Fts3Cursor.eSearch - 2 is the index ** of the column to be searched. For example, in ** @@ -132785,7 +132785,7 @@ static const char cType[] = { ** ** In these routine, the letters are in reverse order. So the 'y' rule ** is that 'y' is a consonant unless it is followed by another -** consonent. +** consonant. */ static int isVowel(const char*); static int isConsonant(const char *z){ @@ -132881,7 +132881,7 @@ static int doubleConsonant(const char *z){ /* ** Return TRUE if the word ends with three letters which -** are consonant-vowel-consonent and where the final consonant +** are consonant-vowel-consonant and where the final consonant ** is not 'w', 'x', or 'y'. ** ** The word is reversed here. So we are really checking the @@ -132897,7 +132897,7 @@ static int star_oh(const char *z){ /* ** If the word ends with zFrom and xCond() is true for the stem -** of the word that preceeds the zFrom ending, then change the +** of the word that precedes the zFrom ending, then change the ** ending to zTo. ** ** The input word *pz and zFrom are both in reverse order. zTo @@ -139692,7 +139692,7 @@ SQLITE_PRIVATE int sqlite3Fts3DeferToken( /* ** SQLite value pRowid contains the rowid of a row that may or may not be ** present in the FTS3 table. If it is, delete it and adjust the contents -** of subsiduary data structures accordingly. +** of subsidiary data structures accordingly. */ static int fts3DeleteByRowid( Fts3Table *p, @@ -140399,7 +140399,7 @@ static int fts3StringAppend( } /* If there is insufficient space allocated at StrBuffer.z, use realloc() - ** to grow the buffer until so that it is big enough to accomadate the + ** to grow the buffer until so that it is big enough to accommodate the ** appended data. */ if( pStr->n+nAppend+1>=pStr->nAlloc ){ @@ -141300,7 +141300,7 @@ SQLITE_PRIVATE void sqlite3Fts3Offsets( sCtx.iTerm = 0; (void)fts3ExprIterate(pCsr->pExpr, fts3ExprTermOffsetInit, (void *)&sCtx); - /* Retreive the text stored in column iCol. If an SQL NULL is stored + /* Retrieve the text stored in column iCol. If an SQL NULL is stored ** in column iCol, jump immediately to the next iteration of the loop. ** If an OOM occurs while retrieving the data (this can happen if SQLite ** needs to transform the data from utf-16 to utf-8), return SQLITE_NOMEM diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index c5392760e..c6fe61dd5 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -549,12 +549,9 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_array_multisort, 0, 0, 1) ZEND_ARG_INFO(ZEND_SEND_PREFER_REF, arr1) /* ARRAY_INFO(0, arg1, 0) */ - ZEND_ARG_INFO(ZEND_SEND_PREFER_REF, SORT_ASC_or_SORT_DESC) - ZEND_ARG_INFO(ZEND_SEND_PREFER_REF, SORT_REGULAR_or_SORT_NUMERIC_or_SORT_STRING) - ZEND_ARG_INFO(ZEND_SEND_PREFER_REF, arr2) - ZEND_ARG_INFO(ZEND_SEND_PREFER_REF, SORT_ASC_or_SORT_DESC) - ZEND_ARG_INFO(ZEND_SEND_PREFER_REF, SORT_REGULAR_or_SORT_NUMERIC_or_SORT_STRING) - ZEND_ARG_VARIADIC_INFO(ZEND_SEND_PREFER_REF, more_array_and_sort_options) + ZEND_ARG_INFO(ZEND_SEND_PREFER_REF, sort_order) + ZEND_ARG_INFO(ZEND_SEND_PREFER_REF, sort_flags) + ZEND_ARG_VARIADIC_INFO(ZEND_SEND_PREFER_REF, arr2) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_array_rand, 0, 0, 1) @@ -4108,13 +4105,17 @@ PHP_FUNCTION(putenv) if (putenv(pe.putenv_string) == 0) { /* success */ # else error_code = SetEnvironmentVariable(pe.key, value); -# if _MSC_VER < 1500 - /* Yet another VC6 bug, unset may return env not found */ - if (error_code != 0 || - (error_code == 0 && GetLastError() == ERROR_ENVVAR_NOT_FOUND)) { -# else - if (error_code != 0) { /* success */ -# endif + + if (error_code != 0 +# ifndef ZTS + /* We need both SetEnvironmentVariable and _putenv here as some + dependency lib could use either way to read the environment. + Obviously the CRT version will be useful more often. But + generally, doing both brings us on the safe track at least + in NTS build. */ + && _putenv(pe.putenv_string) == 0 +# endif + ) { /* success */ # endif #endif zend_hash_add(&BG(putenv_ht), pe.key, pe.key_len + 1, (void **) &pe, sizeof(putenv_entry), NULL); diff --git a/ext/standard/dir.c b/ext/standard/dir.c index c64f37c2d..091ecf03c 100644 --- a/ext/standard/dir.c +++ b/ext/standard/dir.c @@ -515,7 +515,7 @@ no_results: continue; } } - /* we need to do this everytime since GLOB_ONLYDIR does not guarantee that + /* we need to do this every time since GLOB_ONLYDIR does not guarantee that * all directories will be filtered. GNU libc documentation states the * following: * If the information about the type of the file is easily available diff --git a/ext/standard/file.c b/ext/standard/file.c index 10ed693f0..a2b4db154 100644 --- a/ext/standard/file.c +++ b/ext/standard/file.c @@ -339,16 +339,16 @@ static int flock_values[] = { LOCK_SH, LOCK_EX, LOCK_UN }; Portable file locking */ PHP_FUNCTION(flock) { - zval *arg1, *arg3 = NULL; + zval *res, *wouldblock = NULL; int act; php_stream *stream; long operation = 0; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl|z", &arg1, &operation, &arg3) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl|z", &res, &operation, &wouldblock) == FAILURE) { return; } - PHP_STREAM_TO_ZVAL(stream, &arg1); + PHP_STREAM_TO_ZVAL(stream, &res); act = operation & 3; if (act < 1 || act > 3) { @@ -356,16 +356,16 @@ PHP_FUNCTION(flock) RETURN_FALSE; } - if (arg3 && PZVAL_IS_REF(arg3)) { - convert_to_long_ex(&arg3); - Z_LVAL_P(arg3) = 0; + if (wouldblock && PZVAL_IS_REF(wouldblock)) { + convert_to_long_ex(&wouldblock); + Z_LVAL_P(wouldblock) = 0; } /* flock_values contains all possible actions if (operation & 4) we won't block on the lock */ act = flock_values[act - 1] | (operation & PHP_LOCK_NB ? LOCK_NB : 0); if (php_stream_lock(stream, act)) { - if (operation && errno == EWOULDBLOCK && arg3 && PZVAL_IS_REF(arg3)) { - Z_LVAL_P(arg3) = 1; + if (operation && errno == EWOULDBLOCK && wouldblock && PZVAL_IS_REF(wouldblock)) { + Z_LVAL_P(wouldblock) = 1; } RETURN_FALSE; } @@ -896,14 +896,14 @@ PHP_NAMED_FUNCTION(php_if_fopen) Close an open file pointer */ PHPAPI PHP_FUNCTION(fclose) { - zval *arg1; + zval *res; php_stream *stream; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &arg1) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &res) == FAILURE) { RETURN_FALSE; } - PHP_STREAM_TO_ZVAL(stream, &arg1); + PHP_STREAM_TO_ZVAL(stream, &res); if ((stream->flags & PHP_STREAM_FLAG_NO_FCLOSE) != 0) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d is not a valid stream resource", stream->rsrc_id); @@ -968,14 +968,14 @@ PHP_FUNCTION(popen) Close a file pointer opened by popen() */ PHP_FUNCTION(pclose) { - zval *arg1; + zval *res; php_stream *stream; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &arg1) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &res) == FAILURE) { RETURN_FALSE; } - PHP_STREAM_TO_ZVAL(stream, &arg1); + PHP_STREAM_TO_ZVAL(stream, &res); FG(pclose_wait) = 1; zend_list_delete(stream->rsrc_id); @@ -988,14 +988,14 @@ PHP_FUNCTION(pclose) Test for end-of-file on a file pointer */ PHPAPI PHP_FUNCTION(feof) { - zval *arg1; + zval *res; php_stream *stream; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &arg1) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &res) == FAILURE) { RETURN_FALSE; } - PHP_STREAM_TO_ZVAL(stream, &arg1); + PHP_STREAM_TO_ZVAL(stream, &res); if (php_stream_eof(stream)) { RETURN_TRUE; @@ -1009,18 +1009,18 @@ PHPAPI PHP_FUNCTION(feof) Get a line from file pointer */ PHPAPI PHP_FUNCTION(fgets) { - zval *arg1; + zval *res; long len = 1024; char *buf = NULL; int argc = ZEND_NUM_ARGS(); size_t line_len = 0; php_stream *stream; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &arg1, &len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &res, &len) == FAILURE) { RETURN_FALSE; } - PHP_STREAM_TO_ZVAL(stream, &arg1); + PHP_STREAM_TO_ZVAL(stream, &res); if (argc == 1) { /* ask streams to give us a buffer of an appropriate size */ @@ -1060,16 +1060,16 @@ exit_failed: Get a character from file pointer */ PHPAPI PHP_FUNCTION(fgetc) { - zval *arg1; + zval *res; char buf[2]; int result; php_stream *stream; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &arg1) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &res) == FAILURE) { RETURN_FALSE; } - PHP_STREAM_TO_ZVAL(stream, &arg1); + PHP_STREAM_TO_ZVAL(stream, &res); result = php_stream_getc(stream); @@ -1180,35 +1180,31 @@ PHP_FUNCTION(fscanf) Binary-safe file write */ PHPAPI PHP_FUNCTION(fwrite) { - zval *arg1; - char *arg2; - int arg2len; + zval *res; + char *input; + int inputlen; int ret; int num_bytes; - long arg3 = 0; - char *buffer = NULL; + long maxlen = 0; php_stream *stream; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|l", &arg1, &arg2, &arg2len, &arg3) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|l", &res, &input, &inputlen, &maxlen) == FAILURE) { RETURN_FALSE; } if (ZEND_NUM_ARGS() == 2) { - num_bytes = arg2len; + num_bytes = inputlen; } else { - num_bytes = MAX(0, MIN((int)arg3, arg2len)); + num_bytes = MAX(0, MIN((int) maxlen, inputlen)); } if (!num_bytes) { RETURN_LONG(0); } - PHP_STREAM_TO_ZVAL(stream, &arg1); + PHP_STREAM_TO_ZVAL(stream, &res); - ret = php_stream_write(stream, buffer ? buffer : arg2, num_bytes); - if (buffer) { - efree(buffer); - } + ret = php_stream_write(stream, input, num_bytes); RETURN_LONG(ret); } @@ -1218,15 +1214,15 @@ PHPAPI PHP_FUNCTION(fwrite) Flushes output */ PHPAPI PHP_FUNCTION(fflush) { - zval *arg1; + zval *res; int ret; php_stream *stream; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &arg1) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &res) == FAILURE) { RETURN_FALSE; } - PHP_STREAM_TO_ZVAL(stream, &arg1); + PHP_STREAM_TO_ZVAL(stream, &res); ret = php_stream_flush(stream); if (ret) { @@ -1240,14 +1236,14 @@ PHPAPI PHP_FUNCTION(fflush) Rewind the position of a file pointer */ PHPAPI PHP_FUNCTION(rewind) { - zval *arg1; + zval *res; php_stream *stream; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &arg1) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &res) == FAILURE) { RETURN_FALSE; } - PHP_STREAM_TO_ZVAL(stream, &arg1); + PHP_STREAM_TO_ZVAL(stream, &res); if (-1 == php_stream_rewind(stream)) { RETURN_FALSE; @@ -1260,15 +1256,15 @@ PHPAPI PHP_FUNCTION(rewind) Get file pointer's read/write position */ PHPAPI PHP_FUNCTION(ftell) { - zval *arg1; + zval *res; long ret; php_stream *stream; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &arg1) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &res) == FAILURE) { RETURN_FALSE; } - PHP_STREAM_TO_ZVAL(stream, &arg1); + PHP_STREAM_TO_ZVAL(stream, &res); ret = php_stream_tell(stream); if (ret == -1) { @@ -1282,17 +1278,17 @@ PHPAPI PHP_FUNCTION(ftell) Seek on a file pointer */ PHPAPI PHP_FUNCTION(fseek) { - zval *arg1; - long arg2, whence = SEEK_SET; + zval *res; + long offset, whence = SEEK_SET; php_stream *stream; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl|l", &arg1, &arg2, &whence) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl|l", &res, &offset, &whence) == FAILURE) { RETURN_FALSE; } - PHP_STREAM_TO_ZVAL(stream, &arg1); + PHP_STREAM_TO_ZVAL(stream, &res); - RETURN_LONG(php_stream_seek(stream, arg2, whence)); + RETURN_LONG(php_stream_seek(stream, offset, whence)); } /* }}} */ @@ -1394,7 +1390,7 @@ PHP_FUNCTION(readfile) Return or change the umask */ PHP_FUNCTION(umask) { - long arg1 = 0; + long mask = 0; int oldumask; oldumask = umask(077); @@ -1403,14 +1399,14 @@ PHP_FUNCTION(umask) BG(umask) = oldumask; } - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &arg1) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &mask) == FAILURE) { RETURN_FALSE; } if (ZEND_NUM_ARGS() == 0) { umask(oldumask); } else { - umask(arg1); + umask(mask); } RETURN_LONG(oldumask); @@ -1421,15 +1417,15 @@ PHP_FUNCTION(umask) Output all remaining data from a file pointer */ PHPAPI PHP_FUNCTION(fpassthru) { - zval *arg1; + zval *res; int size; php_stream *stream; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &arg1) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &res) == FAILURE) { RETURN_FALSE; } - PHP_STREAM_TO_ZVAL(stream, &arg1); + PHP_STREAM_TO_ZVAL(stream, &res); size = php_stream_passthru(stream); RETURN_LONG(size); @@ -1751,15 +1747,15 @@ safe_to_copy: Binary-safe file read */ PHPAPI PHP_FUNCTION(fread) { - zval *arg1; + zval *res; long len; php_stream *stream; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &arg1, &len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &res, &len) == FAILURE) { RETURN_FALSE; } - PHP_STREAM_TO_ZVAL(stream, &arg1); + PHP_STREAM_TO_ZVAL(stream, &res); if (len <= 0) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length parameter must be greater than 0"); diff --git a/ext/standard/ftp_fopen_wrapper.c b/ext/standard/ftp_fopen_wrapper.c index d6eb3b8fb..ab75da713 100644 --- a/ext/standard/ftp_fopen_wrapper.c +++ b/ext/standard/ftp_fopen_wrapper.c @@ -644,11 +644,10 @@ static size_t php_ftp_dirstream_read(php_stream *stream, char *buf, size_t count efree(basename); /* Trim off trailing whitespace characters */ - tmp_len--; - while (tmp_len >= 0 && - (ent->d_name[tmp_len] == '\n' || ent->d_name[tmp_len] == '\r' || - ent->d_name[tmp_len] == '\t' || ent->d_name[tmp_len] == ' ')) { - ent->d_name[tmp_len--] = '\0'; + while (tmp_len > 0 && + (ent->d_name[tmp_len - 1] == '\n' || ent->d_name[tmp_len - 1] == '\r' || + ent->d_name[tmp_len - 1] == '\t' || ent->d_name[tmp_len - 1] == ' ')) { + ent->d_name[--tmp_len] = '\0'; } return sizeof(php_stream_dirent); diff --git a/ext/standard/html.c b/ext/standard/html.c index fd210c808..1d6eaa4c5 100644 --- a/ext/standard/html.c +++ b/ext/standard/html.c @@ -395,7 +395,7 @@ static enum entity_charset determine_charset(char *charset_hint TSRMLS_DC) if ((len == 4) /* sizeof (none|auto|pass) */ && (!memcmp("pass", charset_hint, 4) || !memcmp("auto", charset_hint, 4) || - !memcmp("auto", charset_hint, 4))) { + !memcmp("none", charset_hint, 4))) { charset_hint = NULL; len = 0; } else { diff --git a/ext/standard/html_tables/ents_html401.txt b/ext/standard/html_tables/ents_html401.txt index 7e1564b22..bd3ded9fd 100644 --- a/ext/standard/html_tables/ents_html401.txt +++ b/ext/standard/html_tables/ents_html401.txt @@ -1,4 +1,4 @@ -#039 0027 //artifical; there's no ' in HTML 4.01 +#039 0027 //artificial; there's no ' in HTML 4.01 nbsp 00A0 iexcl 00A1 cent 00A2 diff --git a/ext/standard/image.c b/ext/standard/image.c index f1910d219..122e06335 100644 --- a/ext/standard/image.c +++ b/ext/standard/image.c @@ -460,7 +460,7 @@ static int php_read_APP(php_stream * stream, unsigned int marker, zval *info TSR snprintf(markername, sizeof(markername), "APP%d", marker - M_APP0); if (zend_hash_find(Z_ARRVAL_P(info), markername, strlen(markername)+1, (void **) &tmp) == FAILURE) { - /* XXX we onyl catch the 1st tag of it's kind! */ + /* XXX we only catch the 1st tag of it's kind! */ add_assoc_stringl(info, markername, buffer, length, 1); } @@ -532,7 +532,7 @@ static struct gfxinfo *php_handle_jpeg (php_stream * stream, zval *info TSRMLS_D case M_APP14: case M_APP15: if (info) { - if (!php_read_APP(stream, marker, info TSRMLS_CC)) { /* read all the app markes... */ + if (!php_read_APP(stream, marker, info TSRMLS_CC)) { /* read all the app marks... */ return result; } } else { diff --git a/ext/standard/scanf.h b/ext/standard/scanf.h index 9d4acd4a8..b1f5772e8 100644 --- a/ext/standard/scanf.h +++ b/ext/standard/scanf.h @@ -23,7 +23,7 @@ #define SCAN_MAX_ARGS 0xFF /* Maximum number of variable which can be */ - /* passed to (f|s)scanf. This is an artifical */ + /* passed to (f|s)scanf. This is an artificial */ /* upper limit to keep resources in check and */ /* minimize the possibility of exploits */ diff --git a/ext/standard/tests/serialize/bug68545.phpt b/ext/standard/tests/serialize/bug68545.phpt new file mode 100644 index 000000000..e7250b37b --- /dev/null +++ b/ext/standard/tests/serialize/bug68545.phpt @@ -0,0 +1,11 @@ +--TEST-- +Bug #68545 NULL pointer dereference in unserialize.c:var_push_dtor +--FILE-- +<?php +var_dump(unserialize('a:6:{a:6:{s:3:"322";s:3:"bar";s:3:"bar";s:3:"foo";a:6:{a:6:{s:3:"322";s:3:"bar";s:3:"bar";s:3:"foo";s:3:"bar";a:6:{a:6:{s:3:"322";s:3:"bar";s:3:"bar";s:3:"foo";a:6:{a:6:{s:3:"322";s:3:"bar";s:3:"b22";s:3:"bar";s:3:"bar";s:3:"foo";s:3:"bar";a:6:{a:6:{s:3:"322";s:3:"bar";s:3:"bar";s:3:"foo";s:3:"bar";s:3:"bar";')); +?> +===DONE=== +--EXPECTF-- +Notice: unserialize(): Error at offset %d of %d bytes in %sbug68545.php on line %d +bool(false) +===DONE=== diff --git a/ext/standard/tests/serialize/bug68594.phpt b/ext/standard/tests/serialize/bug68594.phpt new file mode 100644 index 000000000..60fc7a76a --- /dev/null +++ b/ext/standard/tests/serialize/bug68594.phpt @@ -0,0 +1,23 @@ +--TEST-- +Bug #68545 Use after free vulnerability in unserialize() +--FILE-- +<?php +for ($i=4; $i<100; $i++) { + $m = new StdClass(); + + $u = array(1); + + $m->aaa = array(1,2,&$u,4,5); + $m->bbb = 1; + $m->ccc = &$u; + $m->ddd = str_repeat("A", $i); + + $z = serialize($m); + $z = str_replace("bbb", "aaa", $z); + $y = unserialize($z); + $z = serialize($y); +} +?> +===DONE=== +--EXPECTF-- +===DONE=== diff --git a/ext/standard/tests/strings/addcslashes_005.phpt b/ext/standard/tests/strings/addcslashes_005.phpt new file mode 100644 index 000000000..f0b2fbcec --- /dev/null +++ b/ext/standard/tests/strings/addcslashes_005.phpt @@ -0,0 +1,12 @@ +--TEST-- +addcslashes(); function test with warning +--CREDITS-- + marcosptf - <marcosptf@yahoo.com.br> +#phptestfest PHPSP on Google - Sao Paulo - Brazil - 2014-06-05 +--FILE-- +<?php +echo addcslashes("zoo['.']","z..A"); +?> +--EXPECTF-- +Warning: addcslashes(): Invalid '..'-range, '..'-range needs to be incrementing in %s on line %d +\zoo['\.'] diff --git a/ext/standard/tests/strings/bin2hex_001.phpt b/ext/standard/tests/strings/bin2hex_001.phpt new file mode 100644 index 000000000..e73500a30 --- /dev/null +++ b/ext/standard/tests/strings/bin2hex_001.phpt @@ -0,0 +1,11 @@ +--TEST-- +bin2hex(); function test +--CREDITS-- +marcosptf - <marcosptf@yahoo.com.br> +#phptestfest PHPSP on Google - Sao Paulo - Brazil - 2014-06-05 +--FILE-- +<?php +echo bin2hex("123456"); +?> +--EXPECT-- +313233343536 diff --git a/ext/standard/tests/strings/sprintf_variation34.phpt b/ext/standard/tests/strings/sprintf_variation34.phpt index c6186b678..8a5cd809d 100644 --- a/ext/standard/tests/strings/sprintf_variation34.phpt +++ b/ext/standard/tests/strings/sprintf_variation34.phpt @@ -29,8 +29,8 @@ $integer_values = array( 0Xfff, 0XFA, -0x80000000, // max negative integer as hexadecimal - 0x7fffffff, // max postive integer as hexadecimal - 0x7FFFFFFF, // max postive integer as hexadecimal + 0x7fffffff, // max positive integer as hexadecimal + 0x7FFFFFFF, // max positive integer as hexadecimal 0123, // integer as octal 01912, // should be quivalent to octal 1 -020000000000, // max negative integer as octal diff --git a/ext/standard/tests/strings/sprintf_variation40_64bit.phpt b/ext/standard/tests/strings/sprintf_variation40_64bit.phpt index da6f37ace..029e94c78 100644 --- a/ext/standard/tests/strings/sprintf_variation40_64bit.phpt +++ b/ext/standard/tests/strings/sprintf_variation40_64bit.phpt @@ -25,8 +25,8 @@ $integer_values = array( 0Xfff, 0XFA, -0x80000000, // max negative integer as hexadecimal - 0x7fffffff, // max postive integer as hexadecimal - 0x7FFFFFFF, // max postive integer as hexadecimal + 0x7fffffff, // max positive integer as hexadecimal + 0x7FFFFFFF, // max positive integer as hexadecimal 0123, // integer as octal 01912, // should be quivalent to octal 1 -020000000000, // max negative integer as octal diff --git a/ext/standard/var_unserializer.c b/ext/standard/var_unserializer.c index b06696aaf..c50cf3aac 100644 --- a/ext/standard/var_unserializer.c +++ b/ext/standard/var_unserializer.c @@ -1,4 +1,4 @@ -/* Generated by re2c 0.13.5 */ +/* Generated by re2c 0.13.7.5 */ /* +----------------------------------------------------------------------+ | PHP Version 5 | @@ -59,7 +59,13 @@ static inline void var_push(php_unserialize_data_t *var_hashx, zval **rval) PHPAPI void var_push_dtor(php_unserialize_data_t *var_hashx, zval **rval) { - var_entries *var_hash = (*var_hashx)->last_dtor; + var_entries *var_hash; + + if (!var_hashx || !*var_hashx) { + return; + } + + var_hash = (*var_hashx)->last_dtor; #if VAR_ENTRIES_DBG fprintf(stderr, "var_push_dtor(%ld): %d\n", var_hash?var_hash->used_slots:-1L, Z_TYPE_PP(rval)); #endif @@ -334,6 +340,9 @@ static inline int process_nested_data(UNSERIALIZE_PARAMETER, HashTable *ht, long } else { /* object properties should include no integers */ convert_to_string(key); + if (zend_symtable_find(ht, Z_STRVAL_P(key), Z_STRLEN_P(key) + 1, (void **)&old_data)==SUCCESS) { + var_push_dtor(var_hash, old_data); + } zend_hash_update(ht, Z_STRVAL_P(key), Z_STRLEN_P(key) + 1, &data, sizeof data, NULL); } @@ -599,7 +608,8 @@ yy20: if (yybm[0+yych] & 128) { goto yy20; } - if (yych != ':') goto yy18; + if (yych <= '/') goto yy18; + if (yych >= ';') goto yy18; yych = *++YYCURSOR; if (yych != '"') goto yy18; ++YYCURSOR; diff --git a/ext/standard/var_unserializer.re b/ext/standard/var_unserializer.re index ef553ffb5..387ba6aea 100644 --- a/ext/standard/var_unserializer.re +++ b/ext/standard/var_unserializer.re @@ -58,7 +58,13 @@ static inline void var_push(php_unserialize_data_t *var_hashx, zval **rval) PHPAPI void var_push_dtor(php_unserialize_data_t *var_hashx, zval **rval) { - var_entries *var_hash = (*var_hashx)->last_dtor; + var_entries *var_hash; + + if (!var_hashx || !*var_hashx) { + return; + } + + var_hash = (*var_hashx)->last_dtor; #if VAR_ENTRIES_DBG fprintf(stderr, "var_push_dtor(%ld): %d\n", var_hash?var_hash->used_slots:-1L, Z_TYPE_PP(rval)); #endif @@ -340,6 +346,9 @@ static inline int process_nested_data(UNSERIALIZE_PARAMETER, HashTable *ht, long } else { /* object properties should include no integers */ convert_to_string(key); + if (zend_symtable_find(ht, Z_STRVAL_P(key), Z_STRLEN_P(key) + 1, (void **)&old_data)==SUCCESS) { + var_push_dtor(var_hash, old_data); + } zend_hash_update(ht, Z_STRVAL_P(key), Z_STRLEN_P(key) + 1, &data, sizeof data, NULL); } diff --git a/ext/xmlrpc/libxmlrpc/xml_to_soap.c b/ext/xmlrpc/libxmlrpc/xml_to_soap.c index ac103e061..61f9834e9 100644 --- a/ext/xmlrpc/libxmlrpc/xml_to_soap.c +++ b/ext/xmlrpc/libxmlrpc/xml_to_soap.c @@ -243,7 +243,7 @@ XMLRPC_VALUE xml_element_to_SOAP_REQUEST_worker(XMLRPC_REQUEST request, xCurrent = XMLRPC_CreateValueEmpty(); } - /* increment recursion depth guage */ + /* increment recursion depth gauge */ depth ++; /* safety first. must have a valid element */ diff --git a/ext/xmlwriter/tests/011.phpt b/ext/xmlwriter/tests/011.phpt new file mode 100644 index 000000000..51861673a --- /dev/null +++ b/ext/xmlwriter/tests/011.phpt @@ -0,0 +1,35 @@ +--TEST-- +XMLWriter: libxml2 XML Writer, write_attribute_ns function +--CREDITS-- +Mauricio Vieira <mauricio [at] @mauriciovieira [dot] net> +#testfest PHPSP on 2014-07-05 +--SKIPIF-- +<?php +if (!extension_loaded("xmlwriter")) die("skip"); +if (LIBXML_VERSION < 20617) die("skip: libxml2 2.6.17+ required"); +?> +--FILE-- +<?php +/* $Id$ */ + +$xw = xmlwriter_open_memory(); +xmlwriter_set_indent($xw, TRUE); +xmlwriter_set_indent_string($xw, ' '); +xmlwriter_start_document($xw, '1.0', "UTF-8"); +xmlwriter_start_element($xw, 'root'); +xmlwriter_start_element_ns($xw, 'ns1', 'child1', 'urn:ns1'); +xmlwriter_write_attribute_ns($xw, 'ns1','att1', 'urn:ns1', '<>"\'&'); +xmlwriter_write_element($xw, 'chars', "special characters: <>\"'&"); +xmlwriter_end_element($xw); +xmlwriter_end_document($xw); +// Force to write and empty the buffer +$output = xmlwriter_flush($xw, true); +print $output; +?> +--EXPECT-- +<?xml version="1.0" encoding="UTF-8"?> +<root> + <ns1:child1 ns1:att1="<>"'&" xmlns:ns1="urn:ns1"> + <chars>special characters: <>"'&</chars> + </ns1:child1> +</root> diff --git a/ext/xmlwriter/tests/012.phpt b/ext/xmlwriter/tests/012.phpt new file mode 100644 index 000000000..b6a4ad8c5 --- /dev/null +++ b/ext/xmlwriter/tests/012.phpt @@ -0,0 +1,38 @@ +--TEST-- +XMLWriter: libxml2 XML Writer, full_end_element function +--CREDITS-- +Mauricio Vieira <mauricio [at] @mauriciovieira [dot] net> +#testfest PHPSP on 2014-07-05 +--SKIPIF-- +<?php +if (!extension_loaded("xmlwriter")) die("skip"); +if (LIBXML_VERSION < 20617) die("skip: libxml2 2.6.17+ required"); +?> +--FILE-- +<?php +/* $Id$ */ + +$xw = xmlwriter_open_memory(); +xmlwriter_set_indent($xw, TRUE); +xmlwriter_set_indent_string($xw, ' '); +xmlwriter_start_document($xw, '1.0', "UTF-8"); +xmlwriter_start_element($xw, 'root'); +xmlwriter_start_element_ns($xw, 'ns1', 'child1', 'urn:ns1'); +xmlwriter_write_attribute_ns($xw, 'ns1','att1', 'urn:ns1', '<>"\'&'); +xmlwriter_write_element($xw, 'chars', "special characters: <>\"'&"); +xmlwriter_end_element($xw); +xmlwriter_start_element($xw, 'empty'); +xmlwriter_full_end_element($xw); +xmlwriter_full_end_element($xw); +// Force to write and empty the buffer +$output = xmlwriter_flush($xw, true); +print $output; +?> +--EXPECT-- +<?xml version="1.0" encoding="UTF-8"?> +<root> + <ns1:child1 ns1:att1="<>"'&" xmlns:ns1="urn:ns1"> + <chars>special characters: <>"'&</chars> + </ns1:child1> + <empty></empty> +</root> diff --git a/ext/xmlwriter/tests/OO_010.phpt b/ext/xmlwriter/tests/OO_010.phpt new file mode 100644 index 000000000..d4444bafe --- /dev/null +++ b/ext/xmlwriter/tests/OO_010.phpt @@ -0,0 +1,36 @@ +--TEST-- +XMLWriter: libxml2 XML Writer, writeAttributeNS method +--CREDITS-- +Mauricio Vieira <mauricio [at] @mauriciovieira [dot] net> +#testfest PHPSP on 2014-07-05 +--SKIPIF-- +<?php +if (!extension_loaded("xmlwriter")) die("skip"); +if (LIBXML_VERSION < 20617) die("skip: libxml2 2.6.17+ required"); +?> +--FILE-- +<?php +/* $Id$ */ + +$xw = new XMLWriter(); +$xw->openMemory(); +$xw->setIndent(TRUE); +$xw->setIndentString(' '); +$xw->startDocument('1.0', "UTF-8"); +$xw->startElement('root'); +$xw->startElementNS('ns1', 'child1', 'urn:ns1'); +$xw->writeAttributeNS('ns1', 'att1', 'urn:ns1', '<>"\'&'); +$xw->writeElement('chars', "special characters: <>\"'&"); +$xw->endElement(); +$xw->endDocument(); +// Force to write and empty the buffer +$output = $xw->flush(true); +print $output; +?> +--EXPECT-- +<?xml version="1.0" encoding="UTF-8"?> +<root> + <ns1:child1 ns1:att1="<>"'&" xmlns:ns1="urn:ns1"> + <chars>special characters: <>"'&</chars> + </ns1:child1> +</root> diff --git a/ext/xmlwriter/tests/OO_011.phpt b/ext/xmlwriter/tests/OO_011.phpt new file mode 100644 index 000000000..0407e1b05 --- /dev/null +++ b/ext/xmlwriter/tests/OO_011.phpt @@ -0,0 +1,39 @@ +--TEST-- +XMLWriter: libxml2 XML Writer, fullEndElement method +--CREDITS-- +Mauricio Vieira <mauricio [at] @mauriciovieira [dot] net> +#testfest PHPSP on 2014-07-05 +--SKIPIF-- +<?php +if (!extension_loaded("xmlwriter")) die("skip"); +if (LIBXML_VERSION < 20617) die("skip: libxml2 2.6.17+ required"); +?> +--FILE-- +<?php +/* $Id$ */ + +$xw = new XMLWriter(); +$xw->openMemory(); +$xw->setIndent(TRUE); +$xw->setIndentString(' '); +$xw->startDocument('1.0', "UTF-8"); +$xw->startElement('root'); +$xw->startElementNS('ns1', 'child1', 'urn:ns1'); +$xw->writeAttributeNS('ns1', 'att1', 'urn:ns1', '<>"\'&'); +$xw->writeElement('chars', "special characters: <>\"'&"); +$xw->endElement(); +$xw->startElement('empty'); +$xw->fullEndElement(); +$xw->fullEndElement(); +// Force to write and empty the buffer +$output = $xw->flush(true); +print $output; +?> +--EXPECT-- +<?xml version="1.0" encoding="UTF-8"?> +<root> + <ns1:child1 ns1:att1="<>"'&" xmlns:ns1="urn:ns1"> + <chars>special characters: <>"'&</chars> + </ns1:child1> + <empty></empty> +</root> diff --git a/ext/xsl/tests/xsltprocessor_hasExsltSupport.phpt b/ext/xsl/tests/xsltprocessor_hasExsltSupport.phpt new file mode 100644 index 000000000..226712930 --- /dev/null +++ b/ext/xsl/tests/xsltprocessor_hasExsltSupport.phpt @@ -0,0 +1,13 @@ +--TEST-- +Test the basics to function XSLTProcessor::hasExsltSupport(). +--CREDITS-- +Rodrigo Prado de Jesus <royopa [at] gmail [dot] com> +--SKIPIF-- +<?php extension_loaded('xsl') or die('skip xsl extension is not available'); ?> +--FILE-- +<?php +$proc = new XSLTProcessor(); +var_dump($proc->hasExsltSupport()); +?> +--EXPECTF-- +bool(true)
\ No newline at end of file diff --git a/ext/xsl/tests/xsltprocessor_hasExsltSupport_not_available_extension.phpt b/ext/xsl/tests/xsltprocessor_hasExsltSupport_not_available_extension.phpt new file mode 100644 index 000000000..d8b8fa846 --- /dev/null +++ b/ext/xsl/tests/xsltprocessor_hasExsltSupport_not_available_extension.phpt @@ -0,0 +1,13 @@ +--TEST-- +Test the basics to function XSLTProcessor::hasExsltSupport() when the xsl extension os not available. +--CREDITS-- +Rodrigo Prado de Jesus <royopa [at] gmail [dot] com> +--SKIPIF-- +<?php (!extension_loaded('xsl')) or die('skip xsl extension is available'); ?> +--FILE-- +<?php +$proc = new XSLTProcessor(); +var_dump($proc->hasExsltSupport()); +?> +--EXPECTF-- +Fatal error: Class 'XSLTProcessor' not found in %s on line %i
\ No newline at end of file diff --git a/ext/xsl/tests/xsltprocessor_hasExsltSupport_wrongparam_001.phpt b/ext/xsl/tests/xsltprocessor_hasExsltSupport_wrongparam_001.phpt new file mode 100644 index 000000000..107157fa2 --- /dev/null +++ b/ext/xsl/tests/xsltprocessor_hasExsltSupport_wrongparam_001.phpt @@ -0,0 +1,13 @@ +--TEST-- +Check XSLTProcessor::hasExsltSupport() with 1 parameter +--CREDITS-- +Rodrigo Prado de Jesus <royopa [at] gmail [dot] com> +--SKIPIF-- +<?php extension_loaded('xsl') or die('skip xsl extension is not available'); ?> +--FILE-- +<?php +$proc = new XSLTProcessor(); +var_dump($proc->hasExsltSupport('stringValue')); +?> +--EXPECTF-- +bool(true)
\ No newline at end of file diff --git a/ext/xsl/tests/xsltprocessor_transformToDoc.phpt b/ext/xsl/tests/xsltprocessor_transformToDoc.phpt new file mode 100644 index 000000000..ff4be47e3 --- /dev/null +++ b/ext/xsl/tests/xsltprocessor_transformToDoc.phpt @@ -0,0 +1,51 @@ +--TEST-- +Test the basics to function XSLTProcessor::transformToDoc(). +--CREDITS-- +Rodrigo Prado de Jesus <royopa [at] gmail [dot] com> +--SKIPIF-- +<?php extension_loaded('xsl') or die('skip xsl extension is not available'); ?> +--FILE-- +<?php +$xml = <<<EOB +<allusers> + <user> + <uid>royopa</uid> + </user> +</allusers> +EOB; +$xsl = <<<EOB +<?xml version="1.0" encoding="UTF-8"?> +<xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:php="http://php.net/xsl"> +<xsl:output method="html" encoding="utf-8" indent="yes"/> + <xsl:template match="allusers"> + <html><body> + <h2>Users</h2> + <table> + <xsl:for-each select="user"> + <tr><td> + <xsl:value-of + select="php:function('ucfirst',string(uid))"/> + </td></tr> + </xsl:for-each> + </table> + </body></html> + </xsl:template> +</xsl:stylesheet> +EOB; + +$xmldoc = new DOMDocument('1.0', 'utf-8'); +$xmldoc->loadXML($xml); + +$xsldoc = new DOMDocument('1.0', 'utf-8'); +$xsldoc->loadXML($xsl); + +$proc = new XSLTProcessor(); +$proc->registerPHPFunctions(); +$proc->importStyleSheet($xsldoc); + +var_dump($proc->transformToDoc($xmldoc)->firstChild->tagName); +?> +--EXPECT-- +string(4) "html"
\ No newline at end of file diff --git a/ext/xsl/tests/xsltprocessor_transformToDoc_nullparam.phpt b/ext/xsl/tests/xsltprocessor_transformToDoc_nullparam.phpt new file mode 100644 index 000000000..735fd7295 --- /dev/null +++ b/ext/xsl/tests/xsltprocessor_transformToDoc_nullparam.phpt @@ -0,0 +1,54 @@ +--TEST-- +Check XSLTProcessor::transformToDoc() with null parameter +--CREDITS-- +Rodrigo Prado de Jesus <royopa [at] gmail [dot] com> +--SKIPIF-- +<?php extension_loaded('xsl') or die('skip xsl extension is not available'); ?> +--FILE-- +<?php +$xml = <<<EOB +<allusers> + <user> + <uid>bob</uid> + </user> + <user> + <uid>joe</uid> + </user> +</allusers> +EOB; +$xsl = <<<EOB +<?xml version="1.0" encoding="UTF-8"?> +<xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:php="http://php.net/xsl"> +<xsl:output method="html" encoding="utf-8" indent="yes"/> + <xsl:template match="allusers"> + <html><body> + <h2>Users</h2> + <table> + <xsl:for-each select="user"> + <tr><td> + <xsl:value-of + select="php:function('ucfirst',string(uid))"/> + </td></tr> + </xsl:for-each> + </table> + </body></html> + </xsl:template> +</xsl:stylesheet> +EOB; + +$xmldoc = new DOMDocument('1.0', 'utf-8'); +$xmldoc->loadXML($xml); + +$xsldoc = new DOMDocument('1.0', 'utf-8'); +$xsldoc->loadXML($xsl); + +$proc = new XSLTProcessor(); +$proc->registerPHPFunctions(); +$proc->importStyleSheet($xsldoc); + +echo $proc->transformToDoc(null); +?> +--EXPECTF-- +Warning: XSLTProcessor::transformToDoc() expects parameter 1 to be object, null given in %s on line %i
\ No newline at end of file diff --git a/ext/xsl/tests/xsltprocessor_transformToDoc_wrongparam_001.phpt b/ext/xsl/tests/xsltprocessor_transformToDoc_wrongparam_001.phpt new file mode 100644 index 000000000..1460de39a --- /dev/null +++ b/ext/xsl/tests/xsltprocessor_transformToDoc_wrongparam_001.phpt @@ -0,0 +1,56 @@ +--TEST-- +Check XSLTProcessor::transformToDoc() with array parameter +--CREDITS-- +Rodrigo Prado de Jesus <royopa [at] gmail [dot] com> +--SKIPIF-- +<?php extension_loaded('xsl') or die('skip xsl extension is not available'); ?> +--FILE-- +<?php +$xml = <<<EOB +<allusers> + <user> + <uid>bob</uid> + </user> + <user> + <uid>joe</uid> + </user> +</allusers> +EOB; +$xsl = <<<EOB +<?xml version="1.0" encoding="UTF-8"?> +<xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:php="http://php.net/xsl"> +<xsl:output method="html" encoding="utf-8" indent="yes"/> + <xsl:template match="allusers"> + <html><body> + <h2>Users</h2> + <table> + <xsl:for-each select="user"> + <tr><td> + <xsl:value-of + select="php:function('ucfirst',string(uid))"/> + </td></tr> + </xsl:for-each> + </table> + </body></html> + </xsl:template> +</xsl:stylesheet> +EOB; + +$xmldoc = new DOMDocument('1.0', 'utf-8'); +$xmldoc->loadXML($xml); + +$xsldoc = new DOMDocument('1.0', 'utf-8'); +$xsldoc->loadXML($xsl); + +$proc = new XSLTProcessor(); +$proc->registerPHPFunctions(); +$proc->importStyleSheet($xsldoc); + +$wrong_parameter = array(); + +echo $proc->transformToDoc($wrong_parameter); +?> +--EXPECTF-- +Warning: XSLTProcessor::transformToDoc() expects parameter 1 to be object, array given in %s on line %i
\ No newline at end of file diff --git a/ext/xsl/tests/xsltprocessor_transformToDoc_wrongparam_002.phpt b/ext/xsl/tests/xsltprocessor_transformToDoc_wrongparam_002.phpt new file mode 100644 index 000000000..2c6c99ae2 --- /dev/null +++ b/ext/xsl/tests/xsltprocessor_transformToDoc_wrongparam_002.phpt @@ -0,0 +1,54 @@ +--TEST-- +Check XSLTProcessor::transformToDoc() with 4 parameters +--CREDITS-- +Rodrigo Prado de Jesus <royopa [at] gmail [dot] com> +--SKIPIF-- +<?php extension_loaded('xsl') or die('skip xsl extension is not available'); ?> +--FILE-- +<?php +$xml = <<<EOB +<allusers> + <user> + <uid>bob</uid> + </user> + <user> + <uid>joe</uid> + </user> +</allusers> +EOB; +$xsl = <<<EOB +<?xml version="1.0" encoding="UTF-8"?> +<xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:php="http://php.net/xsl"> +<xsl:output method="html" encoding="utf-8" indent="yes"/> + <xsl:template match="allusers"> + <html><body> + <h2>Users</h2> + <table> + <xsl:for-each select="user"> + <tr><td> + <xsl:value-of + select="php:function('ucfirst',string(uid))"/> + </td></tr> + </xsl:for-each> + </table> + </body></html> + </xsl:template> +</xsl:stylesheet> +EOB; + +$xmldoc = new DOMDocument('1.0', 'utf-8'); +$xmldoc->loadXML($xml); + +$xsldoc = new DOMDocument('1.0', 'utf-8'); +$xsldoc->loadXML($xsl); + +$proc = new XSLTProcessor(); +$proc->registerPHPFunctions(); +$proc->importStyleSheet($xsldoc); + +echo $proc->transformToDoc($xmldoc, 'string', 98, true); +?> +--EXPECTF-- +Warning: XSLTProcessor::transformToDoc() expects at most 2 parameters, 4 given in %s on line %i diff --git a/ext/xsl/tests/xsltprocessor_transformToDoc_wrongparam_003.phpt b/ext/xsl/tests/xsltprocessor_transformToDoc_wrongparam_003.phpt new file mode 100644 index 000000000..19fc3e44e --- /dev/null +++ b/ext/xsl/tests/xsltprocessor_transformToDoc_wrongparam_003.phpt @@ -0,0 +1,56 @@ +--TEST-- +Check XSLTProcessor::transformToDoc() with string parameter +--CREDITS-- +Rodrigo Prado de Jesus <royopa [at] gmail [dot] com> +--SKIPIF-- +<?php extension_loaded('xsl') or die('skip xsl extension is not available'); ?> +--FILE-- +<?php +$xml = <<<EOB +<allusers> + <user> + <uid>bob</uid> + </user> + <user> + <uid>joe</uid> + </user> +</allusers> +EOB; +$xsl = <<<EOB +<?xml version="1.0" encoding="UTF-8"?> +<xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:php="http://php.net/xsl"> +<xsl:output method="html" encoding="utf-8" indent="yes"/> + <xsl:template match="allusers"> + <html><body> + <h2>Users</h2> + <table> + <xsl:for-each select="user"> + <tr><td> + <xsl:value-of + select="php:function('ucfirst',string(uid))"/> + </td></tr> + </xsl:for-each> + </table> + </body></html> + </xsl:template> +</xsl:stylesheet> +EOB; + +$xmldoc = new DOMDocument('1.0', 'utf-8'); +$xmldoc->loadXML($xml); + +$xsldoc = new DOMDocument('1.0', 'utf-8'); +$xsldoc->loadXML($xsl); + +$proc = new XSLTProcessor(); +$proc->registerPHPFunctions(); +$proc->importStyleSheet($xsldoc); + +$wrong_parameter = 'stringValue'; + +echo $proc->transformToDoc($wrong_parameter); +?> +--EXPECTF-- +Warning: XSLTProcessor::transformToDoc() expects parameter 1 to be object, string given in %s on line %i
\ No newline at end of file diff --git a/ext/xsl/tests/xsltprocessor_transformToDoc_wrongparam_004.phpt b/ext/xsl/tests/xsltprocessor_transformToDoc_wrongparam_004.phpt new file mode 100644 index 000000000..8df84b7cb --- /dev/null +++ b/ext/xsl/tests/xsltprocessor_transformToDoc_wrongparam_004.phpt @@ -0,0 +1,56 @@ +--TEST-- +Check XSLTProcessor::transformToDoc() with boolean parameter +--CREDITS-- +Rodrigo Prado de Jesus <royopa [at] gmail [dot] com> +--SKIPIF-- +<?php extension_loaded('xsl') or die('skip xsl extension is not available'); ?> +--FILE-- +<?php +$xml = <<<EOB +<allusers> + <user> + <uid>bob</uid> + </user> + <user> + <uid>joe</uid> + </user> +</allusers> +EOB; +$xsl = <<<EOB +<?xml version="1.0" encoding="UTF-8"?> +<xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:php="http://php.net/xsl"> +<xsl:output method="html" encoding="utf-8" indent="yes"/> + <xsl:template match="allusers"> + <html><body> + <h2>Users</h2> + <table> + <xsl:for-each select="user"> + <tr><td> + <xsl:value-of + select="php:function('ucfirst',string(uid))"/> + </td></tr> + </xsl:for-each> + </table> + </body></html> + </xsl:template> +</xsl:stylesheet> +EOB; + +$xmldoc = new DOMDocument('1.0', 'utf-8'); +$xmldoc->loadXML($xml); + +$xsldoc = new DOMDocument('1.0', 'utf-8'); +$xsldoc->loadXML($xsl); + +$proc = new XSLTProcessor(); +$proc->registerPHPFunctions(); +$proc->importStyleSheet($xsldoc); + +$wrong_parameter = true; + +echo $proc->transformToDoc($wrong_parameter); +?> +--EXPECTF-- +Warning: XSLTProcessor::transformToDoc() expects parameter 1 to be object, boolean given in %s on line %i
\ No newline at end of file diff --git a/ext/xsl/tests/xsltprocessor_transformToURI.phpt b/ext/xsl/tests/xsltprocessor_transformToURI.phpt new file mode 100644 index 000000000..27ed4e297 --- /dev/null +++ b/ext/xsl/tests/xsltprocessor_transformToURI.phpt @@ -0,0 +1,53 @@ +--TEST-- +Test the basics to function XSLTProcessor::transformToURI(). +--CREDITS-- +Rodrigo Prado de Jesus <royopa [at] gmail [dot] com> +--SKIPIF-- +<?php extension_loaded('xsl') or die('skip xsl extension is not available'); ?> +--FILE-- +<?php +$xml = <<<EOB +<allusers> + <user> + <uid>bob</uid> + </user> + <user> + <uid>joe</uid> + </user> +</allusers> +EOB; +$xsl = <<<EOB +<?xml version="1.0" encoding="UTF-8"?> +<xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:php="http://php.net/xsl"> +<xsl:output method="html" encoding="utf-8" indent="yes"/> + <xsl:template match="allusers"> + <html><body> + <table> + <xsl:for-each select="user"> + <tr><td> + <xsl:value-of + select="php:function('ucfirst',string(uid))"/> + </td></tr> + </xsl:for-each> + </table> + </body></html> + </xsl:template> +</xsl:stylesheet> +EOB; + +$xmldoc = new DOMDocument('1.0', 'utf-8'); +$xmldoc->loadXML($xml); + +$xsldoc = new DOMDocument('1.0', 'utf-8'); +$xsldoc->loadXML($xsl); + +$proc = new XSLTProcessor(); +$proc->registerPHPFunctions(); +$proc->importStyleSheet($xsldoc); + +var_dump($proc->transformToURI($xsldoc, 'php://output')); +?> +--EXPECTF-- +int(56)
\ No newline at end of file diff --git a/ext/xsl/tests/xsltprocessor_transformToURI_nullparam.phpt b/ext/xsl/tests/xsltprocessor_transformToURI_nullparam.phpt new file mode 100644 index 000000000..69afeaf7b --- /dev/null +++ b/ext/xsl/tests/xsltprocessor_transformToURI_nullparam.phpt @@ -0,0 +1,54 @@ +--TEST-- +Check XSLTProcessor::transformToURI() with null parameters +--CREDITS-- +Rodrigo Prado de Jesus <royopa [at] gmail [dot] com> +--SKIPIF-- +<?php extension_loaded('xsl') or die('skip xsl extension is not available'); ?> +--FILE-- +<?php +$xml = <<<EOB +<allusers> + <user> + <uid>bob</uid> + </user> + <user> + <uid>joe</uid> + </user> +</allusers> +EOB; +$xsl = <<<EOB +<?xml version="1.0" encoding="UTF-8"?> +<xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:php="http://php.net/xsl"> +<xsl:output method="html" encoding="utf-8" indent="yes"/> + <xsl:template match="allusers"> + <html><body> + <h2>Users</h2> + <table> + <xsl:for-each select="user"> + <tr><td> + <xsl:value-of + select="php:function('ucfirst',string(uid))"/> + </td></tr> + </xsl:for-each> + </table> + </body></html> + </xsl:template> +</xsl:stylesheet> +EOB; + +$xmldoc = new DOMDocument('1.0', 'utf-8'); +$xmldoc->loadXML($xml); + +$xsldoc = new DOMDocument('1.0', 'utf-8'); +$xsldoc->loadXML($xsl); + +$proc = new XSLTProcessor(); +$proc->registerPHPFunctions(); +$proc->importStyleSheet($xsldoc); + +echo $proc->transformToURI(null, null); +?> +--EXPECTF-- +Warning: XSLTProcessor::transformToUri() expects parameter 1 to be object, null given in %s on line %i
\ No newline at end of file diff --git a/ext/xsl/tests/xsltprocessor_transformToURI_wrongparam_001.phpt b/ext/xsl/tests/xsltprocessor_transformToURI_wrongparam_001.phpt new file mode 100644 index 000000000..64b98ce7e --- /dev/null +++ b/ext/xsl/tests/xsltprocessor_transformToURI_wrongparam_001.phpt @@ -0,0 +1,57 @@ +--TEST-- +Check XSLTProcessor::transformToURI() with array parameter +--CREDITS-- +Rodrigo Prado de Jesus <royopa [at] gmail [dot] com> +--SKIPIF-- +<?php extension_loaded('xsl') or die('skip xsl extension is not available'); ?> +--FILE-- +<?php +$xml = <<<EOB +<allusers> + <user> + <uid>bob</uid> + </user> + <user> + <uid>joe</uid> + </user> +</allusers> +EOB; +$xsl = <<<EOB +<?xml version="1.0" encoding="UTF-8"?> +<xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:php="http://php.net/xsl"> +<xsl:output method="html" encoding="utf-8" indent="yes"/> + <xsl:template match="allusers"> + <html><body> + <h2>Users</h2> + <table> + <xsl:for-each select="user"> + <tr><td> + <xsl:value-of + select="php:function('ucfirst',string(uid))"/> + </td></tr> + </xsl:for-each> + </table> + </body></html> + </xsl:template> +</xsl:stylesheet> +EOB; + +$xmldoc = new DOMDocument('1.0', 'utf-8'); +$xmldoc->loadXML($xml); + +$xsldoc = new DOMDocument('1.0', 'utf-8'); +$xsldoc->loadXML($xsl); + +$proc = new XSLTProcessor(); +$proc->registerPHPFunctions(); +$proc->importStyleSheet($xsldoc); + +$wrong_parameter = array(); +$uri = 'php://output'; + +echo $proc->transformToURI($wrong_parameter, $uri); +?> +--EXPECTF-- +Warning: XSLTProcessor::transformToUri() expects parameter 1 to be object, array given in %s on line %i
\ No newline at end of file diff --git a/ext/xsl/tests/xsltprocessor_transformToURI_wrongparam_002.phpt b/ext/xsl/tests/xsltprocessor_transformToURI_wrongparam_002.phpt new file mode 100644 index 000000000..7f497ba2b --- /dev/null +++ b/ext/xsl/tests/xsltprocessor_transformToURI_wrongparam_002.phpt @@ -0,0 +1,57 @@ +--TEST-- +Check XSLTProcessor::transformToURI() with string parameter +--CREDITS-- +Rodrigo Prado de Jesus <royopa [at] gmail [dot] com> +--SKIPIF-- +<?php extension_loaded('xsl') or die('skip xsl extension is not available'); ?> +--FILE-- +<?php +$xml = <<<EOB +<allusers> + <user> + <uid>bob</uid> + </user> + <user> + <uid>joe</uid> + </user> +</allusers> +EOB; +$xsl = <<<EOB +<?xml version="1.0" encoding="UTF-8"?> +<xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:php="http://php.net/xsl"> +<xsl:output method="html" encoding="utf-8" indent="yes"/> + <xsl:template match="allusers"> + <html><body> + <h2>Users</h2> + <table> + <xsl:for-each select="user"> + <tr><td> + <xsl:value-of + select="php:function('ucfirst',string(uid))"/> + </td></tr> + </xsl:for-each> + </table> + </body></html> + </xsl:template> +</xsl:stylesheet> +EOB; + +$xmldoc = new DOMDocument('1.0', 'utf-8'); +$xmldoc->loadXML($xml); + +$xsldoc = new DOMDocument('1.0', 'utf-8'); +$xsldoc->loadXML($xsl); + +$proc = new XSLTProcessor(); +$proc->registerPHPFunctions(); +$proc->importStyleSheet($xsldoc); + +$wrong_parameter = 'stringValue'; +$uri = 'php://output'; + +echo $proc->transformToURI($wrong_parameter, $uri); +?> +--EXPECTF-- +Warning: XSLTProcessor::transformToUri() expects parameter 1 to be object, string given in %s on line %i
\ No newline at end of file diff --git a/ext/xsl/tests/xsltprocessor_transformToURI_wrongparam_003.phpt b/ext/xsl/tests/xsltprocessor_transformToURI_wrongparam_003.phpt new file mode 100644 index 000000000..c7742422f --- /dev/null +++ b/ext/xsl/tests/xsltprocessor_transformToURI_wrongparam_003.phpt @@ -0,0 +1,57 @@ +--TEST-- +Check XSLTProcessor::transformToURI() with boolean parameter +--CREDITS-- +Rodrigo Prado de Jesus <royopa [at] gmail [dot] com> +--SKIPIF-- +<?php extension_loaded('xsl') or die('skip xsl extension is not available'); ?> +--FILE-- +<?php +$xml = <<<EOB +<allusers> + <user> + <uid>bob</uid> + </user> + <user> + <uid>joe</uid> + </user> +</allusers> +EOB; +$xsl = <<<EOB +<?xml version="1.0" encoding="UTF-8"?> +<xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:php="http://php.net/xsl"> +<xsl:output method="html" encoding="utf-8" indent="yes"/> + <xsl:template match="allusers"> + <html><body> + <h2>Users</h2> + <table> + <xsl:for-each select="user"> + <tr><td> + <xsl:value-of + select="php:function('ucfirst',string(uid))"/> + </td></tr> + </xsl:for-each> + </table> + </body></html> + </xsl:template> +</xsl:stylesheet> +EOB; + +$xmldoc = new DOMDocument('1.0', 'utf-8'); +$xmldoc->loadXML($xml); + +$xsldoc = new DOMDocument('1.0', 'utf-8'); +$xsldoc->loadXML($xsl); + +$proc = new XSLTProcessor(); +$proc->registerPHPFunctions(); +$proc->importStyleSheet($xsldoc); + +$wrong_parameter = false; +$uri = 'php://output'; + +echo $proc->transformToURI($wrong_parameter, $uri); +?> +--EXPECTF-- +Warning: XSLTProcessor::transformToUri() expects parameter 1 to be object, boolean given in %s on line %i
\ No newline at end of file diff --git a/ext/xsl/tests/xsltprocessor_transformToURI_wrongparam_004.phpt b/ext/xsl/tests/xsltprocessor_transformToURI_wrongparam_004.phpt new file mode 100644 index 000000000..c1de1d93c --- /dev/null +++ b/ext/xsl/tests/xsltprocessor_transformToURI_wrongparam_004.phpt @@ -0,0 +1,56 @@ +--TEST-- +Check XSLTProcessor::transformToURI() with 3 parameters +--CREDITS-- +Rodrigo Prado de Jesus <royopa [at] gmail [dot] com> +--SKIPIF-- +<?php extension_loaded('xsl') or die('skip xsl extension is not available'); ?> +--FILE-- +<?php +$xml = <<<EOB +<allusers> + <user> + <uid>bob</uid> + </user> + <user> + <uid>joe</uid> + </user> +</allusers> +EOB; +$xsl = <<<EOB +<?xml version="1.0" encoding="UTF-8"?> +<xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:php="http://php.net/xsl"> +<xsl:output method="html" encoding="utf-8" indent="yes"/> + <xsl:template match="allusers"> + <html><body> + <h2>Users</h2> + <table> + <xsl:for-each select="user"> + <tr><td> + <xsl:value-of + select="php:function('ucfirst',string(uid))"/> + </td></tr> + </xsl:for-each> + </table> + </body></html> + </xsl:template> +</xsl:stylesheet> +EOB; + +$xmldoc = new DOMDocument('1.0', 'utf-8'); +$xmldoc->loadXML($xml); + +$xsldoc = new DOMDocument('1.0', 'utf-8'); +$xsldoc->loadXML($xsl); + +$proc = new XSLTProcessor(); +$proc->registerPHPFunctions(); +$proc->importStyleSheet($xsldoc); + +$uri = 'php://output'; + +echo $proc->transformToURI($xsldoc, $uri, 'stringValue'); +?> +--EXPECTF-- +Warning: XSLTProcessor::transformToUri() expects exactly 2 parameters, 3 given in %s on line %i
\ No newline at end of file diff --git a/ext/xsl/tests/xsltprocessor_transformToXML.phpt b/ext/xsl/tests/xsltprocessor_transformToXML.phpt new file mode 100644 index 000000000..c70200d10 --- /dev/null +++ b/ext/xsl/tests/xsltprocessor_transformToXML.phpt @@ -0,0 +1,61 @@ +--TEST-- +Test the basics to function XSLTProcessor::transformToXml(). +--CREDITS-- +Rodrigo Prado de Jesus <royopa [at] gmail [dot] com> +--SKIPIF-- +<?php extension_loaded('xsl') or die('skip xsl extension is not available'); ?> +--FILE-- +<?php +$xml = <<<EOB +<allusers> + <user> + <uid>bob</uid> + </user> + <user> + <uid>joe</uid> + </user> +</allusers> +EOB; +$xsl = <<<EOB +<?xml version="1.0" encoding="UTF-8"?> +<xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:php="http://php.net/xsl"> +<xsl:output method="html" encoding="utf-8" indent="yes"/> + <xsl:template match="allusers"> + <html><body> + <h2>Users</h2> + <table> + <xsl:for-each select="user"> + <tr><td> + <xsl:value-of + select="php:function('ucfirst',string(uid))"/> + </td></tr> + </xsl:for-each> + </table> + </body></html> + </xsl:template> +</xsl:stylesheet> +EOB; + +$xmldoc = new DOMDocument('1.0', 'utf-8'); +$xmldoc->loadXML($xml); + +$xsldoc = new DOMDocument('1.0', 'utf-8'); +$xsldoc->loadXML($xsl); + +$proc = new XSLTProcessor(); +$proc->registerPHPFunctions(); +$proc->importStyleSheet($xsldoc); + +var_dump($proc->transformToXML($xmldoc)); +?> +--EXPECT-- +string(135) "<html xmlns:php="http://php.net/xsl"><body> +<h2>Users</h2> +<table> +<tr><td>Bob</td></tr> +<tr><td>Joe</td></tr> +</table> +</body></html> +"
\ No newline at end of file diff --git a/ext/xsl/tests/xsltprocessor_transformToXML_nullparam.phpt b/ext/xsl/tests/xsltprocessor_transformToXML_nullparam.phpt new file mode 100644 index 000000000..a7689df07 --- /dev/null +++ b/ext/xsl/tests/xsltprocessor_transformToXML_nullparam.phpt @@ -0,0 +1,54 @@ +--TEST-- +Check XSLTProcessor::transformToXml() with null parameter +--CREDITS-- +Rodrigo Prado de Jesus <royopa [at] gmail [dot] com> +--SKIPIF-- +<?php extension_loaded('xsl') or die('skip xsl extension is not available'); ?> +--FILE-- +<?php +$xml = <<<EOB +<allusers> + <user> + <uid>bob</uid> + </user> + <user> + <uid>joe</uid> + </user> +</allusers> +EOB; +$xsl = <<<EOB +<?xml version="1.0" encoding="UTF-8"?> +<xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:php="http://php.net/xsl"> +<xsl:output method="html" encoding="utf-8" indent="yes"/> + <xsl:template match="allusers"> + <html><body> + <h2>Users</h2> + <table> + <xsl:for-each select="user"> + <tr><td> + <xsl:value-of + select="php:function('ucfirst',string(uid))"/> + </td></tr> + </xsl:for-each> + </table> + </body></html> + </xsl:template> +</xsl:stylesheet> +EOB; + +$xmldoc = new DOMDocument('1.0', 'utf-8'); +$xmldoc->loadXML($xml); + +$xsldoc = new DOMDocument('1.0', 'utf-8'); +$xsldoc->loadXML($xsl); + +$proc = new XSLTProcessor(); +$proc->registerPHPFunctions(); +$proc->importStyleSheet($xsldoc); + +echo $proc->transformToXML(null); +?> +--EXPECTF-- +Warning: XSLTProcessor::transformToXml() expects parameter 1 to be object, null given in %s on line %i diff --git a/ext/xsl/tests/xsltprocessor_transformToXML_wrongparam_001.phpt b/ext/xsl/tests/xsltprocessor_transformToXML_wrongparam_001.phpt new file mode 100644 index 000000000..32e1a8095 --- /dev/null +++ b/ext/xsl/tests/xsltprocessor_transformToXML_wrongparam_001.phpt @@ -0,0 +1,55 @@ +--TEST-- +Check XSLTProcessor::transformToXML() with array parameter +--CREDITS-- +Rodrigo Prado de Jesus <royopa [at] gmail [dot] com> +--SKIPIF-- +<?php extension_loaded('xsl') or die('skip xsl extension is not available'); ?> +--FILE-- +<?php +$xml = <<<EOB +<allusers> + <user> + <uid>bob</uid> + </user> + <user> + <uid>joe</uid> + </user> +</allusers> +EOB; +$xsl = <<<EOB +<?xml version="1.0" encoding="UTF-8"?> +<xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:php="http://php.net/xsl"> +<xsl:output method="html" encoding="utf-8" indent="yes"/> + <xsl:template match="allusers"> + <html><body> + <h2>Users</h2> + <table> + <xsl:for-each select="user"> + <tr><td> + <xsl:value-of + select="php:function('ucfirst',string(uid))"/> + </td></tr> + </xsl:for-each> + </table> + </body></html> + </xsl:template> +</xsl:stylesheet> +EOB; + +$xmldoc = new DOMDocument('1.0', 'utf-8'); +$xmldoc->loadXML($xml); + +$xsldoc = new DOMDocument('1.0', 'utf-8'); +$xsldoc->loadXML($xsl); + +$proc = new XSLTProcessor(); +$proc->registerPHPFunctions(); +$proc->importStyleSheet($xsldoc); + +$wrong_parameter = array(); +echo $proc->transformToXML($wrong_parameter); +?> +--EXPECTF-- +Warning: XSLTProcessor::transformToXml() expects parameter 1 to be object, array given in %s on line %d
\ No newline at end of file diff --git a/ext/xsl/tests/xsltprocessor_transformToXML_wrongparam_002.phpt b/ext/xsl/tests/xsltprocessor_transformToXML_wrongparam_002.phpt new file mode 100644 index 000000000..69b9305e1 --- /dev/null +++ b/ext/xsl/tests/xsltprocessor_transformToXML_wrongparam_002.phpt @@ -0,0 +1,54 @@ +--TEST-- +Check XSLTProcessor::transformToXML() with 3 parameters +--CREDITS-- +Rodrigo Prado de Jesus <royopa [at] gmail [dot] com> +--SKIPIF-- +<?php extension_loaded('xsl') or die('skip xsl extension is not available'); ?> +--FILE-- +<?php +$xml = <<<EOB +<allusers> + <user> + <uid>bob</uid> + </user> + <user> + <uid>joe</uid> + </user> +</allusers> +EOB; +$xsl = <<<EOB +<?xml version="1.0" encoding="UTF-8"?> +<xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:php="http://php.net/xsl"> +<xsl:output method="html" encoding="utf-8" indent="yes"/> + <xsl:template match="allusers"> + <html><body> + <h2>Users</h2> + <table> + <xsl:for-each select="user"> + <tr><td> + <xsl:value-of + select="php:function('ucfirst',string(uid))"/> + </td></tr> + </xsl:for-each> + </table> + </body></html> + </xsl:template> +</xsl:stylesheet> +EOB; + +$xmldoc = new DOMDocument('1.0', 'utf-8'); +$xmldoc->loadXML($xml); + +$xsldoc = new DOMDocument('1.0', 'utf-8'); +$xsldoc->loadXML($xsl); + +$proc = new XSLTProcessor(); +$proc->registerPHPFunctions(); +$proc->importStyleSheet($xsldoc); + +echo $proc->transformToXML($xmldoc, 'string', 98); +?> +--EXPECTF-- +Warning: XSLTProcessor::transformToXml() expects exactly 1 parameter, 3 given in %s on line %i diff --git a/ext/xsl/tests/xsltprocessor_transformToXML_wrongparam_003.phpt b/ext/xsl/tests/xsltprocessor_transformToXML_wrongparam_003.phpt new file mode 100644 index 000000000..05cb7ebd9 --- /dev/null +++ b/ext/xsl/tests/xsltprocessor_transformToXML_wrongparam_003.phpt @@ -0,0 +1,55 @@ +--TEST-- +Check XSLTProcessor::transformToXML() with string parameter +--CREDITS-- +Rodrigo Prado de Jesus <royopa [at] gmail [dot] com> +--SKIPIF-- +<?php extension_loaded('xsl') or die('skip xsl extension is not available'); ?> +--FILE-- +<?php +$xml = <<<EOB +<allusers> + <user> + <uid>bob</uid> + </user> + <user> + <uid>joe</uid> + </user> +</allusers> +EOB; +$xsl = <<<EOB +<?xml version="1.0" encoding="UTF-8"?> +<xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:php="http://php.net/xsl"> +<xsl:output method="html" encoding="utf-8" indent="yes"/> + <xsl:template match="allusers"> + <html><body> + <h2>Users</h2> + <table> + <xsl:for-each select="user"> + <tr><td> + <xsl:value-of + select="php:function('ucfirst',string(uid))"/> + </td></tr> + </xsl:for-each> + </table> + </body></html> + </xsl:template> +</xsl:stylesheet> +EOB; + +$xmldoc = new DOMDocument('1.0', 'utf-8'); +$xmldoc->loadXML($xml); + +$xsldoc = new DOMDocument('1.0', 'utf-8'); +$xsldoc->loadXML($xsl); + +$proc = new XSLTProcessor(); +$proc->registerPHPFunctions(); +$proc->importStyleSheet($xsldoc); + +$wrong_parameter = 'stringValue'; +echo $proc->transformToXML($wrong_parameter); +?> +--EXPECTF-- +Warning: XSLTProcessor::transformToXml() expects parameter 1 to be object, string given in %s on line %d
\ No newline at end of file diff --git a/ext/xsl/tests/xsltprocessor_transformToXML_wrongparam_004.phpt b/ext/xsl/tests/xsltprocessor_transformToXML_wrongparam_004.phpt new file mode 100644 index 000000000..87db6e14d --- /dev/null +++ b/ext/xsl/tests/xsltprocessor_transformToXML_wrongparam_004.phpt @@ -0,0 +1,55 @@ +--TEST-- +Check XSLTProcessor::transformToXML() with boolean parameter +--CREDITS-- +Rodrigo Prado de Jesus <royopa [at] gmail [dot] com> +--SKIPIF-- +<?php extension_loaded('xsl') or die('skip xsl extension is not available'); ?> +--FILE-- +<?php +$xml = <<<EOB +<allusers> + <user> + <uid>bob</uid> + </user> + <user> + <uid>joe</uid> + </user> +</allusers> +EOB; +$xsl = <<<EOB +<?xml version="1.0" encoding="UTF-8"?> +<xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:php="http://php.net/xsl"> +<xsl:output method="html" encoding="utf-8" indent="yes"/> + <xsl:template match="allusers"> + <html><body> + <h2>Users</h2> + <table> + <xsl:for-each select="user"> + <tr><td> + <xsl:value-of + select="php:function('ucfirst',string(uid))"/> + </td></tr> + </xsl:for-each> + </table> + </body></html> + </xsl:template> +</xsl:stylesheet> +EOB; + +$xmldoc = new DOMDocument('1.0', 'utf-8'); +$xmldoc->loadXML($xml); + +$xsldoc = new DOMDocument('1.0', 'utf-8'); +$xsldoc->loadXML($xsl); + +$proc = new XSLTProcessor(); +$proc->registerPHPFunctions(); +$proc->importStyleSheet($xsldoc); + +$wrong_parameter = true; +echo $proc->transformToXML($wrong_parameter); +?> +--EXPECTF-- +Warning: XSLTProcessor::transformToXml() expects parameter 1 to be object, boolean given in %s on line %d
\ No newline at end of file diff --git a/ext/zip/php_zip.c b/ext/zip/php_zip.c index a9db166c8..a9a55a8ae 100644 --- a/ext/zip/php_zip.c +++ b/ext/zip/php_zip.c @@ -602,7 +602,7 @@ int php_zip_glob(char *pattern, int pattern_len, long flags, zval *return_value array_init(return_value); for (n = 0; n < globbuf.gl_pathc; n++) { - /* we need to do this everytime since GLOB_ONLYDIR does not guarantee that + /* we need to do this every time since GLOB_ONLYDIR does not guarantee that * all directories will be filtered. GNU libc documentation states the * following: * If the information about the type of the file is easily available diff --git a/ext/zlib/tests/bug_52944-darwin.phpt b/ext/zlib/tests/bug_52944-darwin.phpt deleted file mode 100644 index c25babadf..000000000 --- a/ext/zlib/tests/bug_52944-darwin.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -Bug #52944 (segfault with zlib filter and corrupted data) ---SKIPIF-- -<?php if (!extension_loaded("zlib")) print "skip"; ?> -<?php -if (PHP_OS != 'Darwin') { - die("skip Darwin only"); -} ---INI-- -allow_url_fopen=1 ---FILE-- -<?php -require dirname(__FILE__) . "/bug_52944_corrupted_data.inc"; - -$fp = fopen('data://text/plain;base64,' . $data, 'r'); -stream_filter_append($fp, 'zlib.inflate', STREAM_FILTER_READ); -var_dump(fread($fp,1)); -var_dump(fread($fp,1)); -fclose($fp); -echo "Done.\n"; ---EXPECT-- -string(1) "%" -string(1) "C" -Done. diff --git a/ext/zlib/tests/bug_52944.phpt b/ext/zlib/tests/bug_52944.phpt index ff82d29cc..68bd53791 100644 --- a/ext/zlib/tests/bug_52944.phpt +++ b/ext/zlib/tests/bug_52944.phpt @@ -2,10 +2,6 @@ Bug #52944 (segfault with zlib filter and corrupted data) --SKIPIF-- <?php if (!extension_loaded("zlib")) print "skip"; ?> -<?php -if (PHP_OS == 'Darwin') { - die("skip not for Darwin"); -} --INI-- allow_url_fopen=1 --FILE-- diff --git a/ext/zlib/tests/gzfile_variation4.phpt b/ext/zlib/tests/gzfile_variation4.phpt index 331023156..9b3128125 100644 --- a/ext/zlib/tests/gzfile_variation4.phpt +++ b/ext/zlib/tests/gzfile_variation4.phpt @@ -2,7 +2,7 @@ Test function gzfile() by substituting argument 1 with float values. --SKIPIF-- <?php -if (!extension_loaded(zlib)) die ('skip zlib extension not available in this build'); +if (!extension_loaded('zlib')) die ('skip zlib extension not available in this build'); ?> --FILE-- <?php diff --git a/ext/zlib/tests/readgzfile_variation4.phpt b/ext/zlib/tests/readgzfile_variation4.phpt index 00211f7df..32f434cba 100644 --- a/ext/zlib/tests/readgzfile_variation4.phpt +++ b/ext/zlib/tests/readgzfile_variation4.phpt @@ -2,7 +2,7 @@ Test function readgzfile() by substituting argument 1 with float values. --SKIPIF-- <?php -if (!extension_loaded(zlib)) die ('skip zlib extension not available in this build'); +if (!extension_loaded('zlib')) die ('skip zlib extension not available in this build'); ?> --FILE-- <?php diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c index 705fb5dd5..25804597b 100644 --- a/ext/zlib/zlib.c +++ b/ext/zlib/zlib.c @@ -34,6 +34,18 @@ #include "ext/standard/php_string.h" #include "php_zlib.h" +/* + * zlib include files can define the following preprocessor defines which rename + * the corresponding PHP functions to gzopen64, gzseek64 and gztell64 and thereby + * breaking some software, most notably PEAR's Archive_Tar, which halts execution + * without error message on gzip compressed archivesa. + * + * This only seems to happen on 32bit systems with large file support. + */ +#undef gzopen +#undef gzseek +#undef gztell + ZEND_DECLARE_MODULE_GLOBALS(zlib); /* {{{ Memory management wrappers */ diff --git a/ext/zlib/zlib_filter.c b/ext/zlib/zlib_filter.c index c81500854..ec8f6c8e9 100644 --- a/ext/zlib/zlib_filter.c +++ b/ext/zlib/zlib_filter.c @@ -391,7 +391,7 @@ static php_stream_filter *php_zlib_filter_create(const char *filtername, zval *f if (zend_hash_find(HASH_OF(filterparams), "level", sizeof("level"), (void**) &tmpzval) == SUCCESS) { tmp = **tmpzval; - /* Psuedo pass through to catch level validating code */ + /* Pseudo pass through to catch level validating code */ goto factory_setlevel; } break; diff --git a/ext/zlib/zlib_win32_howto.txt b/ext/zlib/zlib_win32_howto.txt index a4e01a484..e2a2b79cc 100644 --- a/ext/zlib/zlib_win32_howto.txt +++ b/ext/zlib/zlib_win32_howto.txt @@ -1,7 +1,7 @@ Rules for building ZLIB ----------------------- -The zlib project requires the folowing files: +The zlib project requires the following files: php_build\zlib\include\zlib.h php_build\zlib\include\zconf.h diff --git a/main/php_version.h b/main/php_version.h index 5134679e1..ecf54ed7e 100644 --- a/main/php_version.h +++ b/main/php_version.h @@ -2,7 +2,7 @@ /* edit configure.in to change version number */ #define PHP_MAJOR_VERSION 5 #define PHP_MINOR_VERSION 6 -#define PHP_RELEASE_VERSION 3 +#define PHP_RELEASE_VERSION 4 #define PHP_EXTRA_VERSION "" -#define PHP_VERSION "5.6.3" -#define PHP_VERSION_ID 50603 +#define PHP_VERSION "5.6.4" +#define PHP_VERSION_ID 50604 diff --git a/php.ini-development b/php.ini-development index bcc9ac6ba..44b98b830 100644 --- a/php.ini-development +++ b/php.ini-development @@ -293,20 +293,17 @@ serialize_precision = 17 ; open_basedir, if set, limits all file operations to the defined directory ; and below. This directive makes most sense if used in a per-directory -; or per-virtualhost web server configuration file. This directive is -; *NOT* affected by whether Safe Mode is turned On or Off. +; or per-virtualhost web server configuration file. ; http://php.net/open-basedir ;open_basedir = ; This directive allows you to disable certain functions for security reasons. -; It receives a comma-delimited list of function names. This directive is -; *NOT* affected by whether Safe Mode is turned On or Off. +; It receives a comma-delimited list of function names. ; http://php.net/disable-functions disable_functions = ; This directive allows you to disable certain classes for security reasons. -; It receives a comma-delimited list of class names. This directive is -; *NOT* affected by whether Safe Mode is turned On or Off. +; It receives a comma-delimited list of class names. ; http://php.net/disable-classes disable_classes = @@ -611,13 +608,13 @@ html_errors = On ; http://php.net/variables-order variables_order = "GPCS" -; This directive determines which super global data (G,P,C,E & S) should -; be registered into the super global array REQUEST. If so, it also determines -; the order in which that data is registered. The values for this directive are -; specified in the same manner as the variables_order directive, EXCEPT one. -; Leaving this value empty will cause PHP to use the value set in the -; variables_order directive. It does not mean it will leave the super globals -; array REQUEST empty. +; This directive determines which super global data (G,P & C) should be +; registered into the super global array REQUEST. If so, it also determines +; the order in which that data is registered. The values for this directive +; are specified in the same manner as the variables_order directive, +; EXCEPT one. Leaving this value empty will cause PHP to use the value set +; in the variables_order directive. It does not mean it will leave the super +; globals array REQUEST empty. ; Default Value: None ; Development Value: "GP" ; Production Value: "GP" @@ -678,7 +675,7 @@ auto_append_file = ; http://php.net/default-mimetype default_mimetype = "text/html" -; PHP's default character set is set to UTF-8 +; PHP's default character set is set to UTF-8. ; http://php.net/default-charset default_charset = "UTF-8" @@ -764,7 +761,7 @@ enable_dl = Off ; will look for to know it is OK to continue execution. Setting this variable MAY ; cause security issues, KNOW WHAT YOU ARE DOING FIRST. ; http://php.net/cgi.redirect-status-env -;cgi.redirect_status_env = +;cgi.redirect_status_env = ; cgi.fix_pathinfo provides *real* PATH_INFO/PATH_TRANSLATED support for CGI. PHP's ; previous behaviour was to set PATH_TRANSLATED to SCRIPT_FILENAME, and to not grok @@ -1035,7 +1032,7 @@ smtp_port = 25 ; Force the addition of the specified parameters to be passed as extra parameters ; to the sendmail binary. These parameters will always replace the value of -; the 5th parameter to mail(), even in safe mode. +; the 5th parameter to mail(). ;mail.force_extra_parameters = ; Add X-PHP-Originating-Script: that will include uid of the script followed by the filename diff --git a/php.ini-production b/php.ini-production index a2a50ea2f..eeeb73fdf 100644 --- a/php.ini-production +++ b/php.ini-production @@ -293,20 +293,17 @@ serialize_precision = 17 ; open_basedir, if set, limits all file operations to the defined directory ; and below. This directive makes most sense if used in a per-directory -; or per-virtualhost web server configuration file. This directive is -; *NOT* affected by whether Safe Mode is turned On or Off. +; or per-virtualhost web server configuration file. ; http://php.net/open-basedir ;open_basedir = ; This directive allows you to disable certain functions for security reasons. -; It receives a comma-delimited list of function names. This directive is -; *NOT* affected by whether Safe Mode is turned On or Off. +; It receives a comma-delimited list of function names. ; http://php.net/disable-functions disable_functions = ; This directive allows you to disable certain classes for security reasons. -; It receives a comma-delimited list of class names. This directive is -; *NOT* affected by whether Safe Mode is turned On or Off. +; It receives a comma-delimited list of class names. ; http://php.net/disable-classes disable_classes = @@ -611,13 +608,13 @@ html_errors = On ; http://php.net/variables-order variables_order = "GPCS" -; This directive determines which super global data (G,P,C,E & S) should -; be registered into the super global array REQUEST. If so, it also determines -; the order in which that data is registered. The values for this directive are -; specified in the same manner as the variables_order directive, EXCEPT one. -; Leaving this value empty will cause PHP to use the value set in the -; variables_order directive. It does not mean it will leave the super globals -; array REQUEST empty. +; This directive determines which super global data (G,P & C) should be +; registered into the super global array REQUEST. If so, it also determines +; the order in which that data is registered. The values for this directive +; are specified in the same manner as the variables_order directive, +; EXCEPT one. Leaving this value empty will cause PHP to use the value set +; in the variables_order directive. It does not mean it will leave the super +; globals array REQUEST empty. ; Default Value: None ; Development Value: "GP" ; Production Value: "GP" @@ -678,7 +675,7 @@ auto_append_file = ; http://php.net/default-mimetype default_mimetype = "text/html" -; PHP's default character set is set to empty. +; PHP's default character set is set to UTF-8. ; http://php.net/default-charset default_charset = "UTF-8" @@ -688,10 +685,12 @@ default_charset = "UTF-8" ;internal_encoding = ; PHP input character encoding is set to empty. +; If empty, default_charset is used. ; http://php.net/input-encoding ;input_encoding = ; PHP output character encoding is set to empty. +; If empty, default_charset is used. ; mbstring or iconv output handler is used. ; See also output_buffer. ; http://php.net/output-encoding @@ -1033,7 +1032,7 @@ smtp_port = 25 ; Force the addition of the specified parameters to be passed as extra parameters ; to the sendmail binary. These parameters will always replace the value of -; the 5th parameter to mail(), even in safe mode. +; the 5th parameter to mail(). ;mail.force_extra_parameters = ; Add X-PHP-Originating-Script: that will include uid of the script followed by the filename diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c index 437d09cf3..c0b040a6d 100644 --- a/sapi/cgi/cgi_main.c +++ b/sapi/cgi/cgi_main.c @@ -2273,7 +2273,7 @@ consult the installation file that came with this distribution, or visit \n\ /* all remaining arguments are part of the query string * this section of code concatenates all remaining arguments - * into a single string, seperating args with a & + * into a single string, separating args with a & * this allows command lines like: * * test.php v1=test v2=hello+world! diff --git a/sapi/cli/php_http_parser.c b/sapi/cli/php_http_parser.c index d3bc496f4..2fc040549 100644 --- a/sapi/cli/php_http_parser.c +++ b/sapi/cli/php_http_parser.c @@ -1378,7 +1378,7 @@ size_t php_http_parser_execute (php_http_parser *parser, /* Here we call the headers_complete callback. This is somewhat * different than other callbacks because if the user returns 1, we * will interpret that as saying that this message has no body. This - * is needed for the annoying case of recieving a response to a HEAD + * is needed for the annoying case of receiving a response to a HEAD * request. */ if (settings->on_headers_complete) { diff --git a/sapi/fpm/fpm/fastcgi.c b/sapi/fpm/fpm/fastcgi.c index d77b6f8ca..d2764a59b 100644 --- a/sapi/fpm/fpm/fastcgi.c +++ b/sapi/fpm/fpm/fastcgi.c @@ -137,13 +137,14 @@ typedef union _sa_t { struct sockaddr sa; struct sockaddr_un sa_unix; struct sockaddr_in sa_inet; + struct sockaddr_in6 sa_inet6; } sa_t; static HashTable fcgi_mgmt_vars; static int is_initialized = 0; static int in_shutdown = 0; -static in_addr_t *allowed_clients = NULL; +static sa_t *allowed_clients = NULL; static sa_t client_sa; @@ -266,15 +267,23 @@ void fcgi_set_allowed_clients(char *ip) *end = 0; end++; } - allowed_clients[n] = inet_addr(cur); - if (allowed_clients[n] == INADDR_NONE) { + if (inet_pton(AF_INET, cur, &allowed_clients[n].sa_inet.sin_addr)>0) { + allowed_clients[n].sa.sa_family = AF_INET; + n++; + } else if (inet_pton(AF_INET6, cur, &allowed_clients[n].sa_inet6.sin6_addr)>0) { + allowed_clients[n].sa.sa_family = AF_INET6; + n++; + } else { zlog(ZLOG_ERROR, "Wrong IP address '%s' in listen.allowed_clients", cur); } - n++; cur = end; } - allowed_clients[n] = INADDR_NONE; + allowed_clients[n].sa.sa_family = 0; free(ip); + if (!n) { + zlog(ZLOG_ERROR, "There are no allowed addresses for this pool"); + /* don't clear allowed_clients as it will create an "open for all" security issue */ + } } } @@ -759,6 +768,43 @@ void fcgi_close(fcgi_request *req, int force, int destroy) } } +static int fcgi_is_allowed() { + int i; + + if (client_sa.sa.sa_family == AF_UNIX) { + return 1; + } + if (!allowed_clients) { + return 1; + } + if (client_sa.sa.sa_family == AF_INET) { + for (i=0 ; allowed_clients[i].sa.sa_family ; i++) { + if (allowed_clients[i].sa.sa_family == AF_INET + && !memcmp(&client_sa.sa_inet.sin_addr, &allowed_clients[i].sa_inet.sin_addr, 4)) { + return 1; + } + } + } + if (client_sa.sa.sa_family == AF_INET6) { + for (i=0 ; allowed_clients[i].sa.sa_family ; i++) { + if (allowed_clients[i].sa.sa_family == AF_INET6 + && !memcmp(&client_sa.sa_inet6.sin6_addr, &allowed_clients[i].sa_inet6.sin6_addr, 12)) { + return 1; + } +#ifdef IN6_IS_ADDR_V4MAPPED + if (allowed_clients[i].sa.sa_family == AF_INET + && IN6_IS_ADDR_V4MAPPED(&client_sa.sa_inet6.sin6_addr) + && !memcmp(((char *)&client_sa.sa_inet6.sin6_addr)+12, &allowed_clients[i].sa_inet.sin_addr, 4)) { + return 1; + } +#endif + } + } + + zlog(ZLOG_ERROR, "Connection disallowed: IP address '%s' has been dropped.", fcgi_get_last_client_ip()); + return 0; +} + int fcgi_accept_request(fcgi_request *req) { #ifdef _WIN32 @@ -809,23 +855,10 @@ int fcgi_accept_request(fcgi_request *req) FCGI_UNLOCK(req->listen_socket); client_sa = sa; - if (sa.sa.sa_family == AF_INET && req->fd >= 0 && allowed_clients) { - int n = 0; - int allowed = 0; - - while (allowed_clients[n] != INADDR_NONE) { - if (allowed_clients[n] == sa.sa_inet.sin_addr.s_addr) { - allowed = 1; - break; - } - n++; - } - if (!allowed) { - zlog(ZLOG_ERROR, "Connection disallowed: IP address '%s' has been dropped.", inet_ntoa(sa.sa_inet.sin_addr)); - closesocket(req->fd); - req->fd = -1; - continue; - } + if (req->fd >= 0 && !fcgi_is_allowed()) { + closesocket(req->fd); + req->fd = -1; + continue; } } @@ -1094,12 +1127,27 @@ void fcgi_free_mgmt_var_cb(void * ptr) pefree(*var, 1); } -char *fcgi_get_last_client_ip() /* {{{ */ +const char *fcgi_get_last_client_ip() /* {{{ */ { - if (client_sa.sa.sa_family == AF_UNIX) { - return NULL; + static char str[INET6_ADDRSTRLEN]; + + /* Ipv4 */ + if (client_sa.sa.sa_family == AF_INET) { + return inet_ntop(client_sa.sa.sa_family, &client_sa.sa_inet.sin_addr, str, INET6_ADDRSTRLEN); + } +#ifdef IN6_IS_ADDR_V4MAPPED + /* Ipv4-Mapped-Ipv6 */ + if (client_sa.sa.sa_family == AF_INET6 + && IN6_IS_ADDR_V4MAPPED(&client_sa.sa_inet6.sin6_addr)) { + return inet_ntop(AF_INET, ((char *)&client_sa.sa_inet6.sin6_addr)+12, str, INET6_ADDRSTRLEN); } - return inet_ntoa(client_sa.sa_inet.sin_addr); +#endif + /* Ipv6 */ + if (client_sa.sa.sa_family == AF_INET6) { + return inet_ntop(client_sa.sa.sa_family, &client_sa.sa_inet6.sin6_addr, str, INET6_ADDRSTRLEN); + } + /* Unix socket */ + return NULL; } /* }}} */ /* diff --git a/sapi/fpm/fpm/fastcgi.h b/sapi/fpm/fpm/fastcgi.h index 34f9eef9d..f5cfe9f66 100644 --- a/sapi/fpm/fpm/fastcgi.h +++ b/sapi/fpm/fpm/fastcgi.h @@ -133,7 +133,7 @@ int fcgi_flush(fcgi_request *req, int close); void fcgi_set_mgmt_var(const char * name, size_t name_len, const char * value, size_t value_len); void fcgi_free_mgmt_var_cb(void * ptr); -char *fcgi_get_last_client_ip(); +const char *fcgi_get_last_client_ip(); /* * Local variables: diff --git a/sapi/fpm/fpm/fpm_conf.c b/sapi/fpm/fpm/fpm_conf.c index 34e048010..1f73bc915 100644 --- a/sapi/fpm/fpm/fpm_conf.c +++ b/sapi/fpm/fpm/fpm_conf.c @@ -819,7 +819,7 @@ static int fpm_conf_process_all_pools() /* {{{ */ if (config->pm_start_servers <= 0) { config->pm_start_servers = config->pm_min_spare_servers + ((config->pm_max_spare_servers - config->pm_min_spare_servers) / 2); - zlog(ZLOG_WARNING, "[pool %s] pm.start_servers is not set. It's been set to %d.", wp->config->name, config->pm_start_servers); + zlog(ZLOG_NOTICE, "[pool %s] pm.start_servers is not set. It's been set to %d.", wp->config->name, config->pm_start_servers); } else if (config->pm_start_servers < config->pm_min_spare_servers || config->pm_start_servers > config->pm_max_spare_servers) { zlog(ZLOG_ALERT, "[pool %s] pm.start_servers(%d) must not be less than pm.min_spare_servers(%d) and not greater than pm.max_spare_servers(%d)", wp->config->name, config->pm_start_servers, config->pm_min_spare_servers, config->pm_max_spare_servers); @@ -1159,6 +1159,7 @@ static int fpm_conf_post_process(int force_daemon TSRMLS_DC) /* {{{ */ } fpm_globals.log_level = fpm_global_config.log_level; + zlog_set_level(fpm_globals.log_level); if (fpm_global_config.process_max < 0) { zlog(ZLOG_ERROR, "process_max can't be negative"); @@ -1199,15 +1200,15 @@ static int fpm_conf_post_process(int force_daemon TSRMLS_DC) /* {{{ */ return -1; } - if (0 > fpm_log_open(0)) { + if (0 > fpm_event_pre_init(fpm_global_config.events_mechanism)) { return -1; } - if (0 > fpm_event_pre_init(fpm_global_config.events_mechanism)) { + if (0 > fpm_conf_process_all_pools()) { return -1; } - if (0 > fpm_conf_process_all_pools()) { + if (0 > fpm_log_open(0)) { return -1; } @@ -1256,7 +1257,7 @@ static void fpm_conf_ini_parser_include(char *inc, void *arg TSRMLS_DC) /* {{{ * #ifdef HAVE_GLOB { g.gl_offs = 0; - if ((i = glob(inc, GLOB_ERR | GLOB_MARK | GLOB_NOSORT, NULL, &g)) != 0) { + if ((i = glob(inc, GLOB_ERR | GLOB_MARK, NULL, &g)) != 0) { #ifdef GLOB_NOMATCH if (i == GLOB_NOMATCH) { zlog(ZLOG_WARNING, "Nothing matches the include pattern '%s' from %s at line %d.", inc, filename, ini_lineno); diff --git a/sapi/fpm/fpm/fpm_env.c b/sapi/fpm/fpm/fpm_env.c index 2ff0bdc0e..3bdb34634 100644 --- a/sapi/fpm/fpm/fpm_env.c +++ b/sapi/fpm/fpm/fpm_env.c @@ -212,7 +212,7 @@ int fpm_env_init_main() /* {{{ */ #ifndef HAVE_SETPROCTITLE #ifdef __linux__ /* - * This piece of code has been inspirated from nginx and pureftpd code, whic + * This piece of code has been inspirated from nginx and pureftpd code, which * are under BSD licence. * * To change the process title in Linux we have to set argv[1] to NULL diff --git a/sapi/fpm/fpm/fpm_log.c b/sapi/fpm/fpm/fpm_log.c index 4e1a057db..b0bf32ac1 100644 --- a/sapi/fpm/fpm/fpm_log.c +++ b/sapi/fpm/fpm/fpm_log.c @@ -46,6 +46,8 @@ int fpm_log_open(int reopen) /* {{{ */ if (0 > fd) { zlog(ZLOG_SYSERROR, "failed to open access log (%s)", wp->config->access_log); return -1; + } else { + zlog(ZLOG_DEBUG, "open access log (%s)", wp->config->access_log); } if (reopen) { @@ -367,7 +369,7 @@ int fpm_log_write(char *log_format TSRMLS_DC) /* {{{ */ case 'R': /* remote IP address */ if (!test) { - char *tmp = fcgi_get_last_client_ip(); + const char *tmp = fcgi_get_last_client_ip(); len2 = snprintf(b, FPM_LOG_BUFFER - len, "%s", tmp ? tmp : "-"); } break; diff --git a/sapi/fpm/fpm/fpm_sockets.c b/sapi/fpm/fpm/fpm_sockets.c index da14d63d8..0286f0eee 100644 --- a/sapi/fpm/fpm/fpm_sockets.c +++ b/sapi/fpm/fpm/fpm_sockets.c @@ -85,13 +85,24 @@ static void *fpm_get_in_addr(struct sockaddr *sa) /* {{{ */ } /* }}} */ +static int fpm_get_in_port(struct sockaddr *sa) /* {{{ */ +{ + if (sa->sa_family == AF_INET) { + return ntohs(((struct sockaddr_in*)sa)->sin_port); + } + + return ntohs(((struct sockaddr_in6*)sa)->sin6_port); +} +/* }}} */ + static int fpm_sockets_hash_op(int sock, struct sockaddr *sa, char *key, int type, int op) /* {{{ */ { if (key == NULL) { switch (type) { case FPM_AF_INET : { - key = alloca(INET6_ADDRSTRLEN); - inet_ntop(sa->sa_family, fpm_get_in_addr(sa), key, sizeof key); + key = alloca(INET6_ADDRSTRLEN+10); + inet_ntop(sa->sa_family, fpm_get_in_addr(sa), key, INET6_ADDRSTRLEN); + sprintf(key+strlen(key), ":%d", fpm_get_in_port(sa)); break; } @@ -244,9 +255,10 @@ static int fpm_socket_af_inet_listening_socket(struct fpm_worker_pool_s *wp) /* char *dup_address = strdup(wp->config->listen_address); char *port_str = strrchr(dup_address, ':'); char *addr = NULL; + char tmpbuf[INET6_ADDRSTRLEN]; int addr_len; int port = 0; - int sock; + int sock = -1; int status; if (port_str) { /* this is host:port pair */ @@ -263,13 +275,23 @@ static int fpm_socket_af_inet_listening_socket(struct fpm_worker_pool_s *wp) /* return -1; } - // strip brackets from address for getaddrinfo - if (addr != NULL) { - addr_len = strlen(addr); - if (addr[0] == '[' && addr[addr_len - 1] == ']') { - addr[addr_len - 1] = '\0'; - addr++; - } + if (!addr) { + /* no address: default documented behavior, all IPv4 addresses */ + struct sockaddr_in sa_in; + + memset(&sa_in, 0, sizeof(sa_in)); + sa_in.sin_family = AF_INET; + sa_in.sin_port = htons(port); + sa_in.sin_addr.s_addr = htonl(INADDR_ANY); + free(dup_address); + return fpm_sockets_get_listening_socket(wp, (struct sockaddr *) &sa_in, sizeof(struct sockaddr_in)); + } + + /* strip brackets from address for getaddrinfo */ + addr_len = strlen(addr); + if (addr[0] == '[' && addr[addr_len - 1] == ']') { + addr[addr_len - 1] = '\0'; + addr++; } memset(&hints, 0, sizeof hints); @@ -281,14 +303,18 @@ static int fpm_socket_af_inet_listening_socket(struct fpm_worker_pool_s *wp) /* return -1; } - free(dup_address); - for (p = servinfo; p != NULL; p = p->ai_next) { - if ((sock = fpm_sockets_get_listening_socket(wp, p->ai_addr, p->ai_addrlen)) != -1) { - break; + inet_ntop(p->ai_family, fpm_get_in_addr(p->ai_addr), tmpbuf, INET6_ADDRSTRLEN); + if (sock < 0) { + if ((sock = fpm_sockets_get_listening_socket(wp, p->ai_addr, p->ai_addrlen)) != -1) { + zlog(ZLOG_DEBUG, "Found address for %s, socket opened on %s", dup_address, tmpbuf); + } + } else { + zlog(ZLOG_WARNING, "Found multiple addresses for %s, %s ignored", dup_address, tmpbuf); } } + free(dup_address); freeaddrinfo(servinfo); return sock; diff --git a/sapi/fpm/fpm/fpm_stdio.c b/sapi/fpm/fpm/fpm_stdio.c index fcec78435..e28c0cbe7 100644 --- a/sapi/fpm/fpm/fpm_stdio.c +++ b/sapi/fpm/fpm/fpm_stdio.c @@ -42,9 +42,28 @@ int fpm_stdio_init_main() /* {{{ */ } /* }}} */ +static inline int fpm_use_error_log() { /* {{{ */ + /* + * the error_log is NOT used when running in foreground + * and from a tty (user looking at output). + * So, error_log is used by + * - SysV init launch php-fpm as a daemon + * - Systemd launch php-fpm in foreground + */ +#if HAVE_UNISTD_H + if (fpm_global_config.daemonize || (!isatty(STDERR_FILENO) && !fpm_globals.force_stderr)) { +#else + if (fpm_global_config.daemonize) { +#endif + return 1; + } + return 0; +} + +/* }}} */ int fpm_stdio_init_final() /* {{{ */ { - if (fpm_global_config.daemonize) { + if (fpm_use_error_log()) { /* prevent duping if logging to syslog */ if (fpm_globals.error_log_fd > 0 && fpm_globals.error_log_fd != STDERR_FILENO) { @@ -67,6 +86,11 @@ int fpm_stdio_init_child(struct fpm_worker_pool_s *wp) /* {{{ */ closelog(); /* ensure to close syslog not to interrupt with PHP syslog code */ } else #endif + + /* Notice: child cannot use master error_log + * because not aware when being reopen + * else, should use if (!fpm_use_error_log()) + */ if (fpm_globals.error_log_fd > 0) { close(fpm_globals.error_log_fd); } @@ -268,11 +292,7 @@ int fpm_stdio_open_error_log(int reopen) /* {{{ */ if (!strcasecmp(fpm_global_config.error_log, "syslog")) { openlog(fpm_global_config.syslog_ident, LOG_PID | LOG_CONS, fpm_global_config.syslog_facility); fpm_globals.error_log_fd = ZLOG_SYSLOG; -#if HAVE_UNISTD_H - if (fpm_global_config.daemonize || (!isatty(STDERR_FILENO) && !fpm_globals.force_stderr)) { -#else - if (fpm_global_config.daemonize) { -#endif + if (fpm_use_error_log()) { zlog_set_fd(fpm_globals.error_log_fd); } return 0; @@ -286,7 +306,7 @@ int fpm_stdio_open_error_log(int reopen) /* {{{ */ } if (reopen) { - if (fpm_global_config.daemonize) { + if (fpm_use_error_log()) { dup2(fd, STDERR_FILENO); } @@ -295,11 +315,7 @@ int fpm_stdio_open_error_log(int reopen) /* {{{ */ fd = fpm_globals.error_log_fd; /* for FD_CLOSEXEC to work */ } else { fpm_globals.error_log_fd = fd; -#if HAVE_UNISTD_H - if (fpm_global_config.daemonize || (!isatty(STDERR_FILENO) && !fpm_globals.force_stderr)) { -#else - if (fpm_global_config.daemonize) { -#endif + if (fpm_use_error_log()) { zlog_set_fd(fpm_globals.error_log_fd); } } diff --git a/sapi/fpm/fpm/fpm_unix.c b/sapi/fpm/fpm/fpm_unix.c index 68978ee75..32448fc4d 100644 --- a/sapi/fpm/fpm/fpm_unix.c +++ b/sapi/fpm/fpm/fpm_unix.c @@ -396,7 +396,6 @@ int fpm_unix_init_main() /* {{{ */ } } - zlog_set_level(fpm_globals.log_level); return 0; } /* }}} */ diff --git a/sapi/fpm/php-fpm.8.in b/sapi/fpm/php-fpm.8.in index b02aa25ba..3a697c6a6 100644 --- a/sapi/fpm/php-fpm.8.in +++ b/sapi/fpm/php-fpm.8.in @@ -84,6 +84,13 @@ Version number Specify alternative prefix path (the default is @php_fpm_prefix@) .TP .PD 0 +.B \-\-pid \fIfile\fP +.TP +.PD 1 +.B \-g +Specify the PID file location. +.TP +.PD 0 .B \-\-fpm\-config \fIfile\fP .TP .PD 1 @@ -113,12 +120,18 @@ Force to run in background and ignore daemonize option from configuration file. Force to stay in foreground and ignore daemonize option from configuration file. .TP .PD 0 -.B \-\-zend\-extension \fIfile\fP +.B \-\-force-stderr .TP .PD 1 -.B \-z \fIfile\fP -Load Zend extension -.IR file +.B \-O +Force output to stderr in nodaemonize even if stderr is not a TTY. +.TP +.PD 0 +.B \-\-allow\-to\-run\-as\-root +.TP +.PD 1 +.B \-R +Allow pool to run as root (disabled by default) .SH FILES .TP 15 .B php-fpm.conf diff --git a/sapi/fpm/php-fpm.conf.in b/sapi/fpm/php-fpm.conf.in index 631bc46f4..833a4f4f8 100644 --- a/sapi/fpm/php-fpm.conf.in +++ b/sapi/fpm/php-fpm.conf.in @@ -131,6 +131,7 @@ ; Per pool prefix ; It only applies on the following directives: +; - 'access.log' ; - 'slowlog' ; - 'listen' (unixsocket) ; - 'chroot' @@ -150,12 +151,14 @@ group = @php_fpm_group@ ; The address on which to accept FastCGI requests. ; Valid syntaxes are: -; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific address on +; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific IPv4 address on ; a specific port; ; '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on ; a specific port; -; 'port' - to listen on a TCP socket to all addresses on a +; 'port' - to listen on a TCP socket to all IPv4 addresses on a ; specific port; +; '[::]:port' - to listen on a TCP socket to all addresses +; (IPv6 and IPv4-mapped) on a specific port; ; '/path/to/unix/socket' - to listen on a unix socket. ; Note: This value is mandatory. listen = 127.0.0.1:9000 @@ -173,7 +176,7 @@ listen = 127.0.0.1:9000 ;listen.group = @php_fpm_group@ ;listen.mode = 0660 -; List of ipv4 addresses of FastCGI clients which are allowed to connect. +; List of addresses (IPv4/IPv6) of FastCGI clients which are allowed to connect. ; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original ; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address ; must be separated by a comma. If this value is left blank, connections will be diff --git a/sapi/fpm/tests/002.phpt b/sapi/fpm/tests/002.phpt index 2ef6cedc3..89e431849 100644 --- a/sapi/fpm/tests/002.phpt +++ b/sapi/fpm/tests/002.phpt @@ -8,12 +8,13 @@ FPM: Startup and connect include "include.inc"; $logfile = dirname(__FILE__).'/php-fpm.log.tmp'; +$port = 9000+PHP_INT_SIZE; $cfg = <<<EOT [global] error_log = $logfile [unconfined] -listen = 127.0.0.1:9000 +listen = 127.0.0.1:$port pm = dynamic pm.max_children = 5 pm.start_servers = 2 @@ -23,10 +24,9 @@ EOT; $fpm = run_fpm($cfg, $tail); if (is_resource($fpm)) { - var_dump(fgets($tail)); - var_dump(fgets($tail)); + fpm_display_log($tail, 2); $i = 0; - while (($i++ < 30) && !($fp = @fsockopen('127.0.0.1', 9000))) { + while (($i++ < 30) && !($fp = @fsockopen('127.0.0.1', $port))) { usleep(10000); } if ($fp) { @@ -41,10 +41,8 @@ if (is_resource($fpm)) { ?> --EXPECTF-- -string(%d) "[%d-%s-%d %d:%d:%d] NOTICE: fpm is running, pid %d -" -string(%d) "[%d-%s-%d %d:%d:%d] NOTICE: ready to handle connections -" +[%d-%s-%d %d:%d:%d] NOTICE: fpm is running, pid %d +[%d-%s-%d %d:%d:%d] NOTICE: ready to handle connections Done --CLEAN-- <?php diff --git a/sapi/fpm/tests/003.phpt b/sapi/fpm/tests/003.phpt index 389cb2401..f928626ec 100644 --- a/sapi/fpm/tests/003.phpt +++ b/sapi/fpm/tests/003.phpt @@ -8,12 +8,13 @@ FPM: Test IPv6 support include "include.inc"; $logfile = dirname(__FILE__).'/php-fpm.log.tmp'; +$port = 9000+PHP_INT_SIZE; $cfg = <<<EOT [global] error_log = $logfile [unconfined] -listen = [::1]:9000 +listen = [::1]:$port pm = dynamic pm.max_children = 5 pm.start_servers = 2 @@ -23,10 +24,9 @@ EOT; $fpm = run_fpm($cfg, $tail); if (is_resource($fpm)) { - var_dump(fgets($tail)); - var_dump(fgets($tail)); + fpm_display_log($tail, 2); $i = 0; - while (($i++ < 30) && !($fp = fsockopen('[::1]', 9000))) { + while (($i++ < 30) && !($fp = fsockopen('[::1]', $port))) { usleep(10000); } if ($fp) { @@ -41,10 +41,8 @@ if (is_resource($fpm)) { ?> --EXPECTF-- -string(%d) "[%d-%s-%d %d:%d:%d] NOTICE: fpm is running, pid %d -" -string(%d) "[%d-%s-%d %d:%d:%d] NOTICE: ready to handle connections -" +[%d-%s-%d %d:%d:%d] NOTICE: fpm is running, pid %d +[%d-%s-%d %d:%d:%d] NOTICE: ready to handle connections Done --CLEAN-- <?php diff --git a/sapi/fpm/tests/004.phpt b/sapi/fpm/tests/004.phpt new file mode 100644 index 000000000..2a4d666c6 --- /dev/null +++ b/sapi/fpm/tests/004.phpt @@ -0,0 +1,59 @@ +--TEST-- +FPM: Test IPv4/IPv6 support +--SKIPIF-- +<?php include "skipif.inc"; ?> +--FILE-- +<?php + +include "include.inc"; + +$logfile = dirname(__FILE__).'/php-fpm.log.tmp'; +$port = 9000+PHP_INT_SIZE; + +$cfg = <<<EOT +[global] +error_log = $logfile +[unconfined] +listen = [::]:$port +pm = dynamic +pm.max_children = 5 +pm.start_servers = 2 +pm.min_spare_servers = 1 +pm.max_spare_servers = 3 +EOT; + +$fpm = run_fpm($cfg, $tail); +if (is_resource($fpm)) { + fpm_display_log($tail, 2); + $i = 0; + while (($i++ < 30) && !($fp = @fsockopen('127.0.0.1', $port))) { + usleep(10000); + } + if ($fp) { + echo "Done IPv4\n"; + fclose($fp); + } + while (($i++ < 30) && !($fp = @fsockopen('[::1]', $port))) { + usleep(10000); + } + if ($fp) { + echo "Done IPv6\n"; + fclose($fp); + } + proc_terminate($fpm); + stream_get_contents($tail); + fclose($tail); + proc_close($fpm); +} + +?> +--EXPECTF-- +[%d-%s-%d %d:%d:%d] NOTICE: fpm is running, pid %d +[%d-%s-%d %d:%d:%d] NOTICE: ready to handle connections +Done IPv4 +Done IPv6 +--CLEAN-- +<?php + $logfile = dirname(__FILE__).'/php-fpm.log.tmp'; + @unlink($logfile); +?> diff --git a/sapi/fpm/tests/005.phpt b/sapi/fpm/tests/005.phpt new file mode 100644 index 000000000..c565c2a9e --- /dev/null +++ b/sapi/fpm/tests/005.phpt @@ -0,0 +1,57 @@ +--TEST-- +FPM: Test IPv4 allowed clients +--SKIPIF-- +<?php include "skipif.inc"; ?> +--FILE-- +<?php + +include "include.inc"; + +$logfile = dirname(__FILE__).'/php-fpm.log.tmp'; +$port = 9000+PHP_INT_SIZE; + +$cfg = <<<EOT +[global] +error_log = $logfile +[unconfined] +listen = [::]:$port +listen.allowed_clients = 127.0.0.1 +pm = dynamic +pm.max_children = 5 +pm.start_servers = 2 +pm.min_spare_servers = 1 +pm.max_spare_servers = 3 +EOT; + +$fpm = run_fpm($cfg, $tail); +if (is_resource($fpm)) { + fpm_display_log($tail, 2); + try { + run_request('127.0.0.1', $port); + echo "IPv4 ok\n"; + } catch (Exception $e) { + echo "IPv4 error\n"; + } + try { + run_request('[::1]', $port); + echo "IPv6 ok\n"; + } catch (Exception $e) { + echo "IPv6 error\n"; + } + proc_terminate($fpm); + stream_get_contents($tail); + fclose($tail); + proc_close($fpm); +} + +?> +--EXPECTF-- +[%d-%s-%d %d:%d:%d] NOTICE: fpm is running, pid %d +[%d-%s-%d %d:%d:%d] NOTICE: ready to handle connections +IPv4 ok +IPv6 error +--CLEAN-- +<?php + $logfile = dirname(__FILE__).'/php-fpm.log.tmp'; + @unlink($logfile); +?> diff --git a/sapi/fpm/tests/006.phpt b/sapi/fpm/tests/006.phpt new file mode 100644 index 000000000..a12ca253d --- /dev/null +++ b/sapi/fpm/tests/006.phpt @@ -0,0 +1,57 @@ +--TEST-- +FPM: Test IPv6 allowed clients (bug #68428) +--SKIPIF-- +<?php include "skipif.inc"; ?> +--FILE-- +<?php + +include "include.inc"; + +$logfile = dirname(__FILE__).'/php-fpm.log.tmp'; +$port = 9000+PHP_INT_SIZE; + +$cfg = <<<EOT +[global] +error_log = $logfile +[unconfined] +listen = [::]:$port +listen.allowed_clients = ::1 +pm = dynamic +pm.max_children = 5 +pm.start_servers = 2 +pm.min_spare_servers = 1 +pm.max_spare_servers = 3 +EOT; + +$fpm = run_fpm($cfg, $tail); +if (is_resource($fpm)) { + fpm_display_log($tail, 2); + try { + run_request('127.0.0.1', $port); + echo "IPv4 ok\n"; + } catch (Exception $e) { + echo "IPv4 error\n"; + } + try { + run_request('[::1]', $port); + echo "IPv6 ok\n"; + } catch (Exception $e) { + echo "IPv6 error\n"; + } + proc_terminate($fpm); + stream_get_contents($tail); + fclose($tail); + proc_close($fpm); +} + +?> +--EXPECTF-- +[%d-%s-%d %d:%d:%d] NOTICE: fpm is running, pid %d +[%d-%s-%d %d:%d:%d] NOTICE: ready to handle connections +IPv4 error +IPv6 ok +--CLEAN-- +<?php + $logfile = dirname(__FILE__).'/php-fpm.log.tmp'; + @unlink($logfile); +?> diff --git a/sapi/fpm/tests/007.phpt b/sapi/fpm/tests/007.phpt new file mode 100644 index 000000000..0d817907c --- /dev/null +++ b/sapi/fpm/tests/007.phpt @@ -0,0 +1,68 @@ +--TEST-- +FPM: Test IPv6 all addresses and access_log (bug #68421) +--SKIPIF-- +<?php include "skipif.inc"; ?> +--FILE-- +<?php + +include "include.inc"; + +$logfile = dirname(__FILE__).'/php-fpm.log.tmp'; +$accfile = dirname(__FILE__).'/php-fpm.acc.tmp'; +$port = 9000+PHP_INT_SIZE; + +$cfg = <<<EOT +[global] +error_log = $logfile +[unconfined] +listen = [::]:$port +access.log = $accfile +ping.path = /ping +ping.response = pong +pm = dynamic +pm.max_children = 5 +pm.start_servers = 2 +pm.min_spare_servers = 1 +pm.max_spare_servers = 3 +EOT; + +$fpm = run_fpm($cfg, $tail); +if (is_resource($fpm)) { + fpm_display_log($tail, 2); + try { + var_dump(strpos(run_request('127.0.0.1', $port), 'pong')); + echo "IPv4 ok\n"; + } catch (Exception $e) { + echo "IPv4 error\n"; + } + try { + var_dump(strpos(run_request('[::1]', $port), 'pong')); + echo "IPv6 ok\n"; + } catch (Exception $e) { + echo "IPv6 error\n"; + } + proc_terminate($fpm); + stream_get_contents($tail); + fclose($tail); + proc_close($fpm); + + echo file_get_contents($accfile); +} + +?> +--EXPECTF-- +[%d-%s-%d %d:%d:%d] NOTICE: fpm is running, pid %d +[%d-%s-%d %d:%d:%d] NOTICE: ready to handle connections +int(%d) +IPv4 ok +int(%d) +IPv6 ok +127.0.0.1 %s "GET /ping" 200 +::1 %s "GET /ping" 200 +--CLEAN-- +<?php + $logfile = dirname(__FILE__).'/php-fpm.log.tmp'; + @unlink($logfile); + $accfile = dirname(__FILE__).'/php-fpm.acc.tmp'; + @unlink($accfile); +?> diff --git a/sapi/fpm/tests/008.phpt b/sapi/fpm/tests/008.phpt new file mode 100644 index 000000000..60f1ea6eb --- /dev/null +++ b/sapi/fpm/tests/008.phpt @@ -0,0 +1,84 @@ +--TEST-- +FPM: Test multi pool (dynamic + ondemand + static) (bug #68423) +--SKIPIF-- +<?php include "skipif.inc"; ?> +--FILE-- +<?php + +include "include.inc"; + +$logfile = dirname(__FILE__).'/php-fpm.log.tmp'; +$port1 = 9000+PHP_INT_SIZE; +$port2 = 9001+PHP_INT_SIZE; +$port3 = 9002+PHP_INT_SIZE; + +$cfg = <<<EOT +[global] +error_log = $logfile +[pool_dynamic] +listen = 127.0.0.1:$port1 +ping.path = /ping +ping.response = pong-dynamic +pm = dynamic +pm.max_children = 5 +pm.start_servers = 2 +pm.min_spare_servers = 1 +pm.max_spare_servers = 3 +[poold_ondemand] +listen = 127.0.0.1:$port2 +ping.path = /ping +ping.response = pong-on-demand +pm = ondemand +pm.max_children = 2 +pm.process_idle_timeout = 10 +[pool_static] +listen = 127.0.0.1:$port3 +ping.path = /ping +ping.response = pong-static +pm = static +pm.max_children = 2 +EOT; + +$fpm = run_fpm($cfg, $tail); +if (is_resource($fpm)) { + fpm_display_log($tail, 2); + try { + var_dump(strpos(run_request('127.0.0.1', $port1), 'pong-dynamic')); + echo "Dynamic ok\n"; + } catch (Exception $e) { + echo "Dynamic error\n"; + } + try { + var_dump(strpos(run_request('127.0.0.1', $port2), 'pong-on-demand')); + echo "OnDemand ok\n"; + } catch (Exception $e) { + echo "OnDemand error\n"; + } + try { + var_dump(strpos(run_request('127.0.0.1', $port3), 'pong-static')); + echo "Static ok\n"; + } catch (Exception $e) { + echo "Static error\n"; + } + + proc_terminate($fpm); + stream_get_contents($tail); + fclose($tail); + proc_close($fpm); +} + +?> +--EXPECTF-- +[%d-%s-%d %d:%d:%d] NOTICE: fpm is running, pid %d +[%d-%s-%d %d:%d:%d] NOTICE: ready to handle connections +int(%d) +Dynamic ok +int(%d) +OnDemand ok +int(%d) +Static ok +--CLEAN-- +<?php + $logfile = dirname(__FILE__).'/php-fpm.log.tmp'; + @unlink($logfile); +?> diff --git a/sapi/fpm/tests/009.phpt b/sapi/fpm/tests/009.phpt new file mode 100644 index 000000000..34cdffcf8 --- /dev/null +++ b/sapi/fpm/tests/009.phpt @@ -0,0 +1,53 @@ +--TEST-- +FPM: Test Unix Domain Socket +--SKIPIF-- +<?php include "skipif.inc"; ?> +--FILE-- +<?php + +include "include.inc"; + +$logfile = dirname(__FILE__).'/php-fpm.log.tmp'; +$socket = dirname(__FILE__).'/php-fpm.sock'; + +$cfg = <<<EOT +[global] +error_log = $logfile +[unconfined] +listen = $socket +ping.path = /ping +ping.response = pong +pm = dynamic +pm.max_children = 5 +pm.start_servers = 2 +pm.min_spare_servers = 1 +pm.max_spare_servers = 3 +EOT; + +$fpm = run_fpm($cfg, $tail); +if (is_resource($fpm)) { + fpm_display_log($tail, 2); + try { + var_dump(strpos(run_request('unix://'.$socket, -1), 'pong')); + echo "UDS ok\n"; + } catch (Exception $e) { + echo "UDS error\n"; + } + + proc_terminate($fpm); + stream_get_contents($tail); + fclose($tail); + proc_close($fpm); +} + +?> +--EXPECTF-- +[%d-%s-%d %d:%d:%d] NOTICE: fpm is running, pid %d +[%d-%s-%d %d:%d:%d] NOTICE: ready to handle connections +int(%d) +UDS ok +--CLEAN-- +<?php + $logfile = dirname(__FILE__).'/php-fpm.log.tmp'; + @unlink($logfile); +?> diff --git a/sapi/fpm/tests/010.phpt b/sapi/fpm/tests/010.phpt new file mode 100644 index 000000000..37c778db5 --- /dev/null +++ b/sapi/fpm/tests/010.phpt @@ -0,0 +1,84 @@ +--TEST-- +FPM: Test status page +--SKIPIF-- +<?php include "skipif.inc"; ?> +--FILE-- +<?php + +include "include.inc"; + +$logfile = dirname(__FILE__).'/php-fpm.log.tmp'; +$port = 9000+PHP_INT_SIZE; + +$cfg = <<<EOT +[global] +error_log = $logfile +[unconfined] +listen = 127.0.0.1:$port +pm.status_path = /status +pm = dynamic +pm.max_children = 5 +pm.start_servers = 2 +pm.min_spare_servers = 1 +pm.max_spare_servers = 3 +EOT; + +$fpm = run_fpm($cfg, $tail); +if (is_resource($fpm)) { + fpm_display_log($tail, 2); + try { + echo run_request('127.0.0.1', $port, '/status'); + + $html = run_request('127.0.0.1', $port, '/status', 'html'); + var_dump(strpos($html, 'text/html') && strpos($html, 'DOCTYPE') && strpos($html, 'PHP-FPM Status Page')); + + $json = run_request('127.0.0.1', $port, '/status', 'json'); + var_dump(strpos($json, 'application/json') && strpos($json, '"pool":"unconfined"')); + + $xml = run_request('127.0.0.1', $port, '/status', 'xml'); + var_dump(strpos($xml, 'text/xml') && strpos($xml, '<?xml')); + + echo "IPv4 ok\n"; + } catch (Exception $e) { + echo "IPv4 error\n"; + } + + proc_terminate($fpm); + stream_get_contents($tail); + fclose($tail); + proc_close($fpm); +} + +?> +--EXPECTF-- +[%d-%s-%d %d:%d:%d] NOTICE: fpm is running, pid %d +[%d-%s-%d %d:%d:%d] NOTICE: ready to handle connections +X-Powered-By: PHP/%s +Expires: %s +Cache-Control: %s +Content-type: text/plain%s + +pool: unconfined +process manager: dynamic +start time: %s +start since: %d +accepted conn: 1 +listen queue: 0 +max listen queue: 0 +listen queue len: %d +idle processes: 1 +active processes: 1 +total processes: 2 +max active processes: 1 +max children reached: 0 +slow requests: 0 + +bool(true) +bool(true) +bool(true) +IPv4 ok +--CLEAN-- +<?php + $logfile = dirname(__FILE__).'/php-fpm.log.tmp'; + @unlink($logfile); +?> diff --git a/sapi/fpm/tests/011.phpt b/sapi/fpm/tests/011.phpt new file mode 100644 index 000000000..0b849f873 --- /dev/null +++ b/sapi/fpm/tests/011.phpt @@ -0,0 +1,53 @@ +--TEST-- +FPM: Test IPv4 all addresses (bug #68420) +--SKIPIF-- +<?php include "skipif.inc"; ?> +--FILE-- +<?php + +include "include.inc"; + +$logfile = dirname(__FILE__).'/php-fpm.log.tmp'; +$port = 9000+PHP_INT_SIZE; + +$cfg = <<<EOT +[global] +error_log = $logfile +[unconfined] +listen = $port +ping.path = /ping +ping.response = pong +pm = dynamic +pm.max_children = 5 +pm.start_servers = 2 +pm.min_spare_servers = 1 +pm.max_spare_servers = 3 +EOT; + +$fpm = run_fpm($cfg, $tail); +if (is_resource($fpm)) { + fpm_display_log($tail, 2); + try { + var_dump(strpos(run_request('127.0.0.1', $port), 'pong')); + echo "IPv4 ok\n"; + } catch (Exception $e) { + echo "IPv4 error\n"; + } + + proc_terminate($fpm); + stream_get_contents($tail); + fclose($tail); + proc_close($fpm); +} + +?> +--EXPECTF-- +[%d-%s-%d %d:%d:%d] NOTICE: fpm is running, pid %d +[%d-%s-%d %d:%d:%d] NOTICE: ready to handle connections +int(%d) +IPv4 ok +--CLEAN-- +<?php + $logfile = dirname(__FILE__).'/php-fpm.log.tmp'; + @unlink($logfile); +?> diff --git a/sapi/fpm/tests/012.phpt b/sapi/fpm/tests/012.phpt new file mode 100644 index 000000000..d96c53081 --- /dev/null +++ b/sapi/fpm/tests/012.phpt @@ -0,0 +1,79 @@ +--TEST-- +FPM: Test reload configuration (bug #68442) +--SKIPIF-- +<?php include "skipif.inc"; ?> +--FILE-- +<?php + +include "include.inc"; + +$logfile = dirname(__FILE__).'/php-fpm.log.tmp'; +$pidfile = dirname(__FILE__).'/php-fpm.pid'; +$port = 9000+PHP_INT_SIZE; + +$cfg = <<<EOT +[global] +error_log = $logfile +pid = $pidfile +[unconfined] +listen = 127.0.0.1:$port +ping.path = /ping +ping.response = pong +pm = dynamic +pm.max_children = 5 +pm.start_servers = 2 +pm.min_spare_servers = 1 +pm.max_spare_servers = 3 +EOT; + +$fpm = run_fpm($cfg, $tail); +if (is_resource($fpm)) { + fpm_display_log($tail, 2); + try { + var_dump(strpos(run_request('127.0.0.1', $port), 'pong')); + echo "IPv4 ok\n"; + } catch (Exception $e) { + echo "IPv4 error\n"; + } + + $pid=file_get_contents($pidfile); + if ($pid) { + exec("kill -USR2 $pid"); + } else { + die("PID not found\n"); + } + fpm_display_log($tail, 5); + + try { + var_dump(strpos(run_request('127.0.0.1', $port), 'pong')); + echo "IPv4 ok\n"; + } catch (Exception $e) { + echo "IPv4 error\n"; + } + + proc_terminate($fpm); + stream_get_contents($tail); + fclose($tail); + proc_close($fpm); +} + +?> +--EXPECTF-- +[%d-%s-%d %d:%d:%d] NOTICE: fpm is running, pid %d +[%d-%s-%d %d:%d:%d] NOTICE: ready to handle connections +int(%d) +IPv4 ok +[%d-%s-%d %d:%d:%d] NOTICE: Reloading in progress ... +[%d-%s-%d %d:%d:%d] NOTICE: reloading: %s +[%d-%s-%d %d:%d:%d] NOTICE: using inherited socket fd=%d, "127.0.0.1:%d" +[%d-%s-%d %d:%d:%d] NOTICE: fpm is running, pid %d +[%d-%s-%d %d:%d:%d] NOTICE: ready to handle connections +int(%d) +IPv4 ok +--CLEAN-- +<?php + $logfile = dirname(__FILE__).'/php-fpm.log.tmp'; + @unlink($logfile); + $pidfile = dirname(__FILE__).'/php-fpm.pid'; + @unlink($pidfile); +?> diff --git a/sapi/fpm/tests/013.phpt b/sapi/fpm/tests/013.phpt new file mode 100644 index 000000000..8d6a9d1d8 --- /dev/null +++ b/sapi/fpm/tests/013.phpt @@ -0,0 +1,54 @@ +--TEST-- +FPM: Test for log_level in fpm_unix_init_main #68381 +--SKIPIF-- +<?php include "skipif.inc"; ?> +--FILE-- +<?php + +include "include.inc"; + +$logfile = dirname(__FILE__).'/php-fpm.log.tmp'; +$port = 9000+PHP_INT_SIZE; + +$cfg = <<<EOT +[global] +error_log = $logfile +log_level = warning +[unconfined] +listen = 127.0.0.1:$port +user = foo +pm = dynamic +pm.max_children = 5 +pm.start_servers = 2 +pm.min_spare_servers = 1 +pm.max_spare_servers = 3 +EOT; + +$fpm = run_fpm($cfg, $tail); +if (is_resource($fpm)) { + $i = 0; + while (($i++ < 30) && !($fp = @fsockopen('127.0.0.1', $port))) { + usleep(10000); + } + if ($fp) { + echo "Started\n"; + fclose($fp); + } + proc_terminate($fpm); + if (!feof($tail)) { + echo stream_get_contents($tail); + } + fclose($tail); + proc_close($fpm); +} + +?> +Done +--EXPECTF-- +Started +Done +--CLEAN-- +<?php + $logfile = dirname(__FILE__).'/php-fpm.log.tmp'; + @unlink($logfile); +?>
\ No newline at end of file diff --git a/sapi/fpm/tests/014.phpt b/sapi/fpm/tests/014.phpt new file mode 100644 index 000000000..ee0e549cc --- /dev/null +++ b/sapi/fpm/tests/014.phpt @@ -0,0 +1,54 @@ +--TEST-- +FPM: Test for pm.start_servers default calculation message being a notice and not a warning #68458 +--SKIPIF-- +<?php include "skipif.inc"; ?> +--FILE-- +<?php + +include "include.inc"; + +$logfile = dirname(__FILE__).'/php-fpm.log.tmp'; +$port = 9000+PHP_INT_SIZE; + +$cfg = <<<EOT +[global] +error_log = $logfile +log_level = warning +[unconfined] +listen = 127.0.0.1:$port +user = foo +pm = dynamic +pm.max_children = 5 +;pm.start_servers = 2 +pm.min_spare_servers = 1 +pm.max_spare_servers = 3 +EOT; + +$fpm = run_fpm($cfg, $tail); +if (is_resource($fpm)) { + $i = 0; + while (($i++ < 30) && !($fp = @fsockopen('127.0.0.1', $port))) { + usleep(10000); + } + if ($fp) { + echo "Started\n"; + fclose($fp); + } + proc_terminate($fpm); + if (!feof($tail)) { + echo stream_get_contents($tail); + } + fclose($tail); + proc_close($fpm); +} + +?> +Done +--EXPECTF-- +Started +Done +--CLEAN-- +<?php + $logfile = dirname(__FILE__).'/php-fpm.log.tmp'; + @unlink($logfile); +?>
\ No newline at end of file diff --git a/sapi/fpm/tests/015.phpt b/sapi/fpm/tests/015.phpt new file mode 100644 index 000000000..fba333e25 --- /dev/null +++ b/sapi/fpm/tests/015.phpt @@ -0,0 +1,87 @@ +--TEST-- +FPM: Test various messages on start, from master and childs +--SKIPIF-- +<?php include "skipif.inc"; ?> +--FILE-- +<?php + +include "include.inc"; + +$logfile = dirname(__FILE__).'/php-fpm.log.tmp'; +$port1 = 9000+PHP_INT_SIZE; +$port2 = 9001+PHP_INT_SIZE; + +$cfg = <<<EOT +[global] +error_log = $logfile +log_level = notice +[pool1] +listen = 127.0.0.1:$port1 +listen.allowed_clients=127.0.0.1 +user = foo +pm = dynamic +pm.max_children = 5 +pm.min_spare_servers = 1 +pm.max_spare_servers = 3 +catch_workers_output = yes +[pool2] +listen = 127.0.0.1:$port2 +listen.allowed_clients=xxx +pm = dynamic +pm.max_children = 5 +pm.start_servers = 1 +pm.min_spare_servers = 1 +pm.max_spare_servers = 3 +catch_workers_output = yes +EOT; + +$fpm = run_fpm($cfg, $tail); +if (is_resource($fpm)) { + $i = 0; + while (($i++ < 30) && !($fp = @fsockopen('127.0.0.1', $port1))) { + usleep(10000); + } + if ($fp) { + echo "Started\n"; + fclose($fp); + } + for ($i=0 ; $i<10 ; $i++) { + try { + run_request('127.0.0.1', $port1); + } catch (Exception $e) { + echo "Error 1\n"; + } + } + try { + run_request('127.0.0.1', $port2); + } catch (Exception $e) { + echo "Error 2\n"; + } + proc_terminate($fpm); + if (!feof($tail)) { + echo stream_get_contents($tail); + } + fclose($tail); + proc_close($fpm); +} + +?> +Done +--EXPECTF-- +Started +Error 2 +[%s] NOTICE: [pool pool1] pm.start_servers is not set. It's been set to 2. +[%s] NOTICE: [pool pool1] 'user' directive is ignored when FPM is not running as root +[%s] NOTICE: fpm is running, pid %d +[%s] NOTICE: ready to handle connections +[%s] WARNING: [pool pool2] child %d said into stderr: "ERROR: Wrong IP address 'xxx' in listen.allowed_clients" +[%s] WARNING: [pool pool2] child %d said into stderr: "ERROR: There are no allowed addresses for this pool" +[%s] WARNING: [pool pool2] child %d said into stderr: "ERROR: Connection disallowed: IP address '127.0.0.1' has been dropped." +[%s] NOTICE: Terminating ... +[%s] NOTICE: exiting, bye-bye! +Done +--CLEAN-- +<?php + $logfile = dirname(__FILE__).'/php-fpm.log.tmp'; + @unlink($logfile); +?>
\ No newline at end of file diff --git a/sapi/fpm/tests/016.phpt b/sapi/fpm/tests/016.phpt new file mode 100644 index 000000000..1a9e8e757 --- /dev/null +++ b/sapi/fpm/tests/016.phpt @@ -0,0 +1,87 @@ +--TEST-- +FPM: Test splited configuration and load order #68391 +--SKIPIF-- +<?php include "skipif.inc"; ?> +--FILE-- +<?php + +include "include.inc"; + +$logfile = __DIR__.'/php-fpm.log.tmp'; +$logdir = __DIR__.'/conf.d'; +$port = 9000+PHP_INT_SIZE; + +// Main configuration +$cfg = <<<EOT +[global] +error_log = $logfile +log_level = notice +include = $logdir/*.conf +EOT; + +// Splited configuration +@mkdir($logdir); +$i=$port; +$names = ['cccc', 'aaaa', 'eeee', 'dddd', 'bbbb']; +foreach($names as $name) { + $poolcfg = <<<EOT +[$name] +listen = 127.0.0.1:$i +listen.allowed_clients=127.0.0.1 +user = foo +pm = ondemand +pm.max_children = 5 +EOT; + file_put_contents("$logdir/$name.conf", $poolcfg); + $i++; +} + +// Test +$fpm = run_fpm($cfg, $tail); +if (is_resource($fpm)) { + fpm_display_log($tail, count($names)+2); + $i=$port; + foreach($names as $name) { + try { + run_request('127.0.0.1', $i++); + echo "OK $name\n"; + } catch (Exception $e) { + echo "Error 1\n"; + } + } + proc_terminate($fpm); + if (!feof($tail)) { + echo stream_get_contents($tail); + } + fclose($tail); + proc_close($fpm); +} + +?> +Done +--EXPECTF-- +[%s] NOTICE: [pool aaaa] 'user' directive is ignored when FPM is not running as root +[%s] NOTICE: [pool bbbb] 'user' directive is ignored when FPM is not running as root +[%s] NOTICE: [pool cccc] 'user' directive is ignored when FPM is not running as root +[%s] NOTICE: [pool dddd] 'user' directive is ignored when FPM is not running as root +[%s] NOTICE: [pool eeee] 'user' directive is ignored when FPM is not running as root +[%s] NOTICE: fpm is running, pid %d +[%s] NOTICE: ready to handle connections +OK cccc +OK aaaa +OK eeee +OK dddd +OK bbbb +[%s] NOTICE: Terminating ... +[%s] NOTICE: exiting, bye-bye! +Done +--CLEAN-- +<?php + $logfile = __DIR__.'/php-fpm.log.tmp'; + $logdir = __DIR__.'/conf.d'; + @unlink($logfile); + foreach(glob("$logdir/*.conf") as $name) { + unlink($name); + } + @rmdir($logdir); +?>
\ No newline at end of file diff --git a/sapi/fpm/tests/017.phpt b/sapi/fpm/tests/017.phpt new file mode 100644 index 000000000..b3de089a7 --- /dev/null +++ b/sapi/fpm/tests/017.phpt @@ -0,0 +1,67 @@ +--TEST-- +FPM: Test fastcgi_finish_request function +--SKIPIF-- +<?php include "skipif.inc"; ?> +--FILE-- +<?php + +include "include.inc"; + +$logfile = __DIR__.'/php-fpm.log.tmp'; +$srcfile = __DIR__.'/php-fpm.tmp.php'; +$port = 9000+PHP_INT_SIZE; + +$cfg = <<<EOT +[global] +error_log = $logfile +[unconfined] +listen = 127.0.0.1:$port +pm = dynamic +pm.max_children = 5 +pm.start_servers = 1 +pm.min_spare_servers = 1 +pm.max_spare_servers = 3 +EOT; + +$code = <<<EOT +<?php +echo "Test Start\n"; +fastcgi_finish_request(); +echo "Test End\n"; +EOT; +file_put_contents($srcfile, $code); + +$fpm = run_fpm($cfg, $tail); +if (is_resource($fpm)) { + fpm_display_log($tail, 2); + try { + $req = run_request('127.0.0.1', $port, $srcfile); + echo strstr($req, "Test Start"); + echo "Request ok\n"; + } catch (Exception $e) { + echo "Request error\n"; + } + proc_terminate($fpm); + echo stream_get_contents($tail); + fclose($tail); + proc_close($fpm); +} + +?> +Done +--EXPECTF-- +[%s] NOTICE: fpm is running, pid %d +[%s] NOTICE: ready to handle connections +Test Start + +Request ok +[%s] NOTICE: Terminating ... +[%s] NOTICE: exiting, bye-bye! +Done +--CLEAN-- +<?php + $logfile = __DIR__.'/php-fpm.log.tmp'; + $srcfile = __DIR__.'/php-fpm.tmp.php'; + @unlink($logfile); + @unlink($srcfile); +?>
\ No newline at end of file diff --git a/sapi/fpm/tests/019.phpt b/sapi/fpm/tests/019.phpt new file mode 100644 index 000000000..cdf812624 --- /dev/null +++ b/sapi/fpm/tests/019.phpt @@ -0,0 +1,80 @@ +--TEST-- +FPM: Test global prefix +--SKIPIF-- +<?php include "skipif.inc"; ?> +--FILE-- +<?php + +include "include.inc"; + +$logfile = 'php-fpm.log.tmp'; +$accfile = 'php-fpm.acc.tmp'; +$slwfile = 'php-fpm.slw.tmp'; +$pidfile = 'php-fpm.pid.tmp'; +$port = 9000+PHP_INT_SIZE; + +$cfg = <<<EOT +[global] +error_log = $logfile +pid = $pidfile +[test] +listen = 127.0.0.1:$port +access.log = $accfile +slowlog = $slwfile; +request_slowlog_timeout = 1 +ping.path = /ping +ping.response = pong +pm = dynamic +pm.max_children = 5 +pm.start_servers = 2 +pm.min_spare_servers = 1 +pm.max_spare_servers = 3 +catch_workers_output = yes +EOT; + +$fpm = run_fpm($cfg, $tail, '--prefix '.__DIR__); +if (is_resource($fpm)) { + fpm_display_log($tail, 2); + try { + run_request('127.0.0.1', $port); + echo "Ping ok\n"; + } catch (Exception $e) { + echo "Ping error\n"; + } + printf("File %s %s\n", $logfile, (file_exists(__DIR__.'/'.$logfile) ? "exists" : "missing")); + printf("File %s %s\n", $accfile, (file_exists(__DIR__.'/'.$accfile) ? "exists" : "missing")); + printf("File %s %s\n", $slwfile, (file_exists(__DIR__.'/'.$slwfile) ? "exists" : "missing")); + printf("File %s %s\n", $pidfile, (file_exists(__DIR__.'/'.$pidfile) ? "exists" : "missing")); + + proc_terminate($fpm); + echo stream_get_contents($tail); + fclose($tail); + proc_close($fpm); + printf("File %s %s\n", $pidfile, (file_exists(__DIR__.'/'.$pidfile) ? "still exists" : "removed")); + readfile(__DIR__.'/'.$accfile); +} + +?> +--EXPECTF-- +[%s] NOTICE: fpm is running, pid %d +[%s] NOTICE: ready to handle connections +Ping ok +File php-fpm.log.tmp exists +File php-fpm.acc.tmp exists +File php-fpm.slw.tmp exists +File php-fpm.pid.tmp exists +[%s] NOTICE: Terminating ... +[%s] NOTICE: exiting, bye-bye! +File php-fpm.pid.tmp removed +127.0.0.1 - %s "GET /ping" 200 +--CLEAN-- +<?php + $logfile = __DIR__.'/php-fpm.log.tmp'; + $accfile = __DIR__.'/php-fpm.acc.tmp'; + $slwfile = __DIR__.'/php-fpm.slw.tmp'; + $pidfile = __DIR__.'/php-fpm.pid.tmp'; + @unlink($logfile); + @unlink($accfile); + @unlink($slwfile); + @unlink($pidfile); +?> diff --git a/sapi/fpm/tests/020.phpt b/sapi/fpm/tests/020.phpt new file mode 100644 index 000000000..d45eeccff --- /dev/null +++ b/sapi/fpm/tests/020.phpt @@ -0,0 +1,76 @@ +--TEST-- +FPM: Test pool prefix +--SKIPIF-- +<?php include "skipif.inc"; ?> +--FILE-- +<?php + +include "include.inc"; + +$prefix = __DIR__; +$logfile = __DIR__.'/php-fpm.log.tmp'; +$accfile = 'php-fpm.acc.tmp'; +$slwfile = 'php-fpm.slw.tmp'; +$pidfile = __DIR__.'/php-fpm.pid.tmp'; +$port = 9000+PHP_INT_SIZE; +$cfg = <<<EOT + +[global] +error_log = $logfile +pid = $pidfile +[test] +prefix = $prefix; +listen = 127.0.0.1:$port +access.log = $accfile +slowlog = $slwfile; +request_slowlog_timeout = 1 +ping.path = /ping +ping.response = pong +pm = dynamic +pm.max_children = 5 +pm.start_servers = 2 +pm.min_spare_servers = 1 +pm.max_spare_servers = 3 +catch_workers_output = yes +EOT; + +$fpm = run_fpm($cfg, $tail); +if (is_resource($fpm)) { + fpm_display_log($tail, 2); + try { + run_request('127.0.0.1', $port); + echo "Ping ok\n"; + } catch (Exception $e) { + echo "Ping error\n"; + } + printf("File %s %s\n", $accfile, (file_exists(__DIR__.'/'.$accfile) ? "exists" : "missing")); + printf("File %s %s\n", $slwfile, (file_exists(__DIR__.'/'.$slwfile) ? "exists" : "missing")); + + proc_terminate($fpm); + echo stream_get_contents($tail); + fclose($tail); + proc_close($fpm); + readfile(__DIR__.'/'.$accfile); +} + +?> +--EXPECTF-- +[%s] NOTICE: fpm is running, pid %d +[%s] NOTICE: ready to handle connections +Ping ok +File php-fpm.acc.tmp exists +File php-fpm.slw.tmp exists +[%s] NOTICE: Terminating ... +[%s] NOTICE: exiting, bye-bye! +127.0.0.1 - %s "GET /ping" 200 +--CLEAN-- +<?php + $logfile = __DIR__.'/php-fpm.log.tmp'; + $accfile = __DIR__.'/php-fpm.acc.tmp'; + $slwfile = __DIR__.'/php-fpm.slw.tmp'; + $pidfile = __DIR__.'/php-fpm.pid.tmp'; + @unlink($logfile); + @unlink($accfile); + @unlink($slwfile); + @unlink($pidfile); +?> diff --git a/sapi/fpm/tests/fcgi.inc b/sapi/fpm/tests/fcgi.inc new file mode 100644 index 000000000..b31676260 --- /dev/null +++ b/sapi/fpm/tests/fcgi.inc @@ -0,0 +1,592 @@ +<?php +/* + * This file is part of PHP-FastCGI-Client. + * + * (c) Pierrick Charron <pierrick@adoy.net> + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies + * of the Software, and to permit persons to whom the Software is furnished to do + * so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +namespace Adoy\FastCGI; + +class TimedOutException extends \Exception {} +class ForbiddenException extends \Exception {} + +/** + * Handles communication with a FastCGI application + * + * @author Pierrick Charron <pierrick@adoy.net> + * @version 1.0 + */ +class Client +{ + const VERSION_1 = 1; + + const BEGIN_REQUEST = 1; + const ABORT_REQUEST = 2; + const END_REQUEST = 3; + const PARAMS = 4; + const STDIN = 5; + const STDOUT = 6; + const STDERR = 7; + const DATA = 8; + const GET_VALUES = 9; + const GET_VALUES_RESULT = 10; + const UNKNOWN_TYPE = 11; + const MAXTYPE = self::UNKNOWN_TYPE; + + const RESPONDER = 1; + const AUTHORIZER = 2; + const FILTER = 3; + + const REQUEST_COMPLETE = 0; + const CANT_MPX_CONN = 1; + const OVERLOADED = 2; + const UNKNOWN_ROLE = 3; + + const MAX_CONNS = 'MAX_CONNS'; + const MAX_REQS = 'MAX_REQS'; + const MPXS_CONNS = 'MPXS_CONNS'; + + const HEADER_LEN = 8; + + const REQ_STATE_WRITTEN = 1; + const REQ_STATE_OK = 2; + const REQ_STATE_ERR = 3; + const REQ_STATE_TIMED_OUT = 4; + + /** + * Socket + * @var Resource + */ + private $_sock = null; + + /** + * Host + * @var String + */ + private $_host = null; + + /** + * Port + * @var Integer + */ + private $_port = null; + + /** + * Keep Alive + * @var Boolean + */ + private $_keepAlive = false; + + /** + * Outstanding request statuses keyed by request id + * + * Each request is an array with following form: + * + * array( + * 'state' => REQ_STATE_* + * 'response' => null | string + * ) + * + * @var array + */ + private $_requests = array(); + + /** + * Use persistent sockets to connect to backend + * @var Boolean + */ + private $_persistentSocket = false; + + /** + * Connect timeout in milliseconds + * @var Integer + */ + private $_connectTimeout = 5000; + + /** + * Read/Write timeout in milliseconds + * @var Integer + */ + private $_readWriteTimeout = 5000; + + /** + * Constructor + * + * @param String $host Host of the FastCGI application + * @param Integer $port Port of the FastCGI application + */ + public function __construct($host, $port) + { + $this->_host = $host; + $this->_port = $port; + } + + /** + * Define whether or not the FastCGI application should keep the connection + * alive at the end of a request + * + * @param Boolean $b true if the connection should stay alive, false otherwise + */ + public function setKeepAlive($b) + { + $this->_keepAlive = (boolean)$b; + if (!$this->_keepAlive && $this->_sock) { + fclose($this->_sock); + } + } + + /** + * Get the keep alive status + * + * @return Boolean true if the connection should stay alive, false otherwise + */ + public function getKeepAlive() + { + return $this->_keepAlive; + } + + /** + * Define whether or not PHP should attempt to re-use sockets opened by previous + * request for efficiency + * + * @param Boolean $b true if persistent socket should be used, false otherwise + */ + public function setPersistentSocket($b) + { + $was_persistent = ($this->_sock && $this->_persistentSocket); + $this->_persistentSocket = (boolean)$b; + if (!$this->_persistentSocket && $was_persistent) { + fclose($this->_sock); + } + } + + /** + * Get the pesistent socket status + * + * @return Boolean true if the socket should be persistent, false otherwise + */ + public function getPersistentSocket() + { + return $this->_persistentSocket; + } + + + /** + * Set the connect timeout + * + * @param Integer number of milliseconds before connect will timeout + */ + public function setConnectTimeout($timeoutMs) + { + $this->_connectTimeout = $timeoutMs; + } + + /** + * Get the connect timeout + * + * @return Integer number of milliseconds before connect will timeout + */ + public function getConnectTimeout() + { + return $this->_connectTimeout; + } + + /** + * Set the read/write timeout + * + * @param Integer number of milliseconds before read or write call will timeout + */ + public function setReadWriteTimeout($timeoutMs) + { + $this->_readWriteTimeout = $timeoutMs; + $this->set_ms_timeout($this->_readWriteTimeout); + } + + /** + * Get the read timeout + * + * @return Integer number of milliseconds before read will timeout + */ + public function getReadWriteTimeout() + { + return $this->_readWriteTimeout; + } + + /** + * Helper to avoid duplicating milliseconds to secs/usecs in a few places + * + * @param Integer millisecond timeout + * @return Boolean + */ + private function set_ms_timeout($timeoutMs) { + if (!$this->_sock) { + return false; + } + return stream_set_timeout($this->_sock, floor($timeoutMs / 1000), ($timeoutMs % 1000) * 1000); + } + + + /** + * Create a connection to the FastCGI application + */ + private function connect() + { + if (!$this->_sock) { + if ($this->_persistentSocket) { + $this->_sock = pfsockopen($this->_host, $this->_port, $errno, $errstr, $this->_connectTimeout/1000); + } else { + $this->_sock = fsockopen($this->_host, $this->_port, $errno, $errstr, $this->_connectTimeout/1000); + } + + if (!$this->_sock) { + throw new \Exception('Unable to connect to FastCGI application: ' . $errstr); + } + + if (!$this->set_ms_timeout($this->_readWriteTimeout)) { + throw new \Exception('Unable to set timeout on socket'); + } + } + } + + /** + * Build a FastCGI packet + * + * @param Integer $type Type of the packet + * @param String $content Content of the packet + * @param Integer $requestId RequestId + */ + private function buildPacket($type, $content, $requestId = 1) + { + $clen = strlen($content); + return chr(self::VERSION_1) /* version */ + . chr($type) /* type */ + . chr(($requestId >> 8) & 0xFF) /* requestIdB1 */ + . chr($requestId & 0xFF) /* requestIdB0 */ + . chr(($clen >> 8 ) & 0xFF) /* contentLengthB1 */ + . chr($clen & 0xFF) /* contentLengthB0 */ + . chr(0) /* paddingLength */ + . chr(0) /* reserved */ + . $content; /* content */ + } + + /** + * Build an FastCGI Name value pair + * + * @param String $name Name + * @param String $value Value + * @return String FastCGI Name value pair + */ + private function buildNvpair($name, $value) + { + $nlen = strlen($name); + $vlen = strlen($value); + if ($nlen < 128) { + /* nameLengthB0 */ + $nvpair = chr($nlen); + } else { + /* nameLengthB3 & nameLengthB2 & nameLengthB1 & nameLengthB0 */ + $nvpair = chr(($nlen >> 24) | 0x80) . chr(($nlen >> 16) & 0xFF) . chr(($nlen >> 8) & 0xFF) . chr($nlen & 0xFF); + } + if ($vlen < 128) { + /* valueLengthB0 */ + $nvpair .= chr($vlen); + } else { + /* valueLengthB3 & valueLengthB2 & valueLengthB1 & valueLengthB0 */ + $nvpair .= chr(($vlen >> 24) | 0x80) . chr(($vlen >> 16) & 0xFF) . chr(($vlen >> 8) & 0xFF) . chr($vlen & 0xFF); + } + /* nameData & valueData */ + return $nvpair . $name . $value; + } + + /** + * Read a set of FastCGI Name value pairs + * + * @param String $data Data containing the set of FastCGI NVPair + * @return array of NVPair + */ + private function readNvpair($data, $length = null) + { + $array = array(); + + if ($length === null) { + $length = strlen($data); + } + + $p = 0; + + while ($p != $length) { + + $nlen = ord($data{$p++}); + if ($nlen >= 128) { + $nlen = ($nlen & 0x7F << 24); + $nlen |= (ord($data{$p++}) << 16); + $nlen |= (ord($data{$p++}) << 8); + $nlen |= (ord($data{$p++})); + } + $vlen = ord($data{$p++}); + if ($vlen >= 128) { + $vlen = ($nlen & 0x7F << 24); + $vlen |= (ord($data{$p++}) << 16); + $vlen |= (ord($data{$p++}) << 8); + $vlen |= (ord($data{$p++})); + } + $array[substr($data, $p, $nlen)] = substr($data, $p+$nlen, $vlen); + $p += ($nlen + $vlen); + } + + return $array; + } + + /** + * Decode a FastCGI Packet + * + * @param String $data String containing all the packet + * @return array + */ + private function decodePacketHeader($data) + { + $ret = array(); + $ret['version'] = ord($data{0}); + $ret['type'] = ord($data{1}); + $ret['requestId'] = (ord($data{2}) << 8) + ord($data{3}); + $ret['contentLength'] = (ord($data{4}) << 8) + ord($data{5}); + $ret['paddingLength'] = ord($data{6}); + $ret['reserved'] = ord($data{7}); + return $ret; + } + + /** + * Read a FastCGI Packet + * + * @return array + */ + private function readPacket() + { + if ($packet = fread($this->_sock, self::HEADER_LEN)) { + $resp = $this->decodePacketHeader($packet); + $resp['content'] = ''; + if ($resp['contentLength']) { + $len = $resp['contentLength']; + while ($len && $buf=fread($this->_sock, $len)) { + $len -= strlen($buf); + $resp['content'] .= $buf; + } + } + if ($resp['paddingLength']) { + $buf = fread($this->_sock, $resp['paddingLength']); + } + return $resp; + } else { + return false; + } + } + + /** + * Get Informations on the FastCGI application + * + * @param array $requestedInfo information to retrieve + * @return array + */ + public function getValues(array $requestedInfo) + { + $this->connect(); + + $request = ''; + foreach ($requestedInfo as $info) { + $request .= $this->buildNvpair($info, ''); + } + fwrite($this->_sock, $this->buildPacket(self::GET_VALUES, $request, 0)); + + $resp = $this->readPacket(); + if ($resp['type'] == self::GET_VALUES_RESULT) { + return $this->readNvpair($resp['content'], $resp['length']); + } else { + throw new \Exception('Unexpected response type, expecting GET_VALUES_RESULT'); + } + } + + /** + * Execute a request to the FastCGI application + * + * @param array $params Array of parameters + * @param String $stdin Content + * @return String + */ + public function request(array $params, $stdin) + { + $id = $this->async_request($params, $stdin); + return $this->wait_for_response($id); + } + + /** + * Execute a request to the FastCGI application asyncronously + * + * This sends request to application and returns the assigned ID for that request. + * + * You should keep this id for later use with wait_for_response(). Ids are chosen randomly + * rather than seqentially to guard against false-positives when using persistent sockets. + * In that case it is possible that a delayed response to a request made by a previous script + * invocation comes back on this socket and is mistaken for response to request made with same ID + * during this request. + * + * @param array $params Array of parameters + * @param String $stdin Content + * @return Integer + */ + public function async_request(array $params, $stdin) + { + $this->connect(); + + // Pick random number between 1 and max 16 bit unsigned int 65535 + $id = mt_rand(1, (1 << 16) - 1); + + // Using persistent sockets implies you want them keept alive by server! + $keepAlive = intval($this->_keepAlive || $this->_persistentSocket); + + $request = $this->buildPacket(self::BEGIN_REQUEST + ,chr(0) . chr(self::RESPONDER) . chr($keepAlive) . str_repeat(chr(0), 5) + ,$id + ); + + $paramsRequest = ''; + foreach ($params as $key => $value) { + $paramsRequest .= $this->buildNvpair($key, $value, $id); + } + if ($paramsRequest) { + $request .= $this->buildPacket(self::PARAMS, $paramsRequest, $id); + } + $request .= $this->buildPacket(self::PARAMS, '', $id); + + if ($stdin) { + $request .= $this->buildPacket(self::STDIN, $stdin, $id); + } + $request .= $this->buildPacket(self::STDIN, '', $id); + + if (fwrite($this->_sock, $request) === false || fflush($this->_sock) === false) { + + $info = stream_get_meta_data($this->_sock); + + if ($info['timed_out']) { + throw new TimedOutException('Write timed out'); + } + + // Broken pipe, tear down so future requests might succeed + fclose($this->_sock); + throw new \Exception('Failed to write request to socket'); + } + + $this->_requests[$id] = array( + 'state' => self::REQ_STATE_WRITTEN, + 'response' => null + ); + + return $id; + } + + /** + * Blocking call that waits for response to specific request + * + * @param Integer $requestId + * @param Integer $timeoutMs [optional] the number of milliseconds to wait. Defaults to the ReadWriteTimeout value set. + * @return string response body + */ + public function wait_for_response($requestId, $timeoutMs = 0) { + + if (!isset($this->_requests[$requestId])) { + throw new \Exception('Invalid request id given'); + } + + // If we already read the response during an earlier call for different id, just return it + if ($this->_requests[$requestId]['state'] == self::REQ_STATE_OK + || $this->_requests[$requestId]['state'] == self::REQ_STATE_ERR + ) { + return $this->_requests[$requestId]['response']; + } + + if ($timeoutMs > 0) { + // Reset timeout on socket for now + $this->set_ms_timeout($timeoutMs); + } else { + $timeoutMs = $this->_readWriteTimeout; + } + + // Need to manually check since we might do several reads none of which timeout themselves + // but still not get the response requested + $startTime = microtime(true); + + do { + $resp = $this->readPacket(); + + if ($resp['type'] == self::STDOUT || $resp['type'] == self::STDERR) { + if ($resp['type'] == self::STDERR) { + $this->_requests[$resp['requestId']]['state'] = self::REQ_STATE_ERR; + } + $this->_requests[$resp['requestId']]['response'] .= $resp['content']; + } + if ($resp['type'] == self::END_REQUEST) { + $this->_requests[$resp['requestId']]['state'] = self::REQ_STATE_OK; + if ($resp['requestId'] == $requestId) { + break; + } + } + if (microtime(true) - $startTime >= ($timeoutMs * 1000)) { + // Reset + $this->set_ms_timeout($this->_readWriteTimeout); + throw new \Exception('Timed out'); + } + } while ($resp); + + if (!is_array($resp)) { + $info = stream_get_meta_data($this->_sock); + + // We must reset timeout but it must be AFTER we get info + $this->set_ms_timeout($this->_readWriteTimeout); + + if ($info['timed_out']) { + throw new TimedOutException('Read timed out'); + } + + if ($info['unread_bytes'] == 0 + && $info['blocked'] + && $info['eof']) { + throw new ForbiddenException('Not in white list. Check listen.allowed_clients.'); + } + + throw new \Exception('Read failed'); + } + + // Reset timeout + $this->set_ms_timeout($this->_readWriteTimeout); + + switch (ord($resp['content']{4})) { + case self::CANT_MPX_CONN: + throw new \Exception('This app can\'t multiplex [CANT_MPX_CONN]'); + break; + case self::OVERLOADED: + throw new \Exception('New request rejected; too busy [OVERLOADED]'); + break; + case self::UNKNOWN_ROLE: + throw new \Exception('Role value not known [UNKNOWN_ROLE]'); + break; + case self::REQUEST_COMPLETE: + return $this->_requests[$requestId]['response']; + } + } +} diff --git a/sapi/fpm/tests/include.inc b/sapi/fpm/tests/include.inc index 983cbd345..b195fad50 100644 --- a/sapi/fpm/tests/include.inc +++ b/sapi/fpm/tests/include.inc @@ -76,4 +76,36 @@ function run_fpm_till($needle, $config, $max = 10) /* {{{ */ } /* }}} */ -?> +function fpm_display_log($tail, $n=1, $ignore='systemd') { + while ($n) { + $a = fgets($tail); + if (empty($ignore) || !strpos($a, $ignore)) { + echo $a; + $n--; + } + } +} + +function run_request($host, $port, $uri='/ping', $query='') { + require_once 'fcgi.inc'; + $client = new Adoy\FastCGI\Client($host, $port); + $params = array( + 'GATEWAY_INTERFACE' => 'FastCGI/1.0', + 'REQUEST_METHOD' => 'GET', + 'SCRIPT_FILENAME' => $uri, + 'SCRIPT_NAME' => $uri, + 'QUERY_STRING' => $query, + 'REQUEST_URI' => $uri . ($query ? '?'.$query : ""), + 'DOCUMENT_URI' => $uri, + 'SERVER_SOFTWARE' => 'php/fcgiclient', + 'REMOTE_ADDR' => '127.0.0.1', + 'REMOTE_PORT' => '9985', + 'SERVER_ADDR' => '127.0.0.1', + 'SERVER_PORT' => '80', + 'SERVER_NAME' => php_uname('n'), + 'SERVER_PROTOCOL' => 'HTTP/1.1', + 'CONTENT_TYPE' => '', + 'CONTENT_LENGTH' => 0 + ); + return $client->request($params, false)."\n"; +} diff --git a/sapi/litespeed/lsapi_main.c b/sapi/litespeed/lsapi_main.c index 425d638f9..bcc039023 100644 --- a/sapi/litespeed/lsapi_main.c +++ b/sapi/litespeed/lsapi_main.c @@ -155,7 +155,7 @@ static int sapi_lsapi_ub_write(const char *str, uint str_length TSRMLS_DC) /* {{{ sapi_lsapi_flush */ -static void sapi_lsapi_flush( void * server_context ) +static void sapi_lsapi_flush( void * server_context TSRMLS_DC ) { if ( lsapi_mode ) { if ( LSAPI_Flush() == -1) { @@ -200,7 +200,12 @@ static char *sapi_lsapi_getenv( char * name, size_t name_len TSRMLS_DC ) static int add_variable( const char * pKey, int keyLen, const char * pValue, int valLen, void * arg ) { - int filter_arg = (arg == PG(http_globals)[TRACK_VARS_ENV])?PARSE_ENV:PARSE_SERVER; +#if PHP_MAJOR_VERSION >= 7 + int filter_arg = (Z_ARR_P((zval *)arg) == Z_ARR(PG(http_globals)[TRACK_VARS_ENV])) + ? PARSE_ENV : PARSE_SERVER; +#else + int filter_arg = (arg == PG(http_globals)[TRACK_VARS_ENV])?PARSE_ENV:PARSE_SERVER; +#endif char * new_val = (char *) pValue; unsigned int new_val_len; @@ -238,27 +243,45 @@ static void litespeed_php_import_environment_variables(zval *array_ptr TSRMLS_DC size_t alloc_size = sizeof(buf); unsigned long nlen; /* ptrdiff_t is not portable */ - if (PG(http_globals)[TRACK_VARS_ENV] && - array_ptr != PG(http_globals)[TRACK_VARS_ENV] && - Z_TYPE_P(PG(http_globals)[TRACK_VARS_ENV]) == IS_ARRAY && - zend_hash_num_elements(Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_ENV])) > 0 +#if PHP_MAJOR_VERSION >= 7 + if (Z_TYPE(PG(http_globals)[TRACK_VARS_ENV]) == IS_ARRAY && + Z_ARR_P(array_ptr) != Z_ARR(PG(http_globals)[TRACK_VARS_ENV]) && + zend_hash_num_elements(Z_ARRVAL(PG(http_globals)[TRACK_VARS_ENV])) > 0 ) { - zval_dtor(array_ptr); - *array_ptr = *PG(http_globals)[TRACK_VARS_ENV]; - INIT_PZVAL(array_ptr); - zval_copy_ctor(array_ptr); + zval_dtor(array_ptr); + ZVAL_DUP(array_ptr, &PG(http_globals)[TRACK_VARS_ENV]); return; - } else if (PG(http_globals)[TRACK_VARS_SERVER] && - array_ptr != PG(http_globals)[TRACK_VARS_SERVER] && - Z_TYPE_P(PG(http_globals)[TRACK_VARS_SERVER]) == IS_ARRAY && - zend_hash_num_elements(Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_SERVER])) > 0 + } else if (Z_TYPE(PG(http_globals)[TRACK_VARS_SERVER]) == IS_ARRAY && + Z_ARR_P(array_ptr) != Z_ARR(PG(http_globals)[TRACK_VARS_SERVER]) && + zend_hash_num_elements(Z_ARRVAL(PG(http_globals)[TRACK_VARS_SERVER])) > 0 ) { - zval_dtor(array_ptr); - *array_ptr = *PG(http_globals)[TRACK_VARS_SERVER]; - INIT_PZVAL(array_ptr); - zval_copy_ctor(array_ptr); + zval_dtor(array_ptr); + ZVAL_DUP(array_ptr, &PG(http_globals)[TRACK_VARS_SERVER]); return; } +#else + if (PG(http_globals)[TRACK_VARS_ENV] && + array_ptr != PG(http_globals)[TRACK_VARS_ENV] && + Z_TYPE_P(PG(http_globals)[TRACK_VARS_ENV]) == IS_ARRAY && + zend_hash_num_elements(Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_ENV])) > 0 + ) { + zval_dtor(array_ptr); + *array_ptr = *PG(http_globals)[TRACK_VARS_ENV]; + INIT_PZVAL(array_ptr); + zval_copy_ctor(array_ptr); + return; + } else if (PG(http_globals)[TRACK_VARS_SERVER] && + array_ptr != PG(http_globals)[TRACK_VARS_SERVER] && + Z_TYPE_P(PG(http_globals)[TRACK_VARS_SERVER]) == IS_ARRAY && + zend_hash_num_elements(Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_SERVER])) > 0 + ) { + zval_dtor(array_ptr); + *array_ptr = *PG(http_globals)[TRACK_VARS_SERVER]; + INIT_PZVAL(array_ptr); + zval_copy_ctor(array_ptr); + return; + } +#endif for (env = environ; env != NULL && *env != NULL; env++) { p = strchr(*env, '='); @@ -478,8 +501,8 @@ static int init_request_info( TSRMLS_D ) SG(request_info).content_length = LSAPI_GetReqBodyLen(); SG(request_info).path_translated = estrdup( LSAPI_GetScriptFileName()); - /* It is not reset by zend engine, set it to 0. */ - SG(sapi_headers).http_response_code = 0; + /* It is not reset by zend engine, set it to 200. */ + SG(sapi_headers).http_response_code = 200; pAuth = LSAPI_GetHeader( H_AUTHORIZATION ); php_handle_auth_data(pAuth TSRMLS_CC); @@ -592,6 +615,9 @@ static int lsapi_module_main(int show_source TSRMLS_DC) static int alter_ini( const char * pKey, int keyLen, const char * pValue, int valLen, void * arg ) { +#if PHP_MAJOR_VERSION >= 7 + zend_string * psKey; +#endif int type = ZEND_INI_PERDIR; if ( '\001' == *pKey ) { ++pKey; @@ -606,9 +632,19 @@ static int alter_ini( const char * pKey, int keyLen, const char * pValue, int va engine = 0; } else - zend_alter_ini_entry((char *)pKey, keyLen, + { +#if PHP_MAJOR_VERSION >= 7 + psKey = STR_INIT( pKey, keyLen, 1 ); + zend_alter_ini_entry(psKey, (char *)pValue, valLen, type, PHP_INI_STAGE_ACTIVATE); + STR_RELEASE( psKey ); +#else + zend_alter_ini_entry((char *)pKey, keyLen, + (char *)pValue, valLen, + type, PHP_INI_STAGE_ACTIVATE); +#endif + } } return 1; } @@ -749,6 +785,9 @@ static int cli_main( int argc, char * argv[] ) char ** argend= &argv[argc]; int ret = -1; int c; +#if PHP_MAJOR_VERSION >= 7 + zend_string * psKey; +#endif lsapi_mode = 0; /* enter CLI mode */ #ifdef PHP_WIN32 @@ -763,12 +802,21 @@ static int cli_main( int argc, char * argv[] ) zend_uv.html_errors = 0; /* tell the engine we're in non-html mode */ CG(in_compilation) = 0; /* not initialized but needed for several options */ +#if PHP_MAJOR_VERSION < 7 EG(uninitialized_zval_ptr) = NULL; - +#endif for( ini = ini_defaults; *ini; ini+=2 ) { +#if PHP_MAJOR_VERSION >= 7 + psKey = STR_INIT( *ini, strlen( *ini ), 1 ); + zend_alter_ini_entry( psKey, + (char *)*(ini+1), strlen( *(ini+1) ), + PHP_INI_SYSTEM, PHP_INI_STAGE_ACTIVATE); + STR_RELEASE( psKey ); +#else zend_alter_ini_entry( (char *)*ini, strlen( *ini )+1, (char *)*(ini+1), strlen( *(ini+1) ), PHP_INI_SYSTEM, PHP_INI_STAGE_ACTIVATE); +#endif } while (( p < argend )&&(**p == '-' )) { @@ -1148,7 +1196,11 @@ zend_module_entry litespeed_module_entry = { static int add_associate_array( const char * pKey, int keyLen, const char * pValue, int valLen, void * arg ) { - add_assoc_string_ex( (zval *)arg, (char *)pKey, keyLen+1, (char *)pValue, 1 ); + add_assoc_string_ex( (zval *)arg, (char *)pKey, keyLen+1, (char *)pValue +#if PHP_MAJOR_VERSION < 7 + , 1 +#endif + ); return 1; } @@ -1202,7 +1254,11 @@ PHP_FUNCTION(litespeed_response_headers) headerBuf[len] = 0; if ( len ) { while( isspace(*++p)); - add_assoc_string_ex(return_value, headerBuf, len+1, p, 1 ); + add_assoc_string_ex(return_value, headerBuf, len+1, p +#if PHP_MAJOR_VERSION < 7 + , 1 +#endif + ); } } } @@ -1217,15 +1273,25 @@ PHP_FUNCTION(litespeed_response_headers) Fetch all loaded module names */ PHP_FUNCTION(apache_get_modules) { + static const char * mod_names[] = + { + "mod_rewrite", "mod_mime", "mod_headers", "mod_expires", NULL + }; + const char **name = mod_names; /* TODO: */ if (ZEND_NUM_ARGS() > 0) { WRONG_PARAM_COUNT; } array_init(return_value); - add_next_index_string(return_value, "mod_rewrite", 1); - add_next_index_string(return_value, "mod_mime", 1); - add_next_index_string(return_value, "mod_headers", 1); - add_next_index_string(return_value, "mod_expires", 1); + while( *name ) + { + add_next_index_string(return_value, *name +#if PHP_MAJOR_VERSION < 7 + , 1 +#endif + ); + ++name; + } } /* }}} */ diff --git a/sapi/litespeed/lsapilib.c b/sapi/litespeed/lsapilib.c index aac823fc1..c915aec39 100644 --- a/sapi/litespeed/lsapilib.c +++ b/sapi/litespeed/lsapilib.c @@ -2662,7 +2662,7 @@ static void lsapi_check_child_status( long tmCur ) } if ( abs( g_prefork_server->m_iCurChildren - count ) > 1 ) { - fprintf( stderr, "Children tracking is wrong: PID: %d, Cur Childen: %d, count: %d, idle: %d, dying: %d\n", getpid(), + fprintf( stderr, "Children tracking is wrong: PID: %d, Cur Children: %d, count: %d, idle: %d, dying: %d\n", getpid(), g_prefork_server->m_iCurChildren, count, idle, dying ); } diff --git a/sapi/nsapi/nsapi-readme.txt b/sapi/nsapi/nsapi-readme.txt index 54980bf0e..10ad9f7ee 100644 --- a/sapi/nsapi/nsapi-readme.txt +++ b/sapi/nsapi/nsapi-readme.txt @@ -1,7 +1,7 @@ Configuration of your Netscape/iPlanet/Sun Webserver for PHP5 ----------------------------------------------------------------- -These instructions are targetted at Netscape Enterprise Web Server and +These instructions are targeted at Netscape Enterprise Web Server and SUN/Netscape Alliance iPlanet Web Server and the new Sun Java System Webserver. On other web servers your milage may vary. diff --git a/sapi/phpdbg/phpdbg.c b/sapi/phpdbg/phpdbg.c index fa6f84343..e532861e4 100644 --- a/sapi/phpdbg/phpdbg.c +++ b/sapi/phpdbg/phpdbg.c @@ -1497,7 +1497,7 @@ phpdbg_out: #ifdef _WIN32 } __except(phpdbg_exception_handler_win32(xp = GetExceptionInformation())) { - phpdbg_error("Access violation (Segementation fault) encountered\ntrying to abort cleanly..."); + phpdbg_error("Access violation (Segmentation fault) encountered\ntrying to abort cleanly..."); } phpdbg_out: #endif diff --git a/sapi/thttpd/thttpd_patch b/sapi/thttpd/thttpd_patch index 33de92148..f6e45d5f1 100644 --- a/sapi/thttpd/thttpd_patch +++ b/sapi/thttpd/thttpd_patch @@ -2059,7 +2059,7 @@ diff -ur thttpd-2.21b/thttpd.c thttpd-2.21b-cool/thttpd.c @@ -1519,7 +1697,7 @@ if ( c->bytes_sent >= c->bytes_to_send ) { - /* This conection is finished! */ + /* This connection is finished! */ - clear_connection( c, tvP ); + clear_connection( c, tvP, 1 ); return; diff --git a/server-tests.php b/server-tests.php index 688fee485..42dc61b38 100755 --- a/server-tests.php +++ b/server-tests.php @@ -961,7 +961,7 @@ class testHarness { if ($just_save_results || strlen(trim($user_input)) == 0 || strtolower($user_input[0]) == 'y') { /* * Collect information about the host system for our report - * Fetch phpinfo() output so that we can see the PHP enviroment + * Fetch phpinfo() output so that we can see the PHP environment * Make an archive of all the failed tests * Send an email */ diff --git a/win32/build/libs_version.txt b/win32/build/libs_version.txt index 0ea0067a6..091c3f328 100644 --- a/win32/build/libs_version.txt +++ b/win32/build/libs_version.txt @@ -1,9 +1,9 @@ bz2-1.0.6 cclient-2007f freetype-2.5.3 -icu-53.1 +icu-54.1 jpeglib-9a -libcurl-7.36.0 +libcurl-7.39.0 libiconv-1.14 libmcrypt-2.5.8 libmpir-2.6.0 @@ -13,4 +13,4 @@ libssh2-1.4.3 libtidy-20090406 libxslt-1.1.27 libxml-2.9.1 -openssl-1.0.1h +openssl-1.0.1i |