Merge branch 'master' into preload

* master: (29 commits)
  Make php_plain_files_wrapper to be writable (workaround for swoole)
  Remove phpdbg parser files generated by bison
  Fix conflicts in phpdbg parser
  Refetetch function name on exceptional path to allow better code on fast code path.
  fix typo in sysvsem.c
  Fixed bug #50675
  bump to 7.2.13-dev
  [ci skip] Update NEWS wrt. php-7.3.0RC4 tagging
  Inlining in the most frequently used code paths
  Fixed test failurs introduced by 9c144e0d82
  Use persistent strings only for persistent connections
  Fix accessibility checks for dynamic properties
  Updated to version 2018.6 (2018f)
  Updated to version 2018.6 (2018f)
  Updated to version 2018.6 (2018f)
  Fix arginfo and clean up fpm_get_status
  Defragment two Zend related Makefile fragments together
  [ci skip] Remove automake and aclocal in comments
  Fix #75282: xmlrpc_encode_request() crashes
  Fix tests for ICU 63.1
  ...
This commit is contained in:
Dmitry Stogov 2018-10-24 11:59:43 +03:00
commit e4a7ef0c43
90 changed files with 524 additions and 2541 deletions

179
.gitattributes vendored
View file

@ -1,159 +1,20 @@
ext/mysqlnd/mysqlnd.h ident
ext/ext_skel.php ident
ext/phar/phar/pharcommand.inc ident
ext/dba/libinifile/inifile.c ident
ext/dba/libflatfile/flatfile.c ident
ext/dba/libcdb/cdb_make.c ident
ext/dba/libcdb/cdb.c ident
run-tests.php ident
NEWS merge=NEWS
UPGRADING merge=NEWS
UPGRADING.INTERNALS merge=NEWS
/ext/bz2/tests/with_strings.phpt -crlf
/ext/dom/tests/bug40836.phpt -crlf
/ext/dom/tests/domelement.phpt -crlf
/ext/iconv/tests/iconv004.phpt -crlf
/ext/iconv/tests/iconv_basic.phpt -crlf
/ext/iconv/tests/iconv_strpos.phpt -crlf
/ext/iconv/tests/iconv_strpos_variation2.phpt -crlf
/ext/mbstring/tests/mb_strtoupper_error2.phpt -crlf
/ext/phar/tests/delete_in_phar_confirm.phpt -crlf
/ext/phar/tests/frontcontroller12.phpt -crlf
/ext/phar/tests/security.phpt -crlf
/ext/phar/tests/test_signaturealgos.phpt -crlf
/ext/reflection/tests/ReflectionMethod_invokeArgs_basic.phpt -crlf
/ext/reflection/tests/ReflectionProperty_getModifiers_basic.phpt -crlf
/ext/spl/tests/dllist_007.phpt -crlf
/ext/spl/tests/iterator_012.phpt -crlf
/ext/spl/tests/SplArray_fromArray.phpt -crlf
/ext/standard/tests/dir/scandir_variation3.phpt -crlf
/ext/standard/tests/general_functions/escapeshellcmd-win32.phpt -crlf
/ext/standard/tests/strings/bug26817.phpt -crlf
/ext/standard/tests/strings/bug26973.phpt -crlf
/ext/standard/tests/strings/bug27457.phpt -crlf
/ext/standard/tests/strings/bug28386.phpt -crlf
/ext/standard/tests/strings/bug37262.phpt -crlf
/ext/standard/tests/strings/bug40637.phpt -crlf
/ext/standard/tests/strings/bug40915.phpt -crlf
/ext/standard/tests/strings/bug61374.phpt -crlf
/ext/standard/tests/strings/chop_error.phpt -crlf
/ext/standard/tests/strings/chop_variation2.phpt -crlf
/ext/standard/tests/strings/chunk_split_variation10.phpt -crlf
/ext/standard/tests/strings/chunk_split_variation8.phpt -crlf
/ext/standard/tests/strings/count_chars_variation2.phpt -crlf
/ext/standard/tests/strings/dirname_error.phpt -crlf
/ext/standard/tests/strings/fprintf_variation_007_64bit.phpt -crlf
/ext/standard/tests/strings/highlight_file.phpt -crlf
/ext/standard/tests/strings/htmlentities03.phpt -crlf
/ext/standard/tests/strings/htmlentities04.phpt -crlf
/ext/standard/tests/strings/htmlentities08.phpt -crlf
/ext/standard/tests/strings/htmlentities15.phpt -crlf
/ext/standard/tests/strings/http_build_query.phpt -crlf
/ext/standard/tests/strings/metaphone.phpt -crlf
/ext/standard/tests/strings/ord_error.phpt -crlf
/ext/standard/tests/strings/printf_basic2.phpt -crlf
/ext/standard/tests/strings/printf_variation2.phpt -crlf
/ext/standard/tests/strings/quoted_printable_decode_basic.phpt -crlf
/ext/standard/tests/strings/rtrim.phpt -crlf
/ext/standard/tests/strings/setlocale_variation1.phpt -crlf
/ext/standard/tests/strings/sha1_basic.phpt -crlf
/ext/standard/tests/strings/similar_text_basic.phpt -crlf
/ext/standard/tests/strings/soundex.phpt -crlf
/ext/standard/tests/strings/sprintf_basic1.phpt -crlf
/ext/standard/tests/strings/sprintf_basic4.phpt -crlf
/ext/standard/tests/strings/sprintf_basic7.phpt -crlf
/ext/standard/tests/strings/sprintf_variation12.phpt -crlf
/ext/standard/tests/strings/sprintf_variation28.phpt -crlf
/ext/standard/tests/strings/sprintf_variation29.phpt -crlf
/ext/standard/tests/strings/sprintf_variation30.phpt -crlf
/ext/standard/tests/strings/sprintf_variation31.phpt -crlf
/ext/standard/tests/strings/sprintf_variation38.phpt -crlf
/ext/standard/tests/strings/sprintf_variation42.phpt -crlf
/ext/standard/tests/strings/sprintf_variation6.phpt -crlf
/ext/standard/tests/strings/sscanf_basic2.phpt -crlf
/ext/standard/tests/strings/sscanf_basic3.phpt -crlf
/ext/standard/tests/strings/str_getcsv_001.phpt -crlf
/ext/standard/tests/strings/stripcslashes_basic.phpt -crlf
/ext/standard/tests/strings/stripos_variation11.phpt -crlf
/ext/standard/tests/strings/stripos_variation13.phpt -crlf
/ext/standard/tests/strings/stripslashes_variation1.phpt -crlf
/ext/standard/tests/strings/stripslashes_variation2.phpt -crlf
/ext/standard/tests/strings/stristr_error.phpt -crlf
/ext/standard/tests/strings/strnatcasecmp_basic.phpt -crlf
/ext/standard/tests/strings/strncasecmp_variation6.phpt -crlf
/ext/standard/tests/strings/strncasecmp_variation7.phpt -crlf
/ext/standard/tests/strings/strncasecmp_variation8.phpt -crlf
/ext/standard/tests/strings/strrchr_error.phpt -crlf
/ext/standard/tests/strings/strrchr.phpt -crlf
/ext/standard/tests/strings/strrchr_variation11.phpt -crlf
/ext/standard/tests/strings/strrpos_error.phpt -crlf
/ext/standard/tests/strings/strrpos_variation4.phpt -crlf
/ext/standard/tests/strings/strrpos_variation8.phpt -crlf
/ext/standard/tests/strings/strstr2.phpt -crlf
/ext/standard/tests/strings/strtok_error.phpt -crlf
/ext/standard/tests/strings/strtok_variation2.phpt -crlf
/ext/standard/tests/strings/strtolower-win32.phpt -crlf
/ext/standard/tests/strings/substr_compare.phpt -crlf
/ext/standard/tests/strings/ucwords_variation1.phpt -crlf
/ext/standard/tests/strings/unpack.phpt -crlf
/ext/standard/tests/strings/vfprintf_basic7_64bit.phpt -crlf
/ext/standard/tests/strings/vfprintf_variation11_64bit.phpt -crlf
/ext/standard/tests/strings/vfprintf_variation12_64bit.phpt -crlf
/ext/standard/tests/strings/vfprintf_variation12.phpt -crlf
/ext/standard/tests/strings/vfprintf_variation13_64bit.phpt -crlf
/ext/standard/tests/strings/vfprintf_variation7.phpt -crlf
/ext/standard/tests/strings/vprintf_basic2.phpt -crlf
/ext/standard/tests/strings/vprintf_basic7_64bit.phpt -crlf
/ext/standard/tests/strings/vprintf_variation10.phpt -crlf
/ext/standard/tests/strings/vprintf_variation14_64bit.phpt -crlf
/ext/standard/tests/strings/vprintf_variation17.phpt -crlf
/ext/standard/tests/strings/vprintf_variation4.phpt -crlf
/ext/standard/tests/strings/vsprintf_basic4.phpt -crlf
/ext/standard/tests/strings/vsprintf_basic8.phpt -crlf
/ext/standard/tests/strings/vsprintf_variation12_64bit.phpt -crlf
/ext/standard/tests/strings/vsprintf_variation13_64bit.phpt -crlf
/ext/standard/tests/strings/vsprintf_variation15_64bit.phpt -crlf
/ext/standard/tests/strings/vsprintf_variation17.phpt -crlf
/ext/standard/tests/strings/vsprintf_variation4_64bit.phpt -crlf
/ext/standard/tests/strings/vsprintf_variation7.phpt -crlf
/ext/standard/tests/strings/wordwrap.phpt -crlf
/ext/standard/tests/strings/wordwrap_variation5.phpt -crlf
/ext/standard/tests/url/rawurldecode_variation_001.phpt -crlf
/ext/tidy/tests/009.phpt -crlf
/ext/tidy/tests/013.phpt -crlf
/ext/tidy/tests/021.phpt -crlf
/ext/tidy/tests/tidy_error.phpt -crlf
/ext/tokenizer/tests/002.phpt -crlf
/ext/tokenizer/tests/bug26463.phpt -crlf
/ext/tokenizer/tests/token_get_all_error.phpt -crlf
/ext/tokenizer/tests/token_get_all_variation11.phpt -crlf
/ext/tokenizer/tests/token_get_all_variation12.phpt -crlf
/ext/tokenizer/tests/token_get_all_variation13.phpt -crlf
/ext/tokenizer/tests/token_get_all_variation14.phpt -crlf
/ext/tokenizer/tests/token_get_all_variation15.phpt -crlf
/ext/tokenizer/tests/token_get_all_variation18.phpt -crlf
/ext/tokenizer/tests/token_get_all_variation19.phpt -crlf
/ext/tokenizer/tests/token_get_all_variation1.phpt -crlf
/ext/tokenizer/tests/token_get_all_variation2.phpt -crlf
/ext/tokenizer/tests/token_get_all_variation3.phpt -crlf
/ext/tokenizer/tests/token_get_all_variation5.phpt -crlf
/ext/tokenizer/tests/token_get_all_variation8.phpt -crlf
/ext/xml/tests/bug32001b.phpt -crlf
/ext/xmlwriter/tests/OO_003.phpt -crlf
/ext/xmlwriter/tests/xmlwriter_write_attribute_ns_error_001.phpt -crlf
/ext/zlib/tests/008.phpt -crlf
/ext/zlib/tests/gzopen_variation4.phpt -crlf
/ext/zlib/tests/gzrewind_error.phpt -crlf
/ext/zlib/tests/readgzfile_variation7.phpt -crlf
/ext/zlib/tests/readgzfile_variation8.phpt -crlf
/ext/zlib/tests/zlib_scheme_stat_basic.phpt -crlf
/sapi/cli/tests/006.phpt -crlf
/tests/run-test/test009.phpt -crlf
/Zend/tests/012.phpt -crlf
/Zend/tests/bug28072.phpt -crlf
/Zend/tests/bug38624.phpt -crlf
/Zend/tests/bug40784.phpt -crlf
/Zend/tests/bug43053.phpt -crlf
/Zend/tests/bug51176.phpt -crlf
/Zend/tests/each_003.phpt -crlf
/Zend/tests/errmsg_006.phpt -crlf
# Replace $Id$ strings with 40-character hexadecimal blob object name.
/ext/mysqlnd/mysqlnd.h ident
/ext/ext_skel.php ident
/ext/phar/phar/pharcommand.inc ident
/ext/dba/libinifile/inifile.c ident
/ext/dba/libflatfile/flatfile.c ident
/ext/dba/libcdb/cdb_make.c ident
/ext/dba/libcdb/cdb.c ident
/run-tests.php ident
# A custom merge driver to avoid automatic merges. These are manually merged.
# See https://wiki.php.net/vcs/gitfaq
/NEWS merge=NEWS
/UPGRADING merge=NEWS
/UPGRADING.INTERNALS merge=NEWS
# Enable commit diffs for binary PHP test files. Some PHP test files include
# special characters, such as ASCII control characters. Git recognizes these as
# binary and wouldn't generate diffs.
*.phpt diff

1
.gitignore vendored
View file

@ -2,7 +2,6 @@
*~
.#*
*.
*.slo
*.mk
*.mem
*.gcda

View file

@ -1,22 +0,0 @@
#
# Zend
#
$(builddir)/zend_language_scanner.lo: $(srcdir)/zend_language_parser.h
$(builddir)/zend_ini_scanner.lo: $(srcdir)/zend_ini_parser.h
$(srcdir)/zend_language_scanner.c: $(srcdir)/zend_language_scanner.l
@(cd $(top_srcdir); $(RE2C) $(RE2C_FLAGS) --no-generation-date --case-inverted -cbdFt Zend/zend_language_scanner_defs.h -oZend/zend_language_scanner.c Zend/zend_language_scanner.l)
$(srcdir)/zend_language_parser.h: $(srcdir)/zend_language_parser.c
$(srcdir)/zend_language_parser.c: $(srcdir)/zend_language_parser.y
@$(YACC) -p zend -v -d $(srcdir)/zend_language_parser.y -o $@
$(srcdir)/zend_ini_parser.h: $(srcdir)/zend_ini_parser.c
$(srcdir)/zend_ini_parser.c: $(srcdir)/zend_ini_parser.y
@$(YACC) -p ini_ -v -d $(srcdir)/zend_ini_parser.y -o $@
$(srcdir)/zend_ini_scanner.c: $(srcdir)/zend_ini_scanner.l
@(cd $(top_srcdir); $(RE2C) $(RE2C_FLAGS) --no-generation-date --case-inverted -cbdFt Zend/zend_ini_scanner_defs.h -oZend/zend_ini_scanner.c Zend/zend_ini_scanner.l)
$(builddir)/zend_highlight.lo $(builddir)/zend_compile.lo: $(srcdir)/zend_language_parser.h

View file

@ -16,7 +16,6 @@ PREPARING YOUR SYSTEM
tools:
GNU autoconf
GNU automake
GNU libtool
GNU m4

View file

@ -16,7 +16,7 @@ PHP Build System V5 Overview
build-modules: builds and copies dynamic modules into modules/
install-cli: installs the CLI only, so that the install-sapi
target does only what its name says
- finally abandoned automake (still requires aclocal at this time)
- finally abandoned automake
- changed some configure-time constructs to run at buildconf-time
- upgraded shtool to 1.5.4
- removed $(moduledir) (use EXTENSION_DIR)

View file

@ -1 +1,24 @@
#
# Zend
#
$(builddir)/zend_language_scanner.lo: $(srcdir)/zend_language_parser.h
$(builddir)/zend_ini_scanner.lo: $(srcdir)/zend_ini_parser.h
$(srcdir)/zend_language_scanner.c: $(srcdir)/zend_language_scanner.l
@(cd $(top_srcdir); $(RE2C) $(RE2C_FLAGS) --no-generation-date --case-inverted -cbdFt Zend/zend_language_scanner_defs.h -oZend/zend_language_scanner.c Zend/zend_language_scanner.l)
$(srcdir)/zend_language_parser.h: $(srcdir)/zend_language_parser.c
$(srcdir)/zend_language_parser.c: $(srcdir)/zend_language_parser.y
@$(YACC) -p zend -v -d $(srcdir)/zend_language_parser.y -o $@
$(srcdir)/zend_ini_parser.h: $(srcdir)/zend_ini_parser.c
$(srcdir)/zend_ini_parser.c: $(srcdir)/zend_ini_parser.y
@$(YACC) -p ini_ -v -d $(srcdir)/zend_ini_parser.y -o $@
$(srcdir)/zend_ini_scanner.c: $(srcdir)/zend_ini_scanner.l
@(cd $(top_srcdir); $(RE2C) $(RE2C_FLAGS) --no-generation-date --case-inverted -cbdFt Zend/zend_ini_scanner_defs.h -oZend/zend_ini_scanner.c Zend/zend_ini_scanner.l)
$(builddir)/zend_highlight.lo $(builddir)/zend_compile.lo: $(srcdir)/zend_language_parser.h
Zend/zend_execute.lo: $(srcdir)/zend_vm_execute.h $(srcdir)/zend_vm_opcodes.h

View file

@ -50,10 +50,18 @@ int zend_sprintf(char *buffer, const char *format, ...);
# define zend_sprintf sprintf
#endif
#if defined(__cplusplus) && __cplusplus >= 201103L
extern "C++" {
#include <cmath>
#define zend_isnan std::isnan
#define zend_isinf std::isinf
#define zend_finite std::isfinite
}
#else
#include <math.h>
#ifndef zend_isnan
#if HAVE_DECL_ISNAN && (!defined(__cplusplus) || __cplusplus < 201103L)
#if HAVE_DECL_ISNAN
#define zend_isnan(a) isnan(a)
#elif defined(HAVE_FPCLASS)
#define zend_isnan(a) ((fpclass(a) == FP_SNAN) || (fpclass(a) == FP_QNAN))
@ -62,7 +70,7 @@ int zend_sprintf(char *buffer, const char *format, ...);
#endif
#endif
#if HAVE_DECL_ISINF && (!defined(__cplusplus) || __cplusplus < 201103L)
#if HAVE_DECL_ISINF
#define zend_isinf(a) isinf(a)
#elif defined(INFINITY)
/* Might not work, but is required by ISO C99 */
@ -73,7 +81,7 @@ int zend_sprintf(char *buffer, const char *format, ...);
#define zend_isinf(a) 0
#endif
#if HAVE_DECL_ISFINITE && (!defined(__cplusplus) || __cplusplus < 201103L)
#if HAVE_DECL_ISFINITE
#define zend_finite(a) isfinite(a)
#elif defined(HAVE_FINITE)
#define zend_finite(a) finite(a)
@ -83,6 +91,8 @@ int zend_sprintf(char *buffer, const char *format, ...);
#define zend_finite(a) (zend_isnan(a) ? 0 : zend_isinf(a) ? 0 : 1)
#endif
#endif
#endif /* ifndef ZEND_ACCONFIG_H_NO_C_PROTOS */
])

View file

@ -0,0 +1,29 @@
--TEST--
Dynamic property shadowed by private property
--FILE--
<?php
class Test {
private $prop = "Test";
function run() {
foreach ($this as $k => $v) {
echo "$k => $v\n";
}
var_dump(get_object_vars($this));
}
}
class Test2 extends Test {
}
$test2 = new Test2;
$test2->prop = "Test2";
$test2->run();
?>
--EXPECT--
prop => Test
array(1) {
["prop"]=>
string(4) "Test"
}

View file

@ -1189,7 +1189,7 @@ ZEND_API int zend_update_class_constants(zend_class_entry *class_type) /* {{{ */
}
/* }}} */
ZEND_API void object_properties_init(zend_object *object, zend_class_entry *class_type) /* {{{ */
static zend_always_inline void _object_properties_init(zend_object *object, zend_class_entry *class_type) /* {{{ */
{
if (class_type->default_properties_count) {
zval *src = class_type->default_properties_table;
@ -1209,11 +1209,17 @@ ZEND_API void object_properties_init(zend_object *object, zend_class_entry *clas
dst++;
} while (src != end);
}
object->properties = NULL;
}
}
/* }}} */
ZEND_API void object_properties_init(zend_object *object, zend_class_entry *class_type) /* {{{ */
{
object->properties = NULL;
_object_properties_init(object, class_type);
}
/* }}} */
ZEND_API void object_properties_init_ex(zend_object *object, HashTable *properties) /* {{{ */
{
object->properties = properties;
@ -1298,7 +1304,7 @@ ZEND_API void object_properties_load(zend_object *object, HashTable *properties)
* class and all props being public. If only a subset is given or the class
* has protected members then you need to merge the properties separately by
* calling zend_merge_properties(). */
ZEND_API int object_and_properties_init(zval *arg, zend_class_entry *class_type, HashTable *properties) /* {{{ */
static zend_always_inline int _object_and_properties_init(zval *arg, zend_class_entry *class_type, HashTable *properties) /* {{{ */
{
if (UNEXPECTED(class_type->ce_flags & (ZEND_ACC_INTERFACE|ZEND_ACC_TRAIT|ZEND_ACC_IMPLICIT_ABSTRACT_CLASS|ZEND_ACC_EXPLICIT_ABSTRACT_CLASS))) {
if (class_type->ce_flags & ZEND_ACC_INTERFACE) {
@ -1322,11 +1328,13 @@ ZEND_API int object_and_properties_init(zval *arg, zend_class_entry *class_type,
}
if (class_type->create_object == NULL) {
ZVAL_OBJ(arg, zend_objects_new(class_type));
zend_object *obj = zend_objects_new(class_type);
ZVAL_OBJ(arg, obj);
if (properties) {
object_properties_init_ex(Z_OBJ_P(arg), properties);
object_properties_init_ex(obj, properties);
} else {
object_properties_init(Z_OBJ_P(arg), class_type);
_object_properties_init(obj, class_type);
}
} else {
ZVAL_OBJ(arg, class_type->create_object(class_type));
@ -1335,9 +1343,15 @@ ZEND_API int object_and_properties_init(zval *arg, zend_class_entry *class_type,
}
/* }}} */
ZEND_API int object_and_properties_init(zval *arg, zend_class_entry *class_type, HashTable *properties) /* {{{ */
{
return _object_and_properties_init(arg, class_type, properties);
}
/* }}} */
ZEND_API int object_init_ex(zval *arg, zend_class_entry *class_type) /* {{{ */
{
return object_and_properties_init(arg, class_type, 0);
return _object_and_properties_init(arg, class_type, NULL);
}
/* }}} */

View file

@ -1191,18 +1191,18 @@ ZEND_FUNCTION(get_object_vars)
array_init_size(return_value, zend_hash_num_elements(properties));
ZEND_HASH_FOREACH_KEY_VAL(properties, num_key, key, value) {
zend_bool unmangle = 0;
zend_bool is_dynamic = 1;
if (Z_TYPE_P(value) == IS_INDIRECT) {
value = Z_INDIRECT_P(value);
if (UNEXPECTED(Z_ISUNDEF_P(value))) {
continue;
}
ZEND_ASSERT(key);
if (zend_check_property_access(zobj, key) == FAILURE) {
continue;
}
unmangle = 1;
is_dynamic = 0;
}
if (key && zend_check_property_access(zobj, key, is_dynamic) == FAILURE) {
continue;
}
if (Z_ISREF_P(value) && Z_REFCOUNT_P(value) == 1) {
@ -1213,7 +1213,7 @@ ZEND_FUNCTION(get_object_vars)
if (UNEXPECTED(!key)) {
/* This case is only possible due to loopholes, e.g. ArrayObject */
zend_hash_index_add(Z_ARRVAL_P(return_value), num_key, value);
} else if (unmangle && ZSTR_VAL(key)[0] == 0) {
} else if (!is_dynamic && ZSTR_VAL(key)[0] == 0) {
const char *prop_name, *class_name;
size_t prop_len;
zend_unmangle_property_name_ex(key, &class_name, &prop_name, &prop_len);

View file

@ -50,9 +50,18 @@ typedef unsigned int uint;
#endif
#define strcasecmp(s1, s2) _stricmp(s1, s2)
#define strncasecmp(s1, s2, n) _strnicmp(s1, s2, n)
#if defined(__cplusplus) && __cplusplus >= 201103L
extern "C++" {
#include <cmath>
#define zend_isnan std::isnan
#define zend_isinf std::isinf
#define zend_finite std::isfinite
}
#else
#define zend_isinf(a) ((_fpclass(a) == _FPCLASS_PINF) || (_fpclass(a) == _FPCLASS_NINF))
#define zend_finite(x) _finite(x)
#define zend_isnan(x) _isnan(x)
#endif
#define zend_sprintf sprintf

View file

@ -525,7 +525,7 @@ found:
}
/* }}} */
ZEND_API int zend_check_property_access(zend_object *zobj, zend_string *prop_info_name) /* {{{ */
ZEND_API int zend_check_property_access(zend_object *zobj, zend_string *prop_info_name, zend_bool is_dynamic) /* {{{ */
{
zend_property_info *property_info;
const char *class_name = NULL;
@ -534,19 +534,18 @@ ZEND_API int zend_check_property_access(zend_object *zobj, zend_string *prop_inf
size_t prop_name_len;
if (ZSTR_VAL(prop_info_name)[0] == 0) {
if (is_dynamic) {
return SUCCESS;
}
zend_unmangle_property_name_ex(prop_info_name, &class_name, &prop_name, &prop_name_len);
member = zend_string_init(prop_name, prop_name_len, 0);
property_info = zend_get_property_info(zobj->ce, member, 1);
zend_string_release_ex(member, 0);
if (property_info == NULL) {
if (class_name[0] != '*') {
/* we we're looking for a private prop */
return FAILURE;
}
return SUCCESS;
} else if (property_info == ZEND_WRONG_PROPERTY_INFO) {
if (property_info == NULL || property_info == ZEND_WRONG_PROPERTY_INFO) {
return FAILURE;
}
if (class_name[0] != '*') {
if (!(property_info->flags & ZEND_ACC_PRIVATE)) {
/* we we're looking for a private prop but found a non private one of the same name */
@ -562,6 +561,7 @@ ZEND_API int zend_check_property_access(zend_object *zobj, zend_string *prop_inf
} else {
property_info = zend_get_property_info(zobj->ce, prop_info_name, 1);
if (property_info == NULL) {
ZEND_ASSERT(is_dynamic);
return SUCCESS;
} else if (property_info == ZEND_WRONG_PROPERTY_INFO) {
return FAILURE;

View file

@ -224,7 +224,7 @@ ZEND_API void rebuild_object_properties(zend_object *zobj);
ZEND_API int zend_check_protected(zend_class_entry *ce, zend_class_entry *scope);
ZEND_API int zend_check_property_access(zend_object *zobj, zend_string *prop_info_name);
ZEND_API int zend_check_property_access(zend_object *zobj, zend_string *prop_info_name, zend_bool is_dynamic);
ZEND_API zend_function *zend_get_call_trampoline_func(zend_class_entry *ce, zend_string *method_name, int is_static);

View file

@ -25,7 +25,7 @@
#include "zend_interfaces.h"
#include "zend_exceptions.h"
ZEND_API void ZEND_FASTCALL zend_object_std_init(zend_object *object, zend_class_entry *ce)
static zend_always_inline void _zend_object_std_init(zend_object *object, zend_class_entry *ce)
{
GC_SET_REFCOUNT(object, 1);
GC_TYPE_INFO(object) = IS_OBJECT | (GC_COLLECTABLE << GC_FLAGS_SHIFT);
@ -37,6 +37,11 @@ ZEND_API void ZEND_FASTCALL zend_object_std_init(zend_object *object, zend_class
}
}
ZEND_API void ZEND_FASTCALL zend_object_std_init(zend_object *object, zend_class_entry *ce)
{
_zend_object_std_init(object, ce);
}
ZEND_API void zend_object_std_dtor(zend_object *object)
{
zval *p, *end;
@ -174,7 +179,7 @@ ZEND_API zend_object* ZEND_FASTCALL zend_objects_new(zend_class_entry *ce)
{
zend_object *object = emalloc(sizeof(zend_object) + zend_object_properties_size(ce));
zend_object_std_init(object, ce);
_zend_object_std_init(object, ce);
object->handlers = &std_object_handlers;
return object;
}

View file

@ -780,10 +780,20 @@ ZEND_VM_COLD_HELPER(zend_abstract_method_helper, ANY, ANY, zend_function *fbc)
HANDLE_EXCEPTION();
}
ZEND_VM_COLD_HELPER(zend_undefined_function_helper, ANY, ANY, zval *function_name)
ZEND_VM_COLD_HELPER(zend_undefined_function_helper, ANY, ANY)
{
USE_OPLINE
zval *function_name;
char *name;
SAVE_OPLINE();
zend_throw_error(NULL, "Call to undefined function %s()", Z_STRVAL_P(function_name));
function_name = RT_CONSTANT(opline, opline->op2);
if (opline->opcode == ZEND_INIT_NS_FCALL_BY_NAME) {
name = Z_STRVAL_P(function_name + 2);
} else {
name = Z_STRVAL_P(function_name);
}
zend_throw_error(NULL, "Call to undefined function %s()", name);
HANDLE_EXCEPTION();
}
@ -3263,7 +3273,7 @@ ZEND_VM_HOT_HANDLER(59, ZEND_INIT_FCALL_BY_NAME, ANY, CONST, NUM|CACHE_SLOT)
function_name = (zval*)RT_CONSTANT(opline, opline->op2);
func = zend_hash_find_ex(EG(function_table), Z_STR_P(function_name+1), 1);
if (UNEXPECTED(func == NULL)) {
ZEND_VM_DISPATCH_TO_HELPER(zend_undefined_function_helper, function_name, function_name);
ZEND_VM_DISPATCH_TO_HELPER(zend_undefined_function_helper);
}
fbc = Z_FUNC_P(func);
if (EXPECTED(fbc->type == ZEND_USER_FUNCTION) && UNEXPECTED(!RUN_TIME_CACHE(&fbc->op_array))) {
@ -3426,7 +3436,7 @@ ZEND_VM_HOT_HANDLER(69, ZEND_INIT_NS_FCALL_BY_NAME, ANY, CONST, NUM|CACHE_SLOT)
func_name++;
func = zend_hash_find_ex(EG(function_table), Z_STR_P(func_name), 1);
if (UNEXPECTED(func == NULL)) {
ZEND_VM_DISPATCH_TO_HELPER(zend_undefined_function_helper, function_name, func_name);
ZEND_VM_DISPATCH_TO_HELPER(zend_undefined_function_helper);
}
}
fbc = Z_FUNC_P(func);
@ -3447,7 +3457,6 @@ ZEND_VM_HOT_HANDLER(69, ZEND_INIT_NS_FCALL_BY_NAME, ANY, CONST, NUM|CACHE_SLOT)
ZEND_VM_HOT_HANDLER(61, ZEND_INIT_FCALL, NUM, CONST, NUM|CACHE_SLOT)
{
USE_OPLINE
zend_free_op free_op2;
zval *fname;
zval *func;
zend_function *fbc;
@ -3455,10 +3464,10 @@ ZEND_VM_HOT_HANDLER(61, ZEND_INIT_FCALL, NUM, CONST, NUM|CACHE_SLOT)
fbc = CACHED_PTR(opline->result.num);
if (UNEXPECTED(fbc == NULL)) {
fname = GET_OP2_ZVAL_PTR(BP_VAR_R);
fname = (zval*)RT_CONSTANT(opline, opline->op2);
func = zend_hash_find_ex(EG(function_table), Z_STR_P(fname), 1);
if (UNEXPECTED(func == NULL)) {
ZEND_VM_DISPATCH_TO_HELPER(zend_undefined_function_helper, function_name, fname);
ZEND_VM_DISPATCH_TO_HELPER(zend_undefined_function_helper);
}
fbc = Z_FUNC_P(func);
if (EXPECTED(fbc->type == ZEND_USER_FUNCTION) && UNEXPECTED(!RUN_TIME_CACHE(&fbc->op_array))) {
@ -5845,10 +5854,12 @@ ZEND_VM_C_LABEL(fe_fetch_r_exit):
value = Z_INDIRECT_P(value);
value_type = Z_TYPE_INFO_P(value);
if (EXPECTED(value_type != IS_UNDEF)
&& EXPECTED(zend_check_property_access(Z_OBJ_P(array), p->key) == SUCCESS)) {
&& EXPECTED(zend_check_property_access(Z_OBJ_P(array), p->key, 0) == SUCCESS)) {
break;
}
} else {
} else if (EXPECTED(Z_OBJCE_P(array)->default_properties_count == 0)
|| !p->key
|| zend_check_property_access(Z_OBJ_P(array), p->key, 1) == SUCCESS) {
break;
}
}
@ -5995,10 +6006,12 @@ ZEND_VM_HANDLER(126, ZEND_FE_FETCH_RW, VAR, ANY, JMP_ADDR)
value = Z_INDIRECT_P(value);
value_type = Z_TYPE_INFO_P(value);
if (EXPECTED(value_type != IS_UNDEF)
&& EXPECTED(zend_check_property_access(Z_OBJ_P(array), p->key) == SUCCESS)) {
&& EXPECTED(zend_check_property_access(Z_OBJ_P(array), p->key, 0) == SUCCESS)) {
break;
}
} else {
} else if (EXPECTED(Z_OBJCE_P(array)->default_properties_count == 0)
|| !p->key
|| zend_check_property_access(Z_OBJ_P(array), p->key, 1) == SUCCESS) {
break;
}
}

View file

@ -470,10 +470,20 @@ static zend_never_inline ZEND_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_ab
HANDLE_EXCEPTION();
}
static zend_never_inline ZEND_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_undefined_function_helper_SPEC(zval *function_name ZEND_OPCODE_HANDLER_ARGS_DC)
static zend_never_inline ZEND_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_undefined_function_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS)
{
USE_OPLINE
zval *function_name;
char *name;
SAVE_OPLINE();
zend_throw_error(NULL, "Call to undefined function %s()", Z_STRVAL_P(function_name));
function_name = RT_CONSTANT(opline, opline->op2);
if (opline->opcode == ZEND_INIT_NS_FCALL_BY_NAME) {
name = Z_STRVAL_P(function_name + 2);
} else {
name = Z_STRVAL_P(function_name);
}
zend_throw_error(NULL, "Call to undefined function %s()", name);
HANDLE_EXCEPTION();
}
@ -2023,7 +2033,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME
function_name = (zval*)RT_CONSTANT(opline, opline->op2);
func = zend_hash_find_ex(EG(function_table), Z_STR_P(function_name+1), 1);
if (UNEXPECTED(func == NULL)) {
ZEND_VM_TAIL_CALL(zend_undefined_function_helper_SPEC(function_name ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
ZEND_VM_TAIL_CALL(zend_undefined_function_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
}
fbc = Z_FUNC_P(func);
if (EXPECTED(fbc->type == ZEND_USER_FUNCTION) && UNEXPECTED(!RUN_TIME_CACHE(&fbc->op_array))) {
@ -2111,7 +2121,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_NS_FCALL_BY_N
func_name++;
func = zend_hash_find_ex(EG(function_table), Z_STR_P(func_name), 1);
if (UNEXPECTED(func == NULL)) {
ZEND_VM_TAIL_CALL(zend_undefined_function_helper_SPEC(func_name ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
ZEND_VM_TAIL_CALL(zend_undefined_function_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
}
}
fbc = Z_FUNC_P(func);
@ -2132,7 +2142,6 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_NS_FCALL_BY_N
static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_FCALL_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
USE_OPLINE
zval *fname;
zval *func;
zend_function *fbc;
@ -2140,10 +2149,10 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_FCALL_SPEC_CO
fbc = CACHED_PTR(opline->result.num);
if (UNEXPECTED(fbc == NULL)) {
fname = RT_CONSTANT(opline, opline->op2);
fname = (zval*)RT_CONSTANT(opline, opline->op2);
func = zend_hash_find_ex(EG(function_table), Z_STR_P(fname), 1);
if (UNEXPECTED(func == NULL)) {
ZEND_VM_TAIL_CALL(zend_undefined_function_helper_SPEC(fname ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
ZEND_VM_TAIL_CALL(zend_undefined_function_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
}
fbc = Z_FUNC_P(func);
if (EXPECTED(fbc->type == ZEND_USER_FUNCTION) && UNEXPECTED(!RUN_TIME_CACHE(&fbc->op_array))) {
@ -21258,10 +21267,12 @@ fe_fetch_r_exit:
value = Z_INDIRECT_P(value);
value_type = Z_TYPE_INFO_P(value);
if (EXPECTED(value_type != IS_UNDEF)
&& EXPECTED(zend_check_property_access(Z_OBJ_P(array), p->key) == SUCCESS)) {
&& EXPECTED(zend_check_property_access(Z_OBJ_P(array), p->key, 0) == SUCCESS)) {
break;
}
} else {
} else if (EXPECTED(Z_OBJCE_P(array)->default_properties_count == 0)
|| !p->key
|| zend_check_property_access(Z_OBJ_P(array), p->key, 1) == SUCCESS) {
break;
}
}
@ -21408,10 +21419,12 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_FETCH_RW_SPEC_VAR_HANDLER(Z
value = Z_INDIRECT_P(value);
value_type = Z_TYPE_INFO_P(value);
if (EXPECTED(value_type != IS_UNDEF)
&& EXPECTED(zend_check_property_access(Z_OBJ_P(array), p->key) == SUCCESS)) {
&& EXPECTED(zend_check_property_access(Z_OBJ_P(array), p->key, 0) == SUCCESS)) {
break;
}
} else {
} else if (EXPECTED(Z_OBJCE_P(array)->default_properties_count == 0)
|| !p->key
|| zend_check_property_access(Z_OBJ_P(array), p->key, 1) == SUCCESS) {
break;
}
}

View file

@ -28,16 +28,16 @@ fi
# autoconf 2.68 or newer
ac_version=`$PHP_AUTOCONF --version 2>/dev/null|head -n 1|sed -e 's/^[^0-9]*//' -e 's/[a-z]* *$//'`
if test -z "$ac_version"; then
echo "buildconf: autoconf not found."
echo " You need autoconf version 2.68 or newer installed"
echo " to build PHP from Git."
echo "buildconf: autoconf not found." >&2
echo " You need autoconf version 2.68 or newer installed" >&2
echo " to build PHP from Git." >&2
exit 1
fi
IFS=.; set $ac_version; IFS=' '
if test "$1" = "2" -a "$2" -lt "68" || test "$1" -lt "2"; then
echo "buildconf: autoconf version $ac_version found."
echo " You need autoconf version 2.68 or newer installed"
echo " to build PHP from Git."
echo "buildconf: autoconf version $ac_version found." >&2
echo " You need autoconf version 2.68 or newer installed" >&2
echo " to build PHP from Git." >&2
exit 1
else
echo "buildconf: autoconf version $ac_version (ok)"

View file

@ -12,7 +12,7 @@ awk=$1
shift
if test -z "$infile" || test -z "$srcdir"; then
echo "please supply infile and srcdir"
echo "please supply infile and srcdir" >&2
exit 1
fi

View file

@ -1,73 +0,0 @@
# +----------------------------------------------------------------------+
# | PHP Version 7 |
# +----------------------------------------------------------------------+
# | Copyright (c) 2000-2006 The PHP Group |
# +----------------------------------------------------------------------+
# | This source file is subject to version 3.01 of the PHP license, |
# | that is bundled with this package in the file LICENSE, and is |
# | available through the world-wide-web at the following url: |
# | http://www.php.net/license/3_01.txt |
# | If you did not receive a copy of the PHP license and are unable to |
# | obtain it through the world-wide-web, please send a note to |
# | license@php.net so we can mail you a copy immediately. |
# +----------------------------------------------------------------------+
# | Author: Sascha Schumann <sascha@schumann.cx> |
# +----------------------------------------------------------------------+
#
# Usage:
#
# echo top_srcdir top_builddir srcdir CPP [CPP-ARGS] filenames | \
# awk -f mkdep.awk > dependencies
{
top_srcdir=$1
top_builddir=$2
srcdir=$3
cmd=$4
for (i = 5; i <= NF; i++) {
if (match($i, "^-[A-Z]") == 0)
break;
cmd=cmd " " $i
}
dif=i-1
for (; i <= NF; i++)
filenames[i-dif]=$i
no_files=NF-dif
for(i = 1; i <= no_files; i++) {
if (system("test -r " filenames[i]) != 0)
continue
target=filenames[i]
sub(srcdir "/", "", target)
target2=target
sub("\.(c|cpp)$", ".lo", target);
sub("\.(c|cpp)$", ".slo", target2);
for (e in used)
delete used[e]
cmdx=cmd " " filenames[i]
done=0
while ((cmdx | getline) > 0) {
if (match($0, "^# [0-9]* \".*\.h\"") != 0) {
if (sub(top_srcdir, "$(top_srcdir)", $3) == 0)
sub(top_builddir, "$(top_builddir)", $3)
if (substr($3,2,1) != "/" && used[$3] != 1) {
if (done == 0)
printf(target " " target2 ":")
done=1
printf(" \\\n\t" substr($3,2,length($3)-2))
used[$3] = 1;
}
}
}
if (done == 1)
print "\n"
}
}

View file

@ -27,8 +27,8 @@ while test $# -gt 0; do
done
if test "$dev" = "0" -a "$devok" = "0"; then
echo "You should not run buildconf in a release package."
echo "use buildconf --force to override this check."
echo "You should not run buildconf in a release package." >&2
echo "use buildconf --force to override this check." >&2
exit 1
fi

View file

@ -5,7 +5,7 @@ dnl include Zend specific macro definitions first
dnl -------------------------------------------------------------------------
sinclude(Zend/acinclude.m4)
dnl Basic autoconf + automake initialization, generation of config.nice.
dnl Basic autoconf initialization, generation of config.nice.
dnl -------------------------------------------------------------------------
AC_PREREQ([2.68])
@ -59,10 +59,18 @@ int zend_sprintf(char *buffer, const char *format, ...);
# define zend_sprintf sprintf
#endif
#if defined(__cplusplus) && __cplusplus >= 201103L
extern "C++" {
#include <cmath>
#define zend_isnan std::isnan
#define zend_isinf std::isinf
#define zend_finite std::isfinite
}
#else
#include <math.h>
#ifndef zend_isnan
#if HAVE_DECL_ISNAN && (!defined(__cplusplus) || __cplusplus < 201103L)
#if HAVE_DECL_ISNAN
#define zend_isnan(a) isnan(a)
#elif defined(HAVE_FPCLASS)
#define zend_isnan(a) ((fpclass(a) == FP_SNAN) || (fpclass(a) == FP_QNAN))
@ -71,7 +79,7 @@ int zend_sprintf(char *buffer, const char *format, ...);
#endif
#endif
#if HAVE_DECL_ISINF && (!defined(__cplusplus) || __cplusplus < 201103L)
#if HAVE_DECL_ISINF
#define zend_isinf(a) isinf(a)
#elif defined(INFINITY)
/* Might not work, but is required by ISO C99 */
@ -82,7 +90,7 @@ int zend_sprintf(char *buffer, const char *format, ...);
#define zend_isinf(a) 0
#endif
#if HAVE_DECL_ISFINITE && (!defined(__cplusplus) || __cplusplus < 201103L)
#if HAVE_DECL_ISFINITE
#define zend_finite(a) isfinite(a)
#elif defined(HAVE_FINITE)
#define zend_finite(a) finite(a)
@ -92,6 +100,7 @@ int zend_sprintf(char *buffer, const char *format, ...);
#define zend_finite(a) (zend_isnan(a) ? 0 : zend_isinf(a) ? 0 : 1)
#endif
#endif
#endif /* ifndef ZEND_ACCONFIG_H_NO_C_PROTOS */
#undef PTHREADS
@ -1429,7 +1438,7 @@ case $host_alias in
esac
dnl Silence warning: `ar: 'u' modifier ignored since 'D' is the default`
dnl SEE https://www.mail-archive.com/automake-patches@gnu.org/msg07705.html
dnl See https://github.com/php/php-src/pull/3017
AC_SUBST(AR_FLAGS, [cr])
dnl Only allow AC_PROG_CXX and AC_PROG_CXXCPP if they are explicitly called (by PHP_REQUIRE_CXX).
@ -1526,7 +1535,6 @@ PHP_ADD_BUILD_DIR(TSRM)
PHP_ADD_BUILD_DIR(Zend)
PHP_ADD_MAKEFILE_FRAGMENT($abs_srcdir/scripts/Makefile.frag,$abs_srcdir/scripts,scripts)
PHP_ADD_MAKEFILE_FRAGMENT($abs_srcdir/Makefile.frag,$abs_srcdir/Zend,Zend)
PHP_ADD_MAKEFILE_FRAGMENT($abs_srcdir/Zend/Makefile.frag,$abs_srcdir/Zend,Zend)
PHP_GEN_BUILD_DIRS

View file

@ -11,7 +11,7 @@ include 'server.inc';
$host = curl_cli_server_start();
$ch = curl_init();
curl_setopt($ch, CURLOPT_SAFE_UPLOAD, 1);
curl_setopt($ch, CURLOPT_URL, "{$host}/get.php?test=file");
curl_setopt($ch, CURLOPT_URL, "{$host}/get.inc?test=file");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$file = curl_file_create(__DIR__ . '/curl_testdata1.txt');

View file

@ -19,7 +19,7 @@ $host = curl_cli_server_start();
if(!empty($host)) {
// Use the set Environment variable
$url = "$host/get.php?test=1";
$url = "$host/get.inc?test=1";
} else {

View file

@ -13,7 +13,7 @@ if ($curl_version['version_number'] > 0x070a08) {
include 'server.inc';
$host = curl_cli_server_start();
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "{$host}/get.php");
curl_setopt($ch, CURLOPT_URL, "{$host}/get.inc");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
var_dump(curl_getinfo($ch, CURLINFO_HTTP_CODE) == curl_getinfo($ch, CURLINFO_RESPONSE_CODE));

View file

@ -18,7 +18,7 @@ include 'skipif.inc';
// start testing
echo '*** Testing curl sending through GET an POST ***' . "\n";
$url = "{$host}/get.php?test=getpost&get_param=Hello%20World";
$url = "{$host}/get.inc?test=getpost&get_param=Hello%20World";
$ch = curl_init();
ob_start(); // start output buffering

View file

@ -7,7 +7,7 @@ Bug #66109 (Option CURLOPT_CUSTOMREQUEST can't be reset to default.)
include 'server.inc';
$host = curl_cli_server_start();
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "{$host}/get.php?test=method");
curl_setopt($ch, CURLOPT_URL, "{$host}/get.inc?test=method");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE');

View file

@ -10,7 +10,7 @@ include 'skipif.inc';
include 'server.inc';
$host = curl_cli_server_start();
$url = "{$host}/get.php";
$url = "{$host}/get.inc";
$ch = curl_init($url);
curl_setopt_array($ch, array(

View file

@ -9,7 +9,7 @@ include 'skipif.inc';
include 'server.inc';
$host = curl_cli_server_start();
$url = "{$host}/get.php";
$url = "{$host}/get.inc";
$ch = curl_init($url);
curl_setopt_array($ch, array(

View file

@ -19,7 +19,7 @@ Bug #69316: Use-after-free in php_curl related to CURLOPT_FILE/_INFILE/_WRITEHEA
include 'server.inc';
$host = curl_cli_server_start();
$temp_file = dirname(__FILE__) . '/body.tmp';
$url = "{$host}/get.php?test=getpost";
$url = "{$host}/get.inc?test=getpost";
$ch = curl_init();
$f_file = fopen($temp_file, "w") or die("failed to open file\n");
curl_setopt($ch, CURLOPT_BUFFERSIZE, 10);

View file

@ -11,7 +11,7 @@ Mattijs Hoitink mattijshoitink@gmail.com
include 'server.inc';
$host = curl_cli_server_start();
// The URL to POST to
$url = $host . '/get.php?test=post';
$url = $host . '/get.inc?test=post';
// Create a temporary file to read the data from
$tempname = tempnam(sys_get_temp_dir(), 'CURL_DATA');

View file

@ -18,7 +18,7 @@ TestFest 2009 - AFUP - Jean-Marc Fontaine <jmf@durcommefaire.net>
// start testing
echo "*** Testing curl_exec() : basic functionality ***\n";
$url = "{$host}/get.php?test=get";
$url = "{$host}/get.inc?test=get";
$ch = curl_init();
ob_start(); // start output buffering

View file

@ -19,7 +19,7 @@ TestFest 2009 - AFUP - Jean-Marc Fontaine <jmf@durcommefaire.net>
// start testing
echo '*** Testing curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); ***' . "\n";
$url = "{$host}/get.php?test=get";
$url = "{$host}/get.inc?test=get";
$ch = curl_init();
ob_start(); // start output buffering

View file

@ -19,7 +19,7 @@ TestFest 2009 - AFUP - Jean-Marc Fontaine <jmf@durcommefaire.net>
// start testing
echo '*** Testing curl sending through GET an POST ***' . "\n";
$url = "{$host}/get.php?test=getpost&get_param=Hello%20World";
$url = "{$host}/get.inc?test=getpost&get_param=Hello%20World";
$ch = curl_init();
ob_start(); // start output buffering

View file

@ -19,7 +19,7 @@ TestFest 2009 - AFUP - Jean-Marc Fontaine <jmf@durcommefaire.net>
// start testing
echo '*** Testing curl setting referer ***' . "\n";
$url = "{$host}/get.php?test=referer";
$url = "{$host}/get.inc?test=referer";
$ch = curl_init();
ob_start(); // start output buffering

View file

@ -19,7 +19,7 @@ TestFest 2009 - AFUP - Jean-Marc Fontaine <jmf@durcommefaire.net>
// start testing
echo '*** Testing curl with user agent ***' . "\n";
$url = "{$host}/get.php?test=useragent";
$url = "{$host}/get.inc?test=useragent";
$ch = curl_init();
ob_start(); // start output buffering

View file

@ -19,7 +19,7 @@ TestFest 2009 - AFUP - Jean-Marc Fontaine <jmf@durcommefaire.net>
// start testing
echo '*** Testing curl_setopt($ch, CURLOPT_WRITEFUNCTION, <closure>); ***' . "\n";
$url = "{$host}/get.php?test=get";
$url = "{$host}/get.inc?test=get";
$ch = curl_init();
$alldata = '';
ob_start(); // start output buffering

View file

@ -18,7 +18,7 @@ TestFest 2009 - AFUP - Xavier Gorse <xgorse@elao.com>
// start testing
echo '*** Testing curl with cookie ***' . "\n";
$url = "{$host}/get.php?test=cookie";
$url = "{$host}/get.inc?test=cookie";
$ch = curl_init();
ob_start(); // start output buffering

View file

@ -18,7 +18,7 @@ TestFest 2009 - AFUP - Xavier Gorse <xgorse@elao.com>
// start testing
echo '*** Testing curl with HTTP/1.0 ***' . "\n";
$url = "{$host}/get.php?test=httpversion";
$url = "{$host}/get.inc?test=httpversion";
$ch = curl_init();
ob_start(); // start output buffering

View file

@ -18,7 +18,7 @@ TestFest 2009 - AFUP - Xavier Gorse <xgorse@elao.com>
// start testing
echo '*** Testing curl with HTTP/1.1 ***' . "\n";
$url = "{$host}/get.php?test=httpversion";
$url = "{$host}/get.inc?test=httpversion";
$ch = curl_init();
ob_start(); // start output buffering

View file

@ -18,7 +18,7 @@ TestFest 2009 - AFUP - Thomas Rabaix <thomas.rabaix@gmail.com>
// start testing
echo "*** Testing curl_exec() : basic functionality ***\n";
$url = "{$host}/get.php?test=get";
$url = "{$host}/get.inc?test=get";
$chs = array(
0 => curl_init(),
1 => curl_init(),

View file

@ -18,7 +18,7 @@ TestFest 2009 - AFUP - Thomas Rabaix <thomas.rabaix@gmail.com>
// start testing
echo "*** Testing curl_exec() : basic functionality ***\n";
$url = "{$host}/get.php?test=get";
$url = "{$host}/get.inc?test=get";
$chs = array(
0 => curl_init(),
1 => curl_init(),

View file

@ -9,7 +9,7 @@ Jean-Marc Fontaine <jmf@durcommefaire.net>
include 'server.inc';
$host = curl_cli_server_start();
$url = "http://{$host}/get.php?test=";
$url = "http://{$host}/get.inc?test=";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);

View file

@ -9,7 +9,7 @@ Jean-Marc Fontaine <jmf@durcommefaire.net>
include 'server.inc';
$host = curl_cli_server_start();
$url = "{$host}/get.php?test=";
$url = "{$host}/get.inc?test=";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_exec($ch);

View file

@ -8,7 +8,7 @@ Jean-Marc Fontaine <jmf@durcommefaire.net>
<?php
include 'server.inc';
$host = curl_cli_server_start();
$url = "{$host}/get.php?test=contenttype";
$url = "{$host}/get.inc?test=contenttype";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);

View file

@ -17,7 +17,7 @@ var_dump(0 === curl_getinfo($ch, CURLINFO_HTTP_VERSION));
$host = curl_cli_server_start();
$url = "{$host}/get.php?test=";
$url = "{$host}/get.inc?test=";
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_exec($ch);

View file

@ -15,7 +15,7 @@ include 'server.inc';
$ch = curl_init();
$host = curl_cli_server_start();
$url = "{$host}/get.php?test=";
$url = "{$host}/get.inc?test=";
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_exec($ch);

View file

@ -13,7 +13,7 @@ Rick Buitenman <rick@meritos.nl>
echo '*** Testing curl copy handle with simple GET ***' . "\n";
$url = "{$host}/get.php?test=getpost&get_param=Hello%20World";
$url = "{$host}/get.inc?test=getpost&get_param=Hello%20World";
$ch = curl_init();
ob_start(); // start output buffering

View file

@ -12,7 +12,7 @@ Rick Buitenman <rick@meritos.nl>
echo '*** Testing curl copy handle with simple POST ***' . "\n";
$url = "{$host}/get.php?test=getpost";
$url = "{$host}/get.inc?test=getpost";
$ch = curl_init();
ob_start(); // start output buffering

View file

@ -13,7 +13,7 @@ Rick Buitenman <rick@meritos.nl>
echo '*** Test curl_copy_handle() after exec() ***' . "\n";
$url = "{$host}/get.php?test=getpost&get_param=Hello%20World";
$url = "{$host}/get.inc?test=getpost&get_param=Hello%20World";
$ch = curl_init();
ob_start(); // start output buffering

View file

@ -13,7 +13,7 @@ Rick Buitenman <rick@meritos.nl>
echo '*** Test curl_copy_handle() after exec() with POST ***' . "\n";
$url = "{$host}/get.php?test=getpost";
$url = "{$host}/get.inc?test=getpost";
$ch = curl_init();
ob_start(); // start output buffering

View file

@ -13,7 +13,7 @@ Rick Buitenman <rick@meritos.nl>
echo '*** Testing curl copy handle with User Agent ***' . "\n";
$url = "{$host}/get.php?test=useragent";
$url = "{$host}/get.inc?test=useragent";
$ch = curl_init();
ob_start(); // start output buffering

View file

@ -9,7 +9,7 @@ Test curl_copy_handle() with simple POST
echo '*** Testing curl copy handle with simple POST using array as arguments ***' . "\n";
$url = "{$host}/get.php?test=getpost";
$url = "{$host}/get.inc?test=getpost";
$ch = curl_init();
ob_start(); // start output buffering

View file

@ -7,7 +7,7 @@ Test curl_copy_handle() with CURLOPT_PROGRESSFUNCTION
include 'server.inc';
$host = curl_cli_server_start();
$url = "{$host}/get.php";
$url = "{$host}/get.inc";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_NOPROGRESS, 0);

View file

@ -21,7 +21,7 @@ function testcurl($ch, $name, $mime = '', $postname = '')
include 'server.inc';
$host = curl_cli_server_start();
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "{$host}/get.php?test=file");
curl_setopt($ch, CURLOPT_URL, "{$host}/get.inc?test=file");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
testcurl($ch, __DIR__ . '/curl_testdata1.txt');
@ -52,7 +52,7 @@ $params = array('file' => '@' . __DIR__ . '/curl_testdata1.txt');
curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
var_dump(curl_exec($ch));
curl_setopt($ch, CURLOPT_URL, "{$host}/get.php?test=post");
curl_setopt($ch, CURLOPT_URL, "{$host}/get.inc?test=post");
$params = array('file' => '@' . __DIR__ . '/curl_testdata1.txt');
curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
var_dump(curl_exec($ch));

View file

@ -16,7 +16,7 @@ Rein Velt (rein@velt.org)
//SET URL AND OTHER OPTIONS
include 'server.inc';
$host = curl_cli_server_start();
curl_setopt($ch1, CURLOPT_URL, "{$host}/get.php?test=getpost&get_param=Hello%20World");
curl_setopt($ch1, CURLOPT_URL, "{$host}/get.inc?test=getpost&get_param=Hello%20World");
curl_setopt($ch2, CURLOPT_URL, "file://".dirname(__FILE__). DIRECTORY_SEPARATOR . "curl_testdata2.txt");
curl_setopt($ch1, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch2, CURLOPT_RETURNTRANSFER, true);

View file

@ -19,7 +19,7 @@ include 'server.inc';
$host = curl_cli_server_start();
if (!empty($host)) {
// Use the set Environment variable
$url = "{$host}/get.php?test=get";
$url = "{$host}/get.inc?test=get";
} else {
// Create a temporary file for the test
$tempname = tempnam(sys_get_temp_dir(), 'CURL_HANDLE');

View file

@ -11,7 +11,7 @@ function curl_cli_server_start() {
$php_executable = getenv('TEST_PHP_EXECUTABLE');
$doc_root = __DIR__;
$router = "responder/get.php";
$router = "responder/get.inc";
if (substr(PHP_OS, 0, 3) == 'WIN') {
$descriptorspec = array(

View file

@ -107,20 +107,20 @@ Locale is: de
Locale is: fr
'1234567.8912345\d+'
'1 234 567,891'
'1 234 567,89 XXX'
'123 456 789 ?%'
'1.+234.+567,891'
'1.+234.+567,89.+(XXX|¤)'
'123.+456.+789(.+)?%'
'1.2345678912345\d+E6'
'un million deux cent trente-quatre mille cinq cent soixante-sept virgule huit neuf un deux trois quatre cinq( six)? sept( neuf)?'
'1 234 567e'
'1 234 567'
'1.+234.+567e'
'1.+234.+567'
'#####.###'
'1 234 567,89 XXX'
'1.+234.+567,89.+XXX'
Locale is: en_UK
'1234567.8912345\d+'
'1,234,567.891'
'XXX 1,234,567.89'
'(¤|XXX )1,234,567.89'
'123,456,789%'
'1.2345678912345\d+E6'
'one million,? two hundred (and )?thirty-four thousand,? five hundred (and )?sixty-seven point eight nine one two three four five( six)? seven( nine)?'

View file

@ -35,7 +35,7 @@ foreach ($locale as $lc) {
?>
==DONE==
--EXPECT--
--EXPECTF--
de string key
string(8) "42-other"
string(11) "42,42-other"
@ -53,15 +53,15 @@ string(4) "five"
fr string key
string(8) "42-other"
string(11) "42,42-other"
string(22) "2 147 483 643-other"
string(26) "2 147 483 643,123-other"
string(%d) "2%s147%s483%s643-other"
string(%d) "2%s147%s483%s643,123-other"
string(4) "five"
fr numeric key
string(8) "42-other"
string(11) "42,42-other"
string(22) "2 147 483 643-other"
string(26) "2 147 483 643,123-other"
string(%d) "2%s147%s483%s643-other"
string(%d) "2%s147%s483%s643,123-other"
string(4) "five"
en string key

View file

@ -90,30 +90,28 @@ MBSTRING_API SAPI_TREAT_DATA_FUNC(mbstr_treat_data)
break;
}
if (arg == PARSE_POST) {
sapi_handle_post(&v_array);
return;
}
if (arg == PARSE_GET) { /* GET data */
c_var = SG(request_info).query_string;
if (c_var && *c_var) {
res = (char *) estrdup(c_var);
switch (arg) {
case PARSE_POST:
sapi_handle_post(&v_array);
return;
case PARSE_GET: /* GET data */
c_var = SG(request_info).query_string;
if (c_var && *c_var) {
res = (char *) estrdup(c_var);
free_buffer = 1;
}
break;
case PARSE_COOKIE: /* Cookie data */
c_var = SG(request_info).cookie_data;
if (c_var && *c_var) {
res = (char *) estrdup(c_var);
free_buffer = 1;
}
break;
case PARSE_STRING: /* String data */
res = str;
free_buffer = 1;
} else {
free_buffer = 0;
}
} else if (arg == PARSE_COOKIE) { /* Cookie data */
c_var = SG(request_info).cookie_data;
if (c_var && *c_var) {
res = (char *) estrdup(c_var);
free_buffer = 1;
} else {
free_buffer = 0;
}
} else if (arg == PARSE_STRING) { /* String data */
res = str;
free_buffer = 1;
break;
}
if (!res) {

View file

@ -1810,10 +1810,17 @@ MYSQLND_METHOD(mysqlnd_conn_data, set_client_option_2d)(MYSQLND_CONN_DATA * cons
DBG_INF_FMT("Adding [%s][%s]", key, value);
{
zval attrz;
zend_string *str = zend_string_init(key, strlen(key), 1);
GC_MAKE_PERSISTENT_LOCAL(str);
ZVAL_NEW_STR(&attrz, zend_string_init(value, strlen(value), conn->persistent));
GC_MAKE_PERSISTENT_LOCAL(Z_COUNTED(attrz));
zend_string *str;
if (conn->persistent) {
str = zend_string_init(key, strlen(key), 1);
GC_MAKE_PERSISTENT_LOCAL(str);
ZVAL_NEW_STR(&attrz, zend_string_init(value, strlen(value), 1));
GC_MAKE_PERSISTENT_LOCAL(Z_COUNTED(attrz));
} else {
str = zend_string_init(key, strlen(key), 0);
ZVAL_NEW_STR(&attrz, zend_string_init(value, strlen(value), 0));
}
zend_hash_update(conn->options->connect_attr, str, &attrz);
zend_string_release_ex(str, 1);
}

View file

@ -9,7 +9,7 @@ SCRIPT_NAME=/fatal_error_webphar.php
REQUEST_URI=/fatal_error_webphar.php/index.php
PATH_INFO=/index.php
--FILE_EXTERNAL--
files/pear2coverage.phar.php
files/pear2coverage.phar
--EXPECTHEADERS--
Content-type: text/html; charset=UTF-8
--EXPECTF--

View file

@ -296,8 +296,6 @@ static zend_bool soap_check_zval_ref(zval *data, xmlNodePtr node) {
if (node_ptr == node) {
return 0;
}
xmlNodeSetName(node, node_ptr->name);
xmlSetNs(node, node_ptr->ns);
if (SOAP_GLOBAL(soap_version) == SOAP_1_1) {
while (1) {
attr = get_attribute(attr, "id");

View file

@ -0,0 +1,50 @@
--TEST--
Bug #50675 SoapClient can't handle object references correctly.
--SKIPIF--
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
class TestSoapClient extends SoapClient {
function __doRequest($request, $location, $action, $version, $one_way = 0) {
return <<<EOF
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<soapenv:Fault>
<faultcode>soapenv:Server.userException</faultcode>
<faultstring>service.EchoServiceException</faultstring>
<detail>
<service.EchoServiceException xsi:type="ns1:EchoServiceException" xmlns:ns1="urn:service.EchoService">
<intParameter xsi:type="xsd:int">105</intParameter>
<parameter xsi:type="soapenc:string" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">string param</parameter>
</service.EchoServiceException>
<ns2:hostname xmlns:ns2="http://xml.apache.org/axis/">steckovic</ns2:hostname>
</detail>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>
EOF;
}
}
ini_set('soap.wsdl_cache_enabled', 0);
$parameters = [
'trace' => 1,
'exceptions' => 0,
];
$client = new TestSoapClient(dirname(__FILE__) . '/bug50675.wsdl', $parameters);
$person = new stdClass();
$person->name = 'name';
$result = $client->echoPerson($person, $person);
print($client->__getLastRequest());
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://service" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="urn:service.EchoService" xmlns:xsd="http://www.w3.org/2001/XMLSchema" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoPerson><p xsi:type="ns2:Person" id="ref1"><name xsi:type="SOAP-ENC:string">name</name></p><p2 href="#ref1"/></ns1:echoPerson></SOAP-ENV:Body></SOAP-ENV:Envelope>

View file

@ -0,0 +1,93 @@
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="http://212.24.157.117:8080/axis/services/echo" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://212.24.157.117:8080/axis/services/echo" xmlns:intf="http://212.24.157.117:8080/axis/services/echo" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns1="urn:service.EchoService" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<wsdl:types>
<schema targetNamespace="urn:service.EchoService" xmlns="http://www.w3.org/2001/XMLSchema">
<import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
<complexType name="EchoServiceException">
<sequence>
<element name="intParameter" type="xsd:int"/>
<element name="parameter" nillable="true" type="soapenc:string"/>
</sequence>
</complexType>
<complexType name="Person">
<sequence>
<element name="name" nillable="true" type="soapenc:string"/>
</sequence>
</complexType>
</schema>
</wsdl:types>
<wsdl:message name="EchoServiceException">
<wsdl:part name="EchoServiceException" type="tns1:EchoServiceException"/>
</wsdl:message>
<wsdl:message name="echoPersonResponse">
<wsdl:part name="echoPersonReturn" type="tns1:Person"/>
</wsdl:message>
<wsdl:message name="echoPersonRequest">
<wsdl:part name="p" type="tns1:Person"/>
<wsdl:part name="p2" type="tns1:Person"/>
</wsdl:message>
<wsdl:portType name="EchoService">
<wsdl:operation name="echoPerson" parameterOrder="p">
<wsdl:input message="impl:echoPersonRequest" name="echoPersonRequest"/>
<wsdl:output message="impl:echoPersonResponse" name="echoPersonResponse"/>
<wsdl:fault message="impl:EchoServiceException" name="EchoServiceException"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="echoSoapBinding" type="impl:EchoService">
<wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="echoPerson">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="echoPersonRequest">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://service" use="encoded"/>
</wsdl:input>
<wsdl:output name="echoPersonResponse">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://212.24.157.117:8080/axis/services/echo" use="encoded"/>
</wsdl:output>
<wsdl:fault name="EchoServiceException">
<wsdlsoap:fault encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" name="EchoServiceException" namespace="http://212.24.157.117:8080/axis/services/echo" use="encoded"/>
</wsdl:fault>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="EchoServiceService">
<wsdl:port binding="impl:echoSoapBinding" name="echo">
<wsdlsoap:address location="http://212.24.157.117:8080/axis/services/echo"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>

View file

@ -53,17 +53,29 @@ PHPAPI int php_url_encode_hash_ex(HashTable *ht, smart_str *formstr,
}
arg_sep_len = strlen(arg_sep);
ZEND_HASH_FOREACH_KEY_VAL_IND(ht, idx, key, zdata) {
ZEND_HASH_FOREACH_KEY_VAL(ht, idx, key, zdata) {
zend_bool is_dynamic = 1;
if (Z_TYPE_P(zdata) == IS_INDIRECT) {
zdata = Z_INDIRECT_P(zdata);
if (Z_ISUNDEF_P(zdata)) {
continue;
}
is_dynamic = 0;
}
/* handling for private & protected object properties */
if (key) {
prop_name = ZSTR_VAL(key);
prop_len = ZSTR_LEN(key);
if (type != NULL && zend_check_property_access(Z_OBJ_P(type), key, is_dynamic) != SUCCESS) {
/* property not visible in this scope */
continue;
}
if (ZSTR_VAL(key)[0] == '\0' && type != NULL) {
const char *tmp;
zend_object *zobj = Z_OBJ_P(type);
if (zend_check_property_access(zobj, key) != SUCCESS) {
/* private or protected property access outside of the class */
continue;
}
zend_unmangle_property_name_ex(key, &tmp, &prop_name, &prop_len);
} else {
prop_name = ZSTR_VAL(key);

View file

@ -26,6 +26,6 @@ php_stream *php_stream_url_wrap_ftp(php_stream_wrapper *wrapper, const char *pat
extern PHPAPI const php_stream_wrapper php_stream_http_wrapper;
extern PHPAPI const php_stream_wrapper php_stream_ftp_wrapper;
extern PHPAPI const php_stream_wrapper php_stream_php_wrapper;
extern PHPAPI const php_stream_wrapper php_plain_files_wrapper;
extern PHPAPI /*const*/ php_stream_wrapper php_plain_files_wrapper;
#endif

View file

@ -406,7 +406,7 @@ PHP_FUNCTION(sem_remove)
#else
if (semctl(sem_ptr->semid, 0, IPC_RMID, NULL) < 0) {
#endif
php_error_docref(NULL, E_WARNING, "failed for SysV sempphore " ZEND_LONG_FMT ": %s", Z_LVAL_P(arg_id), strerror(errno));
php_error_docref(NULL, E_WARNING, "failed for SysV semaphore " ZEND_LONG_FMT ": %s", Z_LVAL_P(arg_id), strerror(errno));
RETURN_FALSE;
}

View file

@ -87,6 +87,7 @@ if test "$PHP_XMLRPC" = "yes"; then
-I@ext_srcdir@/libxmlrpc -DVERSION="0.50")
PHP_ADD_BUILD_DIR($ext_builddir/libxmlrpc)
XMLRPC_MODULE_TYPE=builtin
AC_DEFINE(HAVE_XMLRPC_BUNDLED, 1, [ ])
elif test "$PHP_XMLRPC" != "no"; then

View file

@ -12,7 +12,7 @@ if (PHP_XMLRPC != "no") {
ADD_SOURCES(configure_module_dirname + "/libxmlrpc", "base64.c simplestring.c xml_to_dandarpc.c \
xmlrpc_introspection.c encodings.c system_methods.c xml_to_xmlrpc.c \
queue.c xml_element.c xmlrpc.c xml_to_soap.c", "xmlrpc");
AC_DEFINE("HAVE_XMLRPC_BUNDLED", 1);
} else {
WARNING("xmlrpc support can't be enabled, libraries or headers are missing")
PHP_XMLRPC = "no";

View file

@ -1,4 +1,4 @@
# Local macros for automake & autoconf
# Local macros for autoconf
AC_DEFUN([XMLRPC_FUNCTION_CHECKS],[

View file

@ -695,7 +695,11 @@ PHP_FUNCTION(xmlrpc_encode_request)
outBuf = XMLRPC_REQUEST_ToXML(xRequest, 0);
if (outBuf) {
RETVAL_STRING(outBuf);
#ifdef HAVE_XMLRPC_BUNDLED
efree(outBuf);
#else
free(outBuf);
#endif
}
XMLRPC_RequestFree(xRequest, 1);
}
@ -729,7 +733,11 @@ PHP_FUNCTION(xmlrpc_encode)
if (xOut) {
if (outBuf) {
RETVAL_STRING(outBuf);
#ifdef HAVE_XMLRPC_BUNDLED
efree(outBuf);
#else
free(outBuf);
#endif
}
/* cleanup */
XMLRPC_CleanupValue(xOut);
@ -1092,7 +1100,11 @@ PHP_FUNCTION(xmlrpc_server_call_method)
outBuf = XMLRPC_REQUEST_ToXML(xResponse, &buf_len);
if (outBuf) {
RETVAL_STRINGL(outBuf, buf_len);
#ifdef HAVE_XMLRPC_BUNDLED
efree(outBuf);
#else
free(outBuf);
#endif
}
/* cleanup after ourselves. what a sty! */
XMLRPC_RequestFree(xResponse, 0);

View file

@ -9,10 +9,14 @@ if [ -z $RE2C ]; then
RE2C="re2c"
fi
STD="make -f Makefile.frag RE2C='$RE2C' RE2C_FLAGS='-i' YACC='$YACC' srcdir=Zend builddir=Zend top_srcdir=."
# Generate Zend parser and lexer files
STD="make -f Zend/Makefile.frag RE2C='$RE2C' RE2C_FLAGS='-i' YACC='$YACC' srcdir=Zend builddir=Zend top_srcdir=."
(eval "$STD Zend/zend_language_parser.c Zend/zend_language_scanner.c Zend/zend_ini_parser.c Zend/zend_ini_scanner.c")
# Generate phpdbg parser and lexer files
STD="make -f sapi/phpdbg/Makefile.frag RE2C='$RE2C' RE2C_FLAGS='-i' YACC='$YACC' srcdir=sapi/phpdbg builddir=sapi/phpdbg top_srcdir=."
(eval "$STD sapi/phpdbg/phpdbg_parser.c sapi/phpdbg/phpdbg_lexer.c")
set -x
CLEANUP_FILES=" \

View file

@ -20,7 +20,7 @@
/* operations for a plain file; use the php_stream_fopen_XXX funcs below */
PHPAPI extern php_stream_ops php_stream_stdio_ops;
PHPAPI extern const php_stream_wrapper php_plain_files_wrapper;
PHPAPI extern /*const*/ php_stream_wrapper php_plain_files_wrapper;
BEGIN_EXTERN_C()

View file

@ -1453,7 +1453,8 @@ static const php_stream_wrapper_ops php_plain_files_wrapper_ops = {
php_plain_files_metadata
};
PHPAPI const php_stream_wrapper php_plain_files_wrapper = {
/* TODO: We have to make php_plain_files_wrapper writable to support SWOOLE */
PHPAPI /*const*/ php_stream_wrapper php_plain_files_wrapper = {
&php_plain_files_wrapper_ops,
NULL,
0

View file

@ -65,8 +65,8 @@ DIR=php-$VER
DIRPATH=$MY_OLDPWD/$DIR
if test -d "$DIRPATH"; then
echo "The directory $DIR"
echo "already exists, rename or remove it and run makedist again."
echo "The directory $DIR" >&2
echo "already exists, rename or remove it and run makedist again." >&2
exit 1
fi

View file

@ -1467,6 +1467,9 @@ static PHP_MINFO_FUNCTION(cgi)
}
/* }}} */
ZEND_BEGIN_ARG_INFO(cgi_fcgi_sapi_no_arginfo, 0)
ZEND_END_ARG_INFO()
PHP_FUNCTION(fastcgi_finish_request) /* {{{ */
{
fcgi_request *request = (fcgi_request*) SG(server_context);
@ -1489,9 +1492,6 @@ PHP_FUNCTION(fastcgi_finish_request) /* {{{ */
}
/* }}} */
ZEND_BEGIN_ARG_INFO(cgi_fcgi_sapi_no_arginfo, 0)
ZEND_END_ARG_INFO()
PHP_FUNCTION(apache_request_headers) /* {{{ */
{
fcgi_request *request;
@ -1510,8 +1510,11 @@ PHP_FUNCTION(apache_request_headers) /* {{{ */
* Returns the status of the fastcgi process manager */
PHP_FUNCTION(fpm_get_status) /* {{{ */
{
int error = fpm_status_export_to_zval(return_value);
if(error){
if (zend_parse_parameters_none() == FAILURE) {
return;
}
if (fpm_status_export_to_zval(return_value)) {
RETURN_FALSE;
}
}
@ -1519,7 +1522,7 @@ PHP_FUNCTION(fpm_get_status) /* {{{ */
static const zend_function_entry cgi_fcgi_sapi_functions[] = {
PHP_FE(fastcgi_finish_request, cgi_fcgi_sapi_no_arginfo)
PHP_FE(fpm_get_status, NULL)
PHP_FE(fpm_get_status, cgi_fcgi_sapi_no_arginfo)
PHP_FE(apache_request_headers, cgi_fcgi_sapi_no_arginfo)
PHP_FALIAS(getallheaders, apache_request_headers, cgi_fcgi_sapi_no_arginfo)
PHP_FE_END

File diff suppressed because it is too large Load diff

View file

@ -1,130 +0,0 @@
/* A Bison parser, made by GNU Bison 2.7.12-4996. */
/* Bison interface for Yacc-like parsers in C
Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* As a special exception, you may create a larger work that contains
part or all of the Bison parser skeleton and distribute that work
under terms of your choice, so long as that work isn't itself a
parser generator using the skeleton or a modified version thereof
as a parser skeleton. Alternatively, if you modify or redistribute
the parser skeleton itself, you may (at your option) remove this
special exception, which will cause the skeleton and the resulting
Bison output files to be licensed under the GNU General Public
License without this special exception.
This special exception was added by the Free Software Foundation in
version 2.2 of Bison. */
#ifndef YY_PHPDBG_SAPI_PHPDBG_PHPDBG_PARSER_H_INCLUDED
# define YY_PHPDBG_SAPI_PHPDBG_PHPDBG_PARSER_H_INCLUDED
/* Enabling traces. */
#ifndef YYDEBUG
# define YYDEBUG 0
#endif
#if YYDEBUG
extern int phpdbg_debug;
#endif
/* "%code requires" blocks. */
/* Line 2060 of yacc.c */
#line 36 "sapi/phpdbg/phpdbg_parser.y"
#include "phpdbg.h"
#ifndef YY_TYPEDEF_YY_SCANNER_T
#define YY_TYPEDEF_YY_SCANNER_T
typedef void* yyscan_t;
#endif
/* Line 2060 of yacc.c */
#line 55 "sapi/phpdbg/phpdbg_parser.h"
/* Tokens. */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
/* Put the tokens into the symbol table, so that GDB and other debuggers
know about them. */
enum yytokentype {
T_EVAL = 258,
T_RUN = 259,
T_SHELL = 260,
T_IF = 261,
T_TRUTHY = 262,
T_FALSY = 263,
T_STRING = 264,
T_COLON = 265,
T_DCOLON = 266,
T_POUND = 267,
T_SEPARATOR = 268,
T_PROTO = 269,
T_DIGITS = 270,
T_LITERAL = 271,
T_ADDR = 272,
T_OPCODE = 273,
T_ID = 274,
T_INPUT = 275,
T_UNEXPECTED = 276,
T_REQ_ID = 277
};
#endif
/* Tokens. */
#define T_EVAL 258
#define T_RUN 259
#define T_SHELL 260
#define T_IF 261
#define T_TRUTHY 262
#define T_FALSY 263
#define T_STRING 264
#define T_COLON 265
#define T_DCOLON 266
#define T_POUND 267
#define T_SEPARATOR 268
#define T_PROTO 269
#define T_DIGITS 270
#define T_LITERAL 271
#define T_ADDR 272
#define T_OPCODE 273
#define T_ID 274
#define T_INPUT 275
#define T_UNEXPECTED 276
#define T_REQ_ID 277
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
typedef int YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1
#endif
#ifdef YYPARSE_PARAM
#if defined __STDC__ || defined __cplusplus
int phpdbg_parse (void *YYPARSE_PARAM);
#else
int phpdbg_parse ();
#endif
#else /* ! YYPARSE_PARAM */
#if defined __STDC__ || defined __cplusplus
int phpdbg_parse (void);
#else
int phpdbg_parse ();
#endif
#endif /* ! YYPARSE_PARAM */
#endif /* !YY_PHPDBG_SAPI_PHPDBG_PHPDBG_PARSER_H_INCLUDED */

View file

@ -68,7 +68,7 @@ typedef void* yyscan_t;
input
: command { $$ = $1; }
| input T_SEPARATOR command { phpdbg_stack_separate($1.top); $$ = $3; }
| /* nothing */
| /* empty */
;
command
@ -79,7 +79,7 @@ command
parameters
: parameter { phpdbg_stack_push(PHPDBG_G(parser_stack), &$1); $$.top = PHPDBG_G(parser_stack)->top; }
| parameters parameter { phpdbg_stack_push(PHPDBG_G(parser_stack), &$2); $$.top = PHPDBG_G(parser_stack)->top; }
| parameters req_id { $$ = $1; }
| parameters T_REQ_ID { $$ = $1; PHPDBG_G(req_id) = $2.num; }
;
parameter

View file

@ -7,7 +7,6 @@ phpbuilddir = $(libdir)/build
BUILD_FILES = \
scripts/phpize.m4 \
build/mkdep.awk \
build/scan_makefile_in.awk \
build/libtool.m4 \
build/ax_check_compile_flag.m4 \

View file

@ -9,7 +9,7 @@ includedir="`eval echo @includedir@`/php"
builddir="`pwd`"
SED="@SED@"
FILES_BUILD="mkdep.awk scan_makefile_in.awk shtool libtool.m4 ax_check_compile_flag.m4 ax_gcc_func_attribute.m4 php_cxx_compile_stdcxx.m4"
FILES_BUILD="scan_makefile_in.awk shtool libtool.m4 ax_check_compile_flag.m4 ax_gcc_func_attribute.m4 php_cxx_compile_stdcxx.m4"
FILES="acinclude.m4 Makefile.global config.sub config.guess ltmain.sh run-tests*.php"
CLEAN_FILES="$FILES *.o *.lo *.la .libs/ build/ modules/ install-sh \
mkinstalldirs missing config.nice config.sub config.guess configure configure.ac \