summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
Diffstat (limited to 'ext')
-rw-r--r--ext/date/lib/parse_date.re2
-rw-r--r--ext/date/lib/parse_iso_intervals.re2
-rw-r--r--ext/dba/dba_inifile.c5
-rw-r--r--ext/dba/libinifile/inifile.c41
-rw-r--r--ext/dba/libinifile/inifile.h2
-rw-r--r--ext/dba/tests/bug62490.phpt43
-rw-r--r--ext/dba/tests/dba_db4_003.phpt2
-rw-r--r--ext/dba/tests/dba_db4_007.phpt2
-rw-r--r--ext/dba/tests/dba_db4_010.phpt38
-rw-r--r--ext/dba/tests/dba_handler.inc2
-rw-r--r--ext/dba/tests/dba_inifile.phpt8
-rw-r--r--ext/dba/tests/dba_tcadb.phpt6
-rw-r--r--ext/dom/php_dom.c2
-rw-r--r--ext/gd/libgd/gdft.c10
-rw-r--r--ext/interbase/interbase.c6
-rw-r--r--ext/json/json.c4
-rw-r--r--ext/mysqlnd/mysqlnd_net.c8
-rw-r--r--ext/mysqlnd/mysqlnd_ps.c1
-rw-r--r--ext/opcache/Optimizer/block_pass.c14
-rw-r--r--ext/opcache/Optimizer/pass2.c13
-rw-r--r--ext/opcache/ZendAccelerator.c4
-rw-r--r--ext/opcache/zend_accelerator_module.c7
-rw-r--r--ext/opcache/zend_accelerator_module.h5
-rwxr-xr-xext/openssl/openssl.c2
-rw-r--r--ext/openssl/xp_ssl.c40
-rw-r--r--ext/pcntl/pcntl.c2
-rw-r--r--ext/session/session.c2
-rw-r--r--ext/session/tests/031.phpt9
-rw-r--r--ext/soap/php_encoding.c2
-rw-r--r--ext/spl/spl_array.c4
-rw-r--r--ext/spl/spl_directory.c4
-rw-r--r--ext/spl/spl_fixedarray.c4
-rw-r--r--ext/spl/spl_iterators.c8
-rw-r--r--ext/standard/array.c4
-rw-r--r--ext/standard/basic_functions.c99
-rw-r--r--ext/standard/basic_functions.h2
-rw-r--r--ext/standard/ftp_fopen_wrapper.c6
-rw-r--r--ext/standard/http_fopen_wrapper.c4
-rw-r--r--ext/standard/tests/general_functions/bug44487.phpt24
-rw-r--r--ext/standard/tests/general_functions/call_user_method.phpt20
-rw-r--r--ext/standard/tests/general_functions/call_user_method_002.phpt12
-rw-r--r--ext/standard/type.c2
-rw-r--r--ext/xsl/php_xsl.c25
-rw-r--r--ext/zip/tests/oo_addglob.phpt50
-rw-r--r--ext/zip/tests/oo_addpattern.phpt51
45 files changed, 311 insertions, 292 deletions
diff --git a/ext/date/lib/parse_date.re b/ext/date/lib/parse_date.re
index bbae794418..277935abec 100644
--- a/ext/date/lib/parse_date.re
+++ b/ext/date/lib/parse_date.re
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2013 The PHP Group |
+ | Copyright (c) 1997-2014 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 |
diff --git a/ext/date/lib/parse_iso_intervals.re b/ext/date/lib/parse_iso_intervals.re
index cbbf8781bf..8c82cfc3b9 100644
--- a/ext/date/lib/parse_iso_intervals.re
+++ b/ext/date/lib/parse_iso_intervals.re
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2013 The PHP Group |
+ | Copyright (c) 1997-2014 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 |
diff --git a/ext/dba/dba_inifile.c b/ext/dba/dba_inifile.c
index 4d8eae73ac..6067e99154 100644
--- a/ext/dba/dba_inifile.c
+++ b/ext/dba/dba_inifile.c
@@ -124,14 +124,15 @@ DBA_EXISTS_FUNC(inifile)
DBA_DELETE_FUNC(inifile)
{
int res;
+ zend_bool found = 0;
INIFILE_DATA;
INIFILE_GKEY;
- res = inifile_delete(dba, &ini_key TSRMLS_CC);
+ res = inifile_delete_ex(dba, &ini_key, &found TSRMLS_CC);
INIFILE_DONE;
- return (res == -1 ? FAILURE : SUCCESS);
+ return (res == -1 || !found ? FAILURE : SUCCESS);
}
DBA_FIRSTKEY_FUNC(inifile)
diff --git a/ext/dba/libinifile/inifile.c b/ext/dba/libinifile/inifile.c
index 8c771beba4..218037ebe3 100644
--- a/ext/dba/libinifile/inifile.c
+++ b/ext/dba/libinifile/inifile.c
@@ -402,7 +402,7 @@ static int inifile_copy_to(inifile *dba, size_t pos_start, size_t pos_end, inifi
return FAILURE;
}
php_stream_seek(dba->fp, pos_start, SEEK_SET);
- if (!php_stream_copy_to_stream_ex(dba->fp, fp, pos_end - pos_start, NULL)) {
+ if (SUCCESS != php_stream_copy_to_stream_ex(dba->fp, fp, pos_end - pos_start, NULL)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not copy group [%zu - %zu] to temporary stream", pos_start, pos_end);
return FAILURE;
}
@@ -413,7 +413,7 @@ static int inifile_copy_to(inifile *dba, size_t pos_start, size_t pos_end, inifi
/* {{{ inifile_filter
* copy from to dba while ignoring key name (group must equal)
*/
-static int inifile_filter(inifile *dba, inifile *from, const key_type *key TSRMLS_DC)
+static int inifile_filter(inifile *dba, inifile *from, const key_type *key, zend_bool *found TSRMLS_DC)
{
size_t pos_start = 0, pos_next = 0, pos_curr;
int ret = SUCCESS;
@@ -424,10 +424,13 @@ static int inifile_filter(inifile *dba, inifile *from, const key_type *key TSRML
while(inifile_read(from, &ln TSRMLS_CC)) {
switch(inifile_key_cmp(&ln.key, key TSRMLS_CC)) {
case 0:
+ if (found) {
+ *found = (zend_bool) 1;
+ }
pos_curr = php_stream_tell(from->fp);
if (pos_start != pos_next) {
php_stream_seek(from->fp, pos_start, SEEK_SET);
- if (!php_stream_copy_to_stream_ex(from->fp, dba->fp, pos_next - pos_start, NULL)) {
+ if (SUCCESS != php_stream_copy_to_stream_ex(from->fp, dba->fp, pos_next - pos_start, NULL)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not copy [%zu - %zu] from temporary stream", pos_next, pos_start);
ret = FAILURE;
}
@@ -446,7 +449,7 @@ static int inifile_filter(inifile *dba, inifile *from, const key_type *key TSRML
}
if (pos_start != pos_next) {
php_stream_seek(from->fp, pos_start, SEEK_SET);
- if (!php_stream_copy_to_stream_ex(from->fp, dba->fp, pos_next - pos_start, NULL)) {
+ if (SUCCESS != php_stream_copy_to_stream_ex(from->fp, dba->fp, pos_next - pos_start, NULL)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not copy [%zu - %zu] from temporary stream", pos_next, pos_start);
ret = FAILURE;
}
@@ -458,7 +461,7 @@ static int inifile_filter(inifile *dba, inifile *from, const key_type *key TSRML
/* {{{ inifile_delete_replace_append
*/
-static int inifile_delete_replace_append(inifile *dba, const key_type *key, const val_type *value, int append TSRMLS_DC)
+static int inifile_delete_replace_append(inifile *dba, const key_type *key, const val_type *value, int append, zend_bool *found TSRMLS_DC)
{
size_t pos_grp_start=0, pos_grp_next;
inifile *ini_tmp = NULL;
@@ -497,7 +500,7 @@ static int inifile_delete_replace_append(inifile *dba, const key_type *key, cons
php_stream_seek(dba->fp, 0, SEEK_END);
if (pos_grp_next != (size_t)php_stream_tell(dba->fp)) {
php_stream_seek(dba->fp, pos_grp_next, SEEK_SET);
- if (!php_stream_copy_to_stream_ex(dba->fp, fp_tmp, PHP_STREAM_COPY_ALL, NULL)) {
+ if (SUCCESS != php_stream_copy_to_stream_ex(dba->fp, fp_tmp, PHP_STREAM_COPY_ALL, NULL)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not copy remainder to temporary stream");
ret = FAILURE;
}
@@ -516,7 +519,7 @@ static int inifile_delete_replace_append(inifile *dba, const key_type *key, cons
if (key->name && strlen(key->name)) {
/* 6 */
if (!append && ini_tmp) {
- ret = inifile_filter(dba, ini_tmp, key TSRMLS_CC);
+ ret = inifile_filter(dba, ini_tmp, key, found TSRMLS_CC);
}
/* 7 */
@@ -538,7 +541,7 @@ static int inifile_delete_replace_append(inifile *dba, const key_type *key, cons
if (fp_tmp && php_stream_tell(fp_tmp)) {
php_stream_seek(fp_tmp, 0, SEEK_SET);
php_stream_seek(dba->fp, 0, SEEK_END);
- if (!php_stream_copy_to_stream_ex(fp_tmp, dba->fp, PHP_STREAM_COPY_ALL, NULL)) {
+ if (SUCCESS != php_stream_copy_to_stream_ex(fp_tmp, dba->fp, PHP_STREAM_COPY_ALL, NULL)) {
php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "Could not copy from temporary stream - ini file truncated");
ret = FAILURE;
}
@@ -563,7 +566,15 @@ static int inifile_delete_replace_append(inifile *dba, const key_type *key, cons
*/
int inifile_delete(inifile *dba, const key_type *key TSRMLS_DC)
{
- return inifile_delete_replace_append(dba, key, NULL, 0 TSRMLS_CC);
+ return inifile_delete_replace_append(dba, key, NULL, 0, NULL TSRMLS_CC);
+}
+/* }}} */
+
+/* {{{ inifile_delete_ex
+ */
+int inifile_delete_ex(inifile *dba, const key_type *key, zend_bool *found TSRMLS_DC)
+{
+ return inifile_delete_replace_append(dba, key, NULL, 0, found TSRMLS_CC);
}
/* }}} */
@@ -571,7 +582,15 @@ int inifile_delete(inifile *dba, const key_type *key TSRMLS_DC)
*/
int inifile_replace(inifile *dba, const key_type *key, const val_type *value TSRMLS_DC)
{
- return inifile_delete_replace_append(dba, key, value, 0 TSRMLS_CC);
+ return inifile_delete_replace_append(dba, key, value, 0, NULL TSRMLS_CC);
+}
+/* }}} */
+
+/* {{{ inifile_replace_ex
+ */
+int inifile_replace_ex(inifile *dba, const key_type *key, const val_type *value, zend_bool *found TSRMLS_DC)
+{
+ return inifile_delete_replace_append(dba, key, value, 0, found TSRMLS_CC);
}
/* }}} */
@@ -579,7 +598,7 @@ int inifile_replace(inifile *dba, const key_type *key, const val_type *value TSR
*/
int inifile_append(inifile *dba, const key_type *key, const val_type *value TSRMLS_DC)
{
- return inifile_delete_replace_append(dba, key, value, 1 TSRMLS_CC);
+ return inifile_delete_replace_append(dba, key, value, 1, NULL TSRMLS_CC);
}
/* }}} */
diff --git a/ext/dba/libinifile/inifile.h b/ext/dba/libinifile/inifile.h
index 1177610185..e41dac0ca4 100644
--- a/ext/dba/libinifile/inifile.h
+++ b/ext/dba/libinifile/inifile.h
@@ -49,7 +49,9 @@ val_type inifile_fetch(inifile *dba, const key_type *key, int skip TSRMLS_DC);
int inifile_firstkey(inifile *dba TSRMLS_DC);
int inifile_nextkey(inifile *dba TSRMLS_DC);
int inifile_delete(inifile *dba, const key_type *key TSRMLS_DC);
+int inifile_delete_ex(inifile *dba, const key_type *key, zend_bool *found TSRMLS_DC);
int inifile_replace(inifile *dba, const key_type *key, const val_type *val TSRMLS_DC);
+int inifile_replace_ex(inifile *dba, const key_type *key, const val_type *val, zend_bool *found TSRMLS_DC);
int inifile_append(inifile *dba, const key_type *key, const val_type *val TSRMLS_DC);
char *inifile_version();
diff --git a/ext/dba/tests/bug62490.phpt b/ext/dba/tests/bug62490.phpt
new file mode 100644
index 0000000000..325dd34554
--- /dev/null
+++ b/ext/dba/tests/bug62490.phpt
@@ -0,0 +1,43 @@
+--TEST--
+Bug #62490 (dba_delete returns true on missing item (inifile))
+--SKIPIF--
+<?php
+$handler = "inifile";
+include "skipif.inc";
+?>
+--FILE--
+<?php
+$handler = "inifile";
+include "test.inc";
+
+$dba = dba_open($db_filename, "n", $handler)
+ or die;
+for ($i = 0; $i < 3; ++$i) {
+ echo "insert $i:";
+ var_dump(dba_insert("a", $i, $dba));
+}
+
+echo "exists:";
+var_dump(dba_exists("a", $dba));
+echo "delete:";
+var_dump(dba_delete("a", $dba));
+echo "exists:";
+var_dump(dba_exists("a", $dba));
+echo "delete:";
+var_dump(dba_delete("a", $dba));
+
+?>
+===DONE===
+--CLEAN--
+<?php
+include "clean.inc";
+?>
+--EXPECT--
+insert 0:bool(true)
+insert 1:bool(true)
+insert 2:bool(true)
+exists:bool(true)
+delete:bool(true)
+exists:bool(false)
+delete:bool(false)
+===DONE===
diff --git a/ext/dba/tests/dba_db4_003.phpt b/ext/dba/tests/dba_db4_003.phpt
index 7e8568c085..8708170fc1 100644
--- a/ext/dba/tests/dba_db4_003.phpt
+++ b/ext/dba/tests/dba_db4_003.phpt
@@ -39,8 +39,6 @@ require(dirname(__FILE__) .'/clean.inc');
database handler: db4
int(14)
-Notice: dba_open(): %stest0.dbm: unexpected file type or format in %sdba_db4_003.php on line %d
-
Warning: dba_open(%stest0.dbm,c): Driver initialization failed for handler: db4: Invalid argument in %sdba_db4_003.php on line %d
Error creating %stest0.dbm
Dummy contents
diff --git a/ext/dba/tests/dba_db4_007.phpt b/ext/dba/tests/dba_db4_007.phpt
index bd95e0bec7..027d0af032 100644
--- a/ext/dba/tests/dba_db4_007.phpt
+++ b/ext/dba/tests/dba_db4_007.phpt
@@ -35,7 +35,5 @@ require(dirname(__FILE__) .'/clean.inc');
database handler: db4
int(14)
-Notice: dba_popen(): %stest0.dbm: unexpected file type or format in %sdba_db4_007.php on line %d
-
Warning: dba_popen(%stest0.dbm,c): Driver initialization failed for handler: db4: Invalid argument in %sdba_db4_007.php on line %d
Error creating %stest0.dbm
diff --git a/ext/dba/tests/dba_db4_010.phpt b/ext/dba/tests/dba_db4_010.phpt
deleted file mode 100644
index fb31f05835..0000000000
--- a/ext/dba/tests/dba_db4_010.phpt
+++ /dev/null
@@ -1,38 +0,0 @@
---TEST--
-DBA DB4 magic_quotes_runtime Test
---SKIPIF--
-<?php
-$handler = "db4";
-require_once(dirname(__FILE__) .'/skipif.inc');
-die("info $HND handler used");
-?>
---FILE--
-<?php
-$handler = "db4";
-require_once(dirname(__FILE__) .'/test.inc');
-echo "database handler: $handler\n";
-if (($db_file=dba_open($db_file, "n", $handler))!==FALSE) {
- ini_set('magic_quotes_runtime', 0);
- dba_insert("key1", '"', $db_file);
- var_dump(dba_fetch("key1", $db_file));
- ini_set('magic_quotes_runtime', 1);
- var_dump(dba_fetch("key1", $db_file));
- dba_replace("key1", '\"', $db_file);
- var_dump(dba_fetch("key1", $db_file));
- ini_set('magic_quotes_runtime', 0);
- var_dump(dba_fetch("key1", $db_file));
- dba_close($db_file);
-} else {
- echo "Error creating database\n";
-}
-?>
---CLEAN--
-<?php
-require(dirname(__FILE__) .'/clean.inc');
-?>
---EXPECTF--
-database handler: db4
-string(1) """
-string(2) "\""
-string(2) "\""
-string(1) """
diff --git a/ext/dba/tests/dba_handler.inc b/ext/dba/tests/dba_handler.inc
index a950e903af..ed2a52400a 100644
--- a/ext/dba/tests/dba_handler.inc
+++ b/ext/dba/tests/dba_handler.inc
@@ -82,7 +82,7 @@ do {
dba_close($dba_reader);
}
if (($db_file = dba_popen($db_filename, 'r'.($lock_flag==''?'':'-'), $handler))!==FALSE) {
- if ($handler == 'dbm') {
+ if ($handler == 'dbm' || $handler == "tcadb") {
dba_close($db_file);
}
}
diff --git a/ext/dba/tests/dba_inifile.phpt b/ext/dba/tests/dba_inifile.phpt
index 5975d25f4d..ae06aee09f 100644
--- a/ext/dba/tests/dba_inifile.phpt
+++ b/ext/dba/tests/dba_inifile.phpt
@@ -12,6 +12,10 @@ DBA INIFILE handler test
require_once dirname(__FILE__) .'/dba_handler.inc';
?>
===DONE===
+--CLEAN--
+<?php
+ require(dirname(__FILE__) .'/clean.inc');
+?>
--EXPECT--
database handler: inifile
3NYNYY
@@ -19,7 +23,7 @@ Content String 2
Content 2 replaced
Read during write: not allowed
"key number 6" written
-Failed to write "key number 6" 2nd time
+"key number 6" written 2nd time
Content 2 replaced 2nd time
The 6th value
array(3) {
@@ -36,7 +40,7 @@ Content String 2
Content 2 replaced
Read during write: not allowed
"key number 6" written
-Failed to write "key number 6" 2nd time
+"key number 6" written 2nd time
Content 2 replaced 2nd time
The 6th value
array(3) {
diff --git a/ext/dba/tests/dba_tcadb.phpt b/ext/dba/tests/dba_tcadb.phpt
index 28b6dd8f0b..f75aa813d4 100644
--- a/ext/dba/tests/dba_tcadb.phpt
+++ b/ext/dba/tests/dba_tcadb.phpt
@@ -16,6 +16,12 @@ DBA TCADB handler test
require_once dirname(__FILE__) .'/dba_handler.inc';
?>
===DONE===
+--CLEAN--
+<?php
+$db_filename = $db_file = dirname(__FILE__) .'/test0.tch';
+@unlink($db_filename);
+@unlink($db_filename.'.lck');
+?>
--EXPECT--
database handler: tcadb
3NYNYY
diff --git a/ext/dom/php_dom.c b/ext/dom/php_dom.c
index 0623dbdcde..bfe966bd82 100644
--- a/ext/dom/php_dom.c
+++ b/ext/dom/php_dom.c
@@ -448,7 +448,7 @@ static int dom_property_exists(zval *object, zval *member, int check_empty, cons
Z_SET_REFCOUNT_P(tmp, 1);
Z_UNSET_ISREF_P(tmp);
if (check_empty == 1) {
- retval = zend_is_true(tmp);
+ retval = zend_is_true(tmp TSRMLS_CC);
} else if (check_empty == 0) {
retval = (Z_TYPE_P(tmp) != IS_NULL);
}
diff --git a/ext/gd/libgd/gdft.c b/ext/gd/libgd/gdft.c
index f4ee639081..4979e1511f 100644
--- a/ext/gd/libgd/gdft.c
+++ b/ext/gd/libgd/gdft.c
@@ -1087,7 +1087,15 @@ gdImageStringFTEx (gdImage * im, int *brect, int fg, char *fontlist, double ptsi
}
/* transform glyph image */
- FT_Get_Glyph(slot, &image);
+ if (FT_Get_Glyph(slot, &image)) {
+ if (tmpstr) {
+ gdFree(tmpstr);
+ }
+ gdCacheDelete(tc_cache);
+ gdMutexUnlock(gdFontCacheMutex);
+ return "Problem loading glyph";
+ }
+
if (brect) { /* only if need brect */
FT_Glyph_Get_CBox(image, ft_glyph_bbox_gridfit, &glyph_bbox);
glyph_bbox.xMin += penf.x;
diff --git a/ext/interbase/interbase.c b/ext/interbase/interbase.c
index 8a88efccaa..19f061b17f 100644
--- a/ext/interbase/interbase.c
+++ b/ext/interbase/interbase.c
@@ -816,10 +816,6 @@ PHP_MINFO_FUNCTION(ibase)
snprintf( (s = tmp), sizeof(tmp), "Firebird API version %d", FB_API_VER);
#elif (SQLDA_CURRENT_VERSION > 1)
s = "Interbase 7.0 and up";
-#elif !defined(DSC_null)
- s = "Interbase 6";
-#else
- s = "Firebird 1.0";
#endif
php_info_print_table_row(2, "Compile-time Client Library Version", s);
@@ -838,8 +834,6 @@ PHP_MINFO_FUNCTION(ibase)
#endif
if (info_func) {
info_func(s = tmp);
- } else {
- s = "Firebird 1.0/Interbase 6";
}
php_info_print_table_row(2, "Run-time Client Library Version", s);
} while (0);
diff --git a/ext/json/json.c b/ext/json/json.c
index d4cb39f81d..71f8cc2d69 100644
--- a/ext/json/json.c
+++ b/ext/json/json.c
@@ -190,10 +190,10 @@ static int json_determine_array_type(zval **val TSRMLS_DC) /* {{{ */
}
if (i == HASH_KEY_IS_STRING) {
- return 1;
+ return PHP_JSON_OUTPUT_OBJECT;
} else {
if (index != idx) {
- return 1;
+ return PHP_JSON_OUTPUT_OBJECT;
}
}
idx++;
diff --git a/ext/mysqlnd/mysqlnd_net.c b/ext/mysqlnd/mysqlnd_net.c
index fadcbd87f6..226c855b3d 100644
--- a/ext/mysqlnd/mysqlnd_net.c
+++ b/ext/mysqlnd/mysqlnd_net.c
@@ -900,7 +900,11 @@ MYSQLND_METHOD(mysqlnd_net, enable_ssl)(MYSQLND_NET * const net TSRMLS_DC)
ZVAL_STRING(&cipher_zval, net->data->options.ssl_cipher, 0);
php_stream_context_set_option(context, "ssl", "ciphers", &cipher_zval);
}
+#if PHP_API_VERSION >= 20131106
+ php_stream_context_set(net_stream, context TSRMLS_CC);
+#else
php_stream_context_set(net_stream, context);
+#endif
if (php_stream_xport_crypto_setup(net_stream, STREAM_CRYPTO_METHOD_TLS_CLIENT, NULL TSRMLS_CC) < 0 ||
php_stream_xport_crypto_enable(net_stream, 1 TSRMLS_CC) < 0)
{
@@ -916,7 +920,11 @@ MYSQLND_METHOD(mysqlnd_net, enable_ssl)(MYSQLND_NET * const net TSRMLS_DC)
of the context, which means usage of already freed memory, bad. Actually we don't need this
context anymore after we have enabled SSL on the connection. Thus it is very simple, we remove it.
*/
+#if PHP_API_VERSION >= 20131106
+ php_stream_context_set(net_stream, NULL TSRMLS_CC);
+#else
php_stream_context_set(net_stream, NULL);
+#endif
if (net->data->options.timeout_read) {
struct timeval tv;
diff --git a/ext/mysqlnd/mysqlnd_ps.c b/ext/mysqlnd/mysqlnd_ps.c
index bee8e1d0ee..539d1c8f83 100644
--- a/ext/mysqlnd/mysqlnd_ps.c
+++ b/ext/mysqlnd/mysqlnd_ps.c
@@ -38,6 +38,7 @@ const char * const mysqlnd_stmt_not_prepared = "Statement not prepared";
/* Exported by mysqlnd_ps_codec.c */
enum_func_status mysqlnd_stmt_execute_generate_request(MYSQLND_STMT * const s, zend_uchar ** request, size_t *request_len, zend_bool * free_buffer TSRMLS_DC);
+enum_func_status mysqlnd_stmt_execute_batch_generate_request(MYSQLND_STMT * const s, zend_uchar ** request, size_t *request_len, zend_bool * free_buffer TSRMLS_DC);
static void mysqlnd_stmt_separate_result_bind(MYSQLND_STMT * const stmt TSRMLS_DC);
static void mysqlnd_stmt_separate_one_result_bind(MYSQLND_STMT * const stmt, unsigned int param_no TSRMLS_DC);
diff --git a/ext/opcache/Optimizer/block_pass.c b/ext/opcache/Optimizer/block_pass.c
index fff5d7e101..a6114733e3 100644
--- a/ext/opcache/Optimizer/block_pass.c
+++ b/ext/opcache/Optimizer/block_pass.c
@@ -1466,7 +1466,12 @@ static void zend_jmp_optimization(zend_code_block *block, zend_op_array *op_arra
case ZEND_JMPNZ:
/* constant conditional JMPs */
if (ZEND_OP1_TYPE(last_op) == IS_CONST) {
+#if ZEND_EXTENSION_API_NO > PHP_5_6_X_API_NO
+ int should_jmp = zend_is_true(&ZEND_OP1_LITERAL(last_op) TSRMLS_CC);
+#else
int should_jmp = zend_is_true(&ZEND_OP1_LITERAL(last_op));
+#endif
+
if (last_op->opcode == ZEND_JMPZ) {
should_jmp = !should_jmp;
}
@@ -1609,7 +1614,12 @@ next_target:
case ZEND_JMPZ_EX:
/* constant conditional JMPs */
if (ZEND_OP1_TYPE(last_op) == IS_CONST) {
+#if ZEND_EXTENSION_API_NO > PHP_5_6_X_API_NO
+ int should_jmp = zend_is_true(&ZEND_OP1_LITERAL(last_op) TSRMLS_CC);
+#else
int should_jmp = zend_is_true(&ZEND_OP1_LITERAL(last_op));
+#endif
+
if (last_op->opcode == ZEND_JMPZ_EX) {
should_jmp = !should_jmp;
}
@@ -1730,7 +1740,11 @@ next_target_ex:
}
if (ZEND_OP1_TYPE(last_op) == IS_CONST) {
+#if ZEND_EXTENSION_API_NO > PHP_5_6_X_API_NO
+ if (!zend_is_true(&ZEND_OP1_LITERAL(last_op) TSRMLS_CC)) {
+#else
if (!zend_is_true(&ZEND_OP1_LITERAL(last_op))) {
+#endif
/* JMPZNZ(false,L1,L2) -> JMP(L1) */
zend_code_block *todel;
diff --git a/ext/opcache/Optimizer/pass2.c b/ext/opcache/Optimizer/pass2.c
index 30708a0935..d5f4f0492b 100644
--- a/ext/opcache/Optimizer/pass2.c
+++ b/ext/opcache/Optimizer/pass2.c
@@ -89,7 +89,11 @@ if (ZEND_OPTIMIZER_PASS_2 & OPTIMIZATION_LEVEL) {
/* convert Ti = JMPZ_EX(C, L) => Ti = QM_ASSIGN(C)
in case we know it wouldn't jump */
} else if (ZEND_OP1_TYPE(opline) == IS_CONST) {
+#if ZEND_EXTENSION_API_NO > PHP_5_6_X_API_NO
+ int should_jmp = zend_is_true(&ZEND_OP1_LITERAL(opline) TSRMLS_CC);
+#else
int should_jmp = zend_is_true(&ZEND_OP1_LITERAL(opline));
+#endif
if (opline->opcode == ZEND_JMPZ_EX) {
should_jmp = !should_jmp;
}
@@ -103,7 +107,11 @@ if (ZEND_OPTIMIZER_PASS_2 & OPTIMIZATION_LEVEL) {
case ZEND_JMPZ:
case ZEND_JMPNZ:
if (ZEND_OP1_TYPE(opline) == IS_CONST) {
+#if ZEND_EXTENSION_API_NO > PHP_5_6_X_API_NO
+ int should_jmp = zend_is_true(&ZEND_OP1_LITERAL(opline) TSRMLS_CC);
+#else
int should_jmp = zend_is_true(&ZEND_OP1_LITERAL(opline));
+#endif
if (opline->opcode == ZEND_JMPZ) {
should_jmp = !should_jmp;
@@ -139,8 +147,11 @@ if (ZEND_OPTIMIZER_PASS_2 & OPTIMIZATION_LEVEL) {
case ZEND_JMPZNZ:
if (ZEND_OP1_TYPE(opline) == IS_CONST) {
int opline_num;
-
+#if ZEND_EXTENSION_API_NO > PHP_5_6_X_API_NO
+ if (zend_is_true(&ZEND_OP1_LITERAL(opline) TSRMLS_CC)) {
+#else
if (zend_is_true(&ZEND_OP1_LITERAL(opline))) {
+#endif
opline_num = opline->extended_value; /* JMPNZ */
} else {
opline_num = ZEND_OP2(opline).opline_num; /* JMPZ */
diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c
index faa3641eb1..7c55de3752 100644
--- a/ext/opcache/ZendAccelerator.c
+++ b/ext/opcache/ZendAccelerator.c
@@ -2553,7 +2553,11 @@ static int accel_startup(zend_extension *extension)
_setmaxstdio(2048); /* The default configuration is limited to 512 stdio files */
#endif
+#if ZEND_EXTENSION_API_NO > PHP_5_6_X_API_NO
+ if (start_accel_module(TSRMLS_C) == FAILURE) {
+#else
if (start_accel_module() == FAILURE) {
+#endif
accel_startup_ok = 0;
zend_error(E_WARNING, ACCELERATOR_PRODUCT_NAME ": module registration failed!");
return FAILURE;
diff --git a/ext/opcache/zend_accelerator_module.c b/ext/opcache/zend_accelerator_module.c
index 1620c05621..f4dd9fbb85 100644
--- a/ext/opcache/zend_accelerator_module.c
+++ b/ext/opcache/zend_accelerator_module.c
@@ -488,10 +488,17 @@ static zend_module_entry accel_module_entry = {
STANDARD_MODULE_PROPERTIES
};
+#if ZEND_EXTENSION_API_NO > PHP_5_6_X_API_NO
+int start_accel_module(TSRMLS_D)
+{
+ return zend_startup_module(&accel_module_entry TSRMLS_CC);
+}
+#else
int start_accel_module(void)
{
return zend_startup_module(&accel_module_entry);
}
+#endif
/* {{{ proto array accelerator_get_scripts()
Get the scripts which are accelerated by ZendAccelerator */
diff --git a/ext/opcache/zend_accelerator_module.h b/ext/opcache/zend_accelerator_module.h
index ece4a7d6b5..6e772b8c7e 100644
--- a/ext/opcache/zend_accelerator_module.h
+++ b/ext/opcache/zend_accelerator_module.h
@@ -22,7 +22,12 @@
#ifndef ZEND_ACCELERATOR_MODULE_H
#define ZEND_ACCELERATOR_MODULE_H
+#if ZEND_EXTENSION_API_NO > PHP_5_6_X_API_NO
+int start_accel_module(TSRMLS_D);
+#else
int start_accel_module(void);
+#endif
+
void zend_accel_override_file_functions(TSRMLS_D);
#endif /* _ZEND_ACCELERATOR_MODULE_H */
diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c
index 8badbf7e00..4f8f4b7334 100755
--- a/ext/openssl/openssl.c
+++ b/ext/openssl/openssl.c
@@ -4991,8 +4991,6 @@ PHP_FUNCTION(openssl_open)
}
/* }}} */
-
-
static void openssl_add_method_or_alias(const OBJ_NAME *name, void *arg) /* {{{ */
{
add_next_index_string((zval*)arg, (char*)name->name, 1);
diff --git a/ext/openssl/xp_ssl.c b/ext/openssl/xp_ssl.c
index c6a91570cf..fbfb0774dc 100644
--- a/ext/openssl/xp_ssl.c
+++ b/ext/openssl/xp_ssl.c
@@ -236,6 +236,8 @@ static int verify_callback(int preverify_ok, X509_STORE_CTX *ctx) /* {{{ */
zval **val;
unsigned long allowed_depth = OPENSSL_DEFAULT_STREAM_VERIFY_DEPTH;
+ TSRMLS_FETCH();
+
ret = preverify_ok;
/* determine the status for the current cert */
@@ -249,7 +251,7 @@ static int verify_callback(int preverify_ok, X509_STORE_CTX *ctx) /* {{{ */
/* if allow_self_signed is set, make sure that verification succeeds */
if (err == X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT &&
GET_VER_OPT("allow_self_signed") &&
- zend_is_true(*val)
+ zend_is_true(*val TSRMLS_CC)
) {
ret = 1;
}
@@ -372,15 +374,15 @@ static int apply_peer_verification_policy(SSL *ssl, X509 *peer, php_stream *stre
php_openssl_netstream_data_t *sslsock = (php_openssl_netstream_data_t*)stream->abstract;
must_verify_peer = GET_VER_OPT("verify_peer")
- ? zend_is_true(*val)
+ ? zend_is_true(*val TSRMLS_CC)
: sslsock->is_client;
has_cnmatch_ctx_opt = GET_VER_OPT("CN_match");
must_verify_peer_name = (has_cnmatch_ctx_opt || GET_VER_OPT("verify_peer_name"))
- ? zend_is_true(*val)
+ ? zend_is_true(*val TSRMLS_CC)
: sslsock->is_client;
- must_verify_fingerprint = (GET_VER_OPT("peer_fingerprint") && zend_is_true(*val));
+ must_verify_fingerprint = (GET_VER_OPT("peer_fingerprint") && zend_is_true(*val TSRMLS_CC));
if ((must_verify_peer || must_verify_peer_name || must_verify_fingerprint) && peer == NULL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not get peer certificate");
@@ -395,7 +397,7 @@ static int apply_peer_verification_policy(SSL *ssl, X509 *peer, php_stream *stre
/* fine */
break;
case X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT:
- if (GET_VER_OPT("allow_self_signed") && zend_is_true(*val)) {
+ if (GET_VER_OPT("allow_self_signed") && zend_is_true(*val TSRMLS_CC)) {
/* allowed */
break;
}
@@ -628,7 +630,7 @@ static int win_cert_verify_callback(X509_STORE_CTX *x509_store_ctx, void *arg) /
if (chain_policy_status.dwError != 0) {
/* The chain does not match the policy */
if (is_self_signed && chain_policy_status.dwError == CERT_E_UNTRUSTEDROOT
- && GET_VER_OPT("allow_self_signed") && zend_is_true(*val)) {
+ && GET_VER_OPT("allow_self_signed") && zend_is_true(*val TSRMLS_CC)) {
/* allow self-signed certs */
X509_STORE_CTX_set_error(x509_store_ctx, X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT);
} else {
@@ -1152,21 +1154,21 @@ static int set_server_specific_opts(php_stream *stream, SSL_CTX *ctx TSRMLS_DC)
if (SUCCESS == php_stream_context_get_option(
stream->context, "ssl", "honor_cipher_order", &val) &&
- zend_is_true(*val)
+ zend_is_true(*val TSRMLS_CC)
) {
ssl_ctx_options |= SSL_OP_CIPHER_SERVER_PREFERENCE;
}
if (SUCCESS == php_stream_context_get_option(
stream->context, "ssl", "single_dh_use", &val) &&
- zend_is_true(*val)
+ zend_is_true(*val TSRMLS_CC)
) {
ssl_ctx_options |= SSL_OP_SINGLE_DH_USE;
}
if (SUCCESS == php_stream_context_get_option(
stream->context, "ssl", "single_ecdh_use", &val) &&
- zend_is_true(*val)
+ zend_is_true(*val TSRMLS_CC)
) {
ssl_ctx_options |= SSL_OP_SINGLE_ECDH_USE;
}
@@ -1223,7 +1225,7 @@ static int enable_server_sni(php_stream *stream, php_openssl_netstream_data_t *s
SSL_CTX *ctx;
/* If the stream ctx disables SNI we're finished here */
- if (GET_VER_OPT("SNI_enabled") && !zend_is_true(*val)) {
+ if (GET_VER_OPT("SNI_enabled") && !zend_is_true(*val TSRMLS_CC)) {
return SUCCESS;
}
@@ -1303,13 +1305,13 @@ static int enable_server_sni(php_stream *stream, php_openssl_netstream_data_t *s
return SUCCESS;
}
-static void enable_client_sni(php_stream *stream, php_openssl_netstream_data_t *sslsock) /* {{{ */
+static void enable_client_sni(php_stream *stream, php_openssl_netstream_data_t *sslsock TSRMLS_DC) /* {{{ */
{
zval **val;
char *sni_server_name;
/* If SNI is explicitly disabled we're finished here */
- if (GET_VER_OPT("SNI_enabled") && !zend_is_true(*val)) {
+ if (GET_VER_OPT("SNI_enabled") && !zend_is_true(*val TSRMLS_CC)) {
return;
}
@@ -1384,7 +1386,7 @@ int php_openssl_setup_crypto(php_stream *stream,
}
#if OPENSSL_VERSION_NUMBER >= 0x0090806fL
- if (GET_VER_OPT("no_ticket") && zend_is_true(*val)) {
+ if (GET_VER_OPT("no_ticket") && zend_is_true(*val TSRMLS_CC)) {
ssl_ctx_options |= SSL_OP_NO_TICKET;
}
#endif
@@ -1394,12 +1396,12 @@ int php_openssl_setup_crypto(php_stream *stream,
#endif
#if OPENSSL_VERSION_NUMBER >= 0x10000000L
- if (!GET_VER_OPT("disable_compression") || zend_is_true(*val)) {
+ if (!GET_VER_OPT("disable_compression") || zend_is_true(*val TSRMLS_CC)) {
ssl_ctx_options |= SSL_OP_NO_COMPRESSION;
}
#endif
- if (GET_VER_OPT("verify_peer") && !zend_is_true(*val)) {
+ if (GET_VER_OPT("verify_peer") && !zend_is_true(*val TSRMLS_CC)) {
disable_peer_verification(sslsock->ctx, stream TSRMLS_CC);
} else if (FAILURE == enable_peer_verification(sslsock->ctx, stream TSRMLS_CC)) {
return FAILURE;
@@ -1515,7 +1517,7 @@ static int capture_peer_certs(php_stream *stream, php_openssl_netstream_data_t *
if (SUCCESS == php_stream_context_get_option(stream->context,
"ssl", "capture_peer_cert", &val) &&
- zend_is_true(*val)
+ zend_is_true(*val TSRMLS_CC)
) {
MAKE_STD_ZVAL(zcert);
ZVAL_RESOURCE(zcert, zend_list_insert(peer_cert, php_openssl_get_x509_list_id() TSRMLS_CC));
@@ -1526,7 +1528,7 @@ static int capture_peer_certs(php_stream *stream, php_openssl_netstream_data_t *
if (SUCCESS == php_stream_context_get_option(stream->context,
"ssl", "capture_peer_cert_chain", &val) &&
- zend_is_true(*val)
+ zend_is_true(*val TSRMLS_CC)
) {
zval *arr;
STACK_OF(X509) *chain;
@@ -1576,7 +1578,7 @@ static int php_openssl_enable_crypto(php_stream *stream,
#ifdef HAVE_SNI
if (sslsock->is_client) {
- enable_client_sni(stream, sslsock);
+ enable_client_sni(stream, sslsock TSRMLS_CC);
}
#endif
@@ -1673,7 +1675,7 @@ static int php_openssl_enable_crypto(php_stream *stream,
if (SUCCESS == php_stream_context_get_option(stream->context,
"ssl", "capture_session_meta", &val) &&
- zend_is_true(*val)
+ zend_is_true(*val TSRMLS_CC)
) {
zval *meta_arr = capture_session_meta(sslsock->ssl_handle);
php_stream_context_set_option(stream->context, "ssl", "session_meta", meta_arr);
diff --git a/ext/pcntl/pcntl.c b/ext/pcntl/pcntl.c
index b7ef4c729c..4c7f1784aa 100644
--- a/ext/pcntl/pcntl.c
+++ b/ext/pcntl/pcntl.c
@@ -499,7 +499,7 @@ PHP_MINIT_FUNCTION(pcntl)
{
php_register_signal_constants(INIT_FUNC_ARGS_PASSTHRU);
php_pcntl_register_errno_constants(INIT_FUNC_ARGS_PASSTHRU);
- php_add_tick_function(pcntl_signal_dispatch);
+ php_add_tick_function(pcntl_signal_dispatch TSRMLS_CC);
return SUCCESS;
}
diff --git a/ext/session/session.c b/ext/session/session.c
index 1d60c40188..8051758c12 100644
--- a/ext/session/session.c
+++ b/ext/session/session.c
@@ -1603,7 +1603,7 @@ PHPAPI void php_session_start(TSRMLS_D) /* {{{ */
}
}
- /* Finally check session id for dangarous characters
+ /* Finally check session id for dangerous characters
* Security note: session id may be embedded in HTML pages.*/
if (PS(id) && strpbrk(PS(id), "\r\n\t <>'\"\\")) {
efree(PS(id));
diff --git a/ext/session/tests/031.phpt b/ext/session/tests/031.phpt
index 7486c4b866..ba50247891 100644
--- a/ext/session/tests/031.phpt
+++ b/ext/session/tests/031.phpt
@@ -1,8 +1,13 @@
--TEST--
setting hash_function to sha512 and hash_bits_per_character > 4 should not crash
--SKIPIF--
-<?php include('skipif.inc'); ?>
-<?php if (!extension_loaded('hash')) die('skip hash extension not available'); ?>
+<?php
+include('skipif.inc');
+
+if (!function_exists("hash")) {
+ echo "skip hash extension not loaded";
+}
+?>
--INI--
session.use_cookies=0
session.cache_limiter=
diff --git a/ext/soap/php_encoding.c b/ext/soap/php_encoding.c
index b225a2d670..720f212475 100644
--- a/ext/soap/php_encoding.c
+++ b/ext/soap/php_encoding.c
@@ -1187,7 +1187,7 @@ static xmlNodePtr to_xml_bool(encodeTypePtr type, zval *data, int style, xmlNode
xmlAddChild(parent, ret);
FIND_ZVAL_NULL(data, ret, style);
- if (zend_is_true(data)) {
+ if (zend_is_true(data TSRMLS_CC)) {
xmlNodeSetContent(ret, BAD_CAST("true"));
} else {
xmlNodeSetContent(ret, BAD_CAST("false"));
diff --git a/ext/spl/spl_array.c b/ext/spl/spl_array.c
index f450e0b715..0b81bff099 100644
--- a/ext/spl/spl_array.c
+++ b/ext/spl/spl_array.c
@@ -601,7 +601,7 @@ static int spl_array_has_dimension_ex(int check_inherited, zval *object, zval *o
zend_call_method_with_1_params(&object, Z_OBJCE_P(object), &intern->fptr_offset_has, "offsetExists", &rv, offset_tmp);
zval_ptr_dtor(&offset_tmp);
- if (rv && zend_is_true(rv)) {
+ if (rv && zend_is_true(rv TSRMLS_CC)) {
zval_ptr_dtor(&rv);
if (check_empty != 1) {
return 1;
@@ -660,7 +660,7 @@ static int spl_array_has_dimension_ex(int check_inherited, zval *object, zval *o
}
}
- return check_empty ? zend_is_true(value) : Z_TYPE_P(value) != IS_NULL;
+ return check_empty ? zend_is_true(value TSRMLS_CC) : Z_TYPE_P(value) != IS_NULL;
} /* }}} */
static int spl_array_has_dimension(zval *object, zval *offset, int check_empty TSRMLS_DC) /* {{{ */
diff --git a/ext/spl/spl_directory.c b/ext/spl/spl_directory.c
index 4159d1ae34..0d5cccf0c9 100644
--- a/ext/spl/spl_directory.c
+++ b/ext/spl/spl_directory.c
@@ -837,7 +837,7 @@ SPL_METHOD(DirectoryIterator, seek)
int valid = 0;
zend_call_method_with_0_params(&this_ptr, Z_OBJCE_P(getThis()), &intern->u.dir.func_valid, "valid", &retval);
if (retval) {
- valid = zend_is_true(retval);
+ valid = zend_is_true(retval TSRMLS_CC);
zval_ptr_dtor(&retval);
retval = NULL;
}
@@ -1499,7 +1499,7 @@ SPL_METHOD(RecursiveDirectoryIterator, hasChildren)
spl_filesystem_object_get_file_name(intern TSRMLS_CC);
if (!allow_links && !(intern->flags & SPL_FILE_DIR_FOLLOW_SYMLINKS)) {
php_stat(intern->file_name, intern->file_name_len, FS_IS_LINK, return_value TSRMLS_CC);
- if (zend_is_true(return_value)) {
+ if (zend_is_true(return_value TSRMLS_CC)) {
RETURN_FALSE;
}
}
diff --git a/ext/spl/spl_fixedarray.c b/ext/spl/spl_fixedarray.c
index 2ad50359f2..2c5d5f626c 100644
--- a/ext/spl/spl_fixedarray.c
+++ b/ext/spl/spl_fixedarray.c
@@ -511,7 +511,7 @@ static inline int spl_fixedarray_object_has_dimension_helper(spl_fixedarray_obje
if (!intern->array->elements[index]) {
retval = 0;
} else if (check_empty) {
- if (zend_is_true(intern->array->elements[index])) {
+ if (zend_is_true(intern->array->elements[index] TSRMLS_CC)) {
retval = 1;
} else {
retval = 0;
@@ -540,7 +540,7 @@ static int spl_fixedarray_object_has_dimension(zval *object, zval *offset, int c
zval_ptr_dtor(&intern->retval);
MAKE_STD_ZVAL(intern->retval);
ZVAL_ZVAL(intern->retval, rv, 1, 1);
- return zend_is_true(intern->retval);
+ return zend_is_true(intern->retval TSRMLS_CC);
}
return 0;
}
diff --git a/ext/spl/spl_iterators.c b/ext/spl/spl_iterators.c
index cade34efd4..b9901f8f27 100644
--- a/ext/spl/spl_iterators.c
+++ b/ext/spl/spl_iterators.c
@@ -249,7 +249,7 @@ next_step:
}
}
if (retval) {
- has_children = zend_is_true(retval);
+ has_children = zend_is_true(retval TSRMLS_CC);
zval_ptr_dtor(&retval);
if (has_children) {
if (object->max_depth == -1 || object->max_depth > object->level) {
@@ -1776,7 +1776,7 @@ static inline void spl_filter_it_fetch(zval *zthis, spl_dual_it_object *intern T
while (spl_dual_it_fetch(intern, 1 TSRMLS_CC) == SUCCESS) {
zend_call_method_with_0_params(&zthis, intern->std.ce, NULL, "accept", &retval);
if (retval) {
- if (zend_is_true(retval)) {
+ if (zend_is_true(retval TSRMLS_CC)) {
zval_ptr_dtor(&retval);
return;
}
@@ -2600,7 +2600,7 @@ static inline void spl_caching_it_next(spl_dual_it_object *intern TSRMLS_DC)
return;
}
} else {
- if (zend_is_true(retval)) {
+ if (zend_is_true(retval TSRMLS_CC)) {
zend_call_method_with_0_params(&intern->inner.zobject, intern->inner.ce, NULL, "getchildren", &zchildren);
if (EG(exception)) {
if (zchildren) {
@@ -3575,7 +3575,7 @@ static int spl_iterator_func_apply(zend_object_iterator *iter, void *puser TSRML
apply_info->count++;
zend_fcall_info_call(&apply_info->fci, &apply_info->fcc, &retval, NULL TSRMLS_CC);
if (retval) {
- result = zend_is_true(retval) ? ZEND_HASH_APPLY_KEEP : ZEND_HASH_APPLY_STOP;
+ result = zend_is_true(retval TSRMLS_CC) ? ZEND_HASH_APPLY_KEEP : ZEND_HASH_APPLY_STOP;
zval_ptr_dtor(&retval);
} else {
result = ZEND_HASH_APPLY_STOP;
diff --git a/ext/standard/array.c b/ext/standard/array.c
index 4f98331035..450e6995c2 100644
--- a/ext/standard/array.c
+++ b/ext/standard/array.c
@@ -4135,7 +4135,7 @@ PHP_FUNCTION(array_filter)
fci.params = args;
if (zend_call_function(&fci, &fci_cache TSRMLS_CC) == SUCCESS && retval) {
- int retval_true = zend_is_true(retval);
+ int retval_true = zend_is_true(retval TSRMLS_CC);
zval_ptr_dtor(&retval);
if (use_type) {
@@ -4148,7 +4148,7 @@ PHP_FUNCTION(array_filter)
php_error_docref(NULL TSRMLS_CC, E_WARNING, "An error occurred while invoking the filter callback");
return;
}
- } else if (!zend_is_true(*operand)) {
+ } else if (!zend_is_true(*operand TSRMLS_CC)) {
continue;
}
diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c
index e525ff2a80..de3719e1e9 100644
--- a/ext/standard/basic_functions.c
+++ b/ext/standard/basic_functions.c
@@ -702,18 +702,6 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_call_user_func_array, 0, 0, 2)
ZEND_ARG_INFO(0, parameters) /* ARRAY_INFO(0, parameters, 1) */
ZEND_END_ARG_INFO()
-ZEND_BEGIN_ARG_INFO_EX(arginfo_call_user_method, 0, 0, 2)
- ZEND_ARG_INFO(0, method_name)
- ZEND_ARG_INFO(1, object)
- ZEND_ARG_VARIADIC_INFO(0, parameters)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO(arginfo_call_user_method_array, 0)
- ZEND_ARG_INFO(0, method_name)
- ZEND_ARG_INFO(1, object)
- ZEND_ARG_INFO(0, params) /* ARRAY_INFO(0, params, 1) */
-ZEND_END_ARG_INFO()
-
ZEND_BEGIN_ARG_INFO_EX(arginfo_forward_static_call, 0, 0, 1)
ZEND_ARG_INFO(0, function_name)
ZEND_ARG_VARIADIC_INFO(0, parameters)
@@ -2955,8 +2943,6 @@ const zend_function_entry basic_functions[] = { /* {{{ */
PHP_FE(error_get_last, arginfo_error_get_last)
PHP_FE(call_user_func, arginfo_call_user_func)
PHP_FE(call_user_func_array, arginfo_call_user_func_array)
- PHP_DEP_FE(call_user_method, arginfo_call_user_method)
- PHP_DEP_FE(call_user_method_array, arginfo_call_user_method_array)
PHP_FE(forward_static_call, arginfo_forward_static_call)
PHP_FE(forward_static_call_array, arginfo_forward_static_call_array)
PHP_FE(serialize, arginfo_serialize)
@@ -4781,89 +4767,6 @@ PHP_FUNCTION(call_user_func_array)
}
/* }}} */
-/* {{{ proto mixed call_user_method(string method_name, mixed object [, mixed parameter] [, mixed ...])
- Call a user method on a specific object or class */
-PHP_FUNCTION(call_user_method)
-{
- zval ***params = NULL;
- int n_params = 0;
- zval *retval_ptr;
- zval *callback, *object;
-
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z/z*", &callback, &object, &params, &n_params) == FAILURE) {
- return;
- }
-
- if (Z_TYPE_P(object) != IS_OBJECT &&
- Z_TYPE_P(object) != IS_STRING
- ) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Second argument is not an object or class name");
- if (params) {
- efree(params);
- }
- RETURN_FALSE;
- }
-
- convert_to_string(callback);
-
- if (call_user_function_ex(EG(function_table), &object, callback, &retval_ptr, n_params, params, 0, NULL TSRMLS_CC) == SUCCESS) {
- if (retval_ptr) {
- COPY_PZVAL_TO_ZVAL(*return_value, retval_ptr);
- }
- } else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to call %s()", Z_STRVAL_P(callback));
- }
- if (n_params) {
- efree(params);
- }
-}
-/* }}} */
-
-/* {{{ proto mixed call_user_method_array(string method_name, mixed object, array params)
- Call a user method on a specific object or class using a parameter array */
-PHP_FUNCTION(call_user_method_array)
-{
- zval *params, ***method_args = NULL, *retval_ptr;
- zval *callback, *object;
- HashTable *params_ar;
- int num_elems, element = 0;
-
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z/zA/", &callback, &object, &params) == FAILURE) {
- return;
- }
-
- if (Z_TYPE_P(object) != IS_OBJECT &&
- Z_TYPE_P(object) != IS_STRING
- ) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Second argument is not an object or class name");
- RETURN_FALSE;
- }
-
- convert_to_string(callback);
-
- params_ar = HASH_OF(params);
- num_elems = zend_hash_num_elements(params_ar);
- method_args = (zval ***) safe_emalloc(sizeof(zval **), num_elems, 0);
-
- for (zend_hash_internal_pointer_reset(params_ar);
- zend_hash_get_current_data(params_ar, (void **) &(method_args[element])) == SUCCESS;
- zend_hash_move_forward(params_ar)
- ) {
- element++;
- }
-
- if (call_user_function_ex(EG(function_table), &object, callback, &retval_ptr, num_elems, method_args, 0, NULL TSRMLS_CC) == SUCCESS) {
- if (retval_ptr) {
- COPY_PZVAL_TO_ZVAL(*return_value, retval_ptr);
- }
- } else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to call %s()", Z_STRVAL_P(callback));
- }
-
- efree(method_args);
-}
-/* }}} */
-
/* {{{ proto mixed forward_static_call(mixed function_name [, mixed parmeter] [, mixed ...]) U
Call a user function which is the first parameter */
PHP_FUNCTION(forward_static_call)
@@ -5718,7 +5621,7 @@ PHP_FUNCTION(register_tick_function)
zend_llist_init(BG(user_tick_functions),
sizeof(user_tick_function_entry),
(llist_dtor_func_t) user_tick_function_dtor, 0);
- php_add_tick_function(run_user_tick_functions);
+ php_add_tick_function(run_user_tick_functions TSRMLS_CC);
}
for (i = 0; i < tick_fe.arg_count; i++) {
diff --git a/ext/standard/basic_functions.h b/ext/standard/basic_functions.h
index 3af85b3d40..3324427088 100644
--- a/ext/standard/basic_functions.h
+++ b/ext/standard/basic_functions.h
@@ -81,8 +81,6 @@ PHP_FUNCTION(error_get_last);
PHP_FUNCTION(call_user_func);
PHP_FUNCTION(call_user_func_array);
-PHP_FUNCTION(call_user_method);
-PHP_FUNCTION(call_user_method_array);
PHP_FUNCTION(forward_static_call);
PHP_FUNCTION(forward_static_call_array);
diff --git a/ext/standard/ftp_fopen_wrapper.c b/ext/standard/ftp_fopen_wrapper.c
index d6eb3b8fbc..df03772c39 100644
--- a/ext/standard/ftp_fopen_wrapper.c
+++ b/ext/standard/ftp_fopen_wrapper.c
@@ -163,7 +163,7 @@ static php_stream *php_ftp_fopen_connect(php_stream_wrapper *wrapper, const char
goto connect_errexit;
}
- php_stream_context_set(stream, context);
+ php_stream_context_set(stream, context TSRMLS_CC);
php_stream_notify_info(context, PHP_STREAM_NOTIFY_CONNECT, NULL, 0);
/* Start talking to ftp server */
@@ -571,7 +571,7 @@ php_stream * php_stream_url_wrap_ftp(php_stream_wrapper *wrapper, const char *pa
goto errexit;
}
- php_stream_context_set(datastream, context);
+ php_stream_context_set(datastream, context TSRMLS_CC);
php_stream_notify_progress_init(context, 0, file_size);
if (use_ssl_on_data && (php_stream_xport_crypto_setup(datastream,
@@ -745,7 +745,7 @@ php_stream * php_stream_ftp_opendir(php_stream_wrapper *wrapper, const char *pat
goto opendir_errexit;
}
- php_stream_context_set(datastream, context);
+ php_stream_context_set(datastream, context TSRMLS_CC);
if (use_ssl_on_data && (php_stream_xport_crypto_setup(stream,
STREAM_CRYPTO_METHOD_SSLv23_CLIENT, NULL TSRMLS_CC) < 0 ||
diff --git a/ext/standard/http_fopen_wrapper.c b/ext/standard/http_fopen_wrapper.c
index 73776ff0b9..3ef722bde0 100644
--- a/ext/standard/http_fopen_wrapper.c
+++ b/ext/standard/http_fopen_wrapper.c
@@ -337,7 +337,7 @@ finish:
eol_detect = stream->flags & (PHP_STREAM_FLAG_DETECT_EOL | PHP_STREAM_FLAG_EOL_MAC);
stream->flags &= ~(PHP_STREAM_FLAG_DETECT_EOL | PHP_STREAM_FLAG_EOL_MAC);
- php_stream_context_set(stream, context);
+ php_stream_context_set(stream, context TSRMLS_CC);
php_stream_notify_info(context, PHP_STREAM_NOTIFY_CONNECT, NULL, 0);
@@ -682,7 +682,7 @@ finish:
response_code = 0;
}
if (context && SUCCESS==php_stream_context_get_option(context, "http", "ignore_errors", &tmpzval)) {
- ignore_errors = zend_is_true(*tmpzval);
+ ignore_errors = zend_is_true(*tmpzval TSRMLS_CC);
}
/* when we request only the header, don't fail even on error codes */
if ((options & STREAM_ONLY_GET_HEADERS) || ignore_errors) {
diff --git a/ext/standard/tests/general_functions/bug44487.phpt b/ext/standard/tests/general_functions/bug44487.phpt
deleted file mode 100644
index 10c52c6b3f..0000000000
--- a/ext/standard/tests/general_functions/bug44487.phpt
+++ /dev/null
@@ -1,24 +0,0 @@
---TEST--
-Bug #44487 (call_user_method_array issues a warning when throwing an exception)
---INI--
-error_reporting = E_ALL & ~E_DEPRECATED
---FILE--
-<?php
-
-class Foo
-{
- public function test()
- {
- print 'test';
- throw new Exception();
- }
-}
-
-try {
- $bar = new Foo();
- call_user_method_array('test', $bar, array()) ;
-} catch (Exception $e) {
-}
-?>
---EXPECT--
-test
diff --git a/ext/standard/tests/general_functions/call_user_method.phpt b/ext/standard/tests/general_functions/call_user_method.phpt
deleted file mode 100644
index cc54ff9544..0000000000
--- a/ext/standard/tests/general_functions/call_user_method.phpt
+++ /dev/null
@@ -1,20 +0,0 @@
---TEST--
-Basic behaviour of call_user_method() test
---CREDITS--
-Sebastian Schürmann
-sebs@php.net
-Testfest 2009 Munich
---FILE--
-<?php
-class a {
- static function b() {
- return true;
- }
-}
-$a = new a();
-$res = call_user_method('b', $a);
-var_dump($res);
-?>
---EXPECTF--
-Deprecated: Function call_user_method() is deprecated in %s on line 8
-bool(true)
diff --git a/ext/standard/tests/general_functions/call_user_method_002.phpt b/ext/standard/tests/general_functions/call_user_method_002.phpt
deleted file mode 100644
index 054bc3edeb..0000000000
--- a/ext/standard/tests/general_functions/call_user_method_002.phpt
+++ /dev/null
@@ -1,12 +0,0 @@
---TEST--
-call_user_method() Invalid free
---FILE--
-<?php
-
-call_user_method("1", $arr1);
-
-?>
---EXPECTF--
-Deprecated: Function call_user_method() is deprecated in %s on line %d
-
-Warning: call_user_method(): Second argument is not an object or class name in %s on line %d
diff --git a/ext/standard/type.c b/ext/standard/type.c
index dcc8083e41..15bdbb06c2 100644
--- a/ext/standard/type.c
+++ b/ext/standard/type.c
@@ -186,7 +186,7 @@ PHP_FUNCTION(boolval)
return;
}
- RETURN_BOOL(zend_is_true(*val));
+ RETURN_BOOL(zend_is_true(*val TSRMLS_CC));
}
/* }}} */
diff --git a/ext/xsl/php_xsl.c b/ext/xsl/php_xsl.c
index 3d63dd0642..aac93cd5c9 100644
--- a/ext/xsl/php_xsl.c
+++ b/ext/xsl/php_xsl.c
@@ -57,8 +57,8 @@ zend_module_entry xsl_module_entry = {
xsl_functions,
PHP_MINIT(xsl),
PHP_MSHUTDOWN(xsl),
- PHP_RINIT(xsl), /* Replace with NULL if there's nothing to do at request start */
- PHP_RSHUTDOWN(xsl), /* Replace with NULL if there's nothing to do at request end */
+ NULL,
+ NULL,
PHP_MINFO(xsl),
#if ZEND_MODULE_API_NO >= 20010901
"0.1", /* Replace with version number for your extension */
@@ -170,6 +170,7 @@ PHP_MINIT_FUNCTION(xsl)
xsltRegisterExtModuleFunction ((const xmlChar *) "function",
(const xmlChar *) "http://php.net/xsl",
xsl_ext_function_object_php);
+ xsltSetGenericErrorFunc(NULL, php_libxml_error_handler);
REGISTER_LONG_CONSTANT("XSL_CLONE_AUTO", 0, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("XSL_CLONE_NEVER", -1, CONST_CS | CONST_PERSISTENT);
@@ -273,7 +274,7 @@ PHP_MSHUTDOWN_FUNCTION(xsl)
(const xmlChar *) "http://php.net/xsl");
xsltUnregisterExtModuleFunction ((const xmlChar *) "function",
(const xmlChar *) "http://php.net/xsl");
-
+ xsltSetGenericErrorFunc(NULL, NULL);
xsltCleanupGlobals();
UNREGISTER_INI_ENTRIES();
@@ -282,24 +283,6 @@ PHP_MSHUTDOWN_FUNCTION(xsl)
}
/* }}} */
-/* {{{ PHP_RINIT_FUNCTION
- */
-PHP_RINIT_FUNCTION(xsl)
-{
- xsltSetGenericErrorFunc(NULL, php_libxml_error_handler);
- return SUCCESS;
-}
-/* }}} */
-
-/* {{{ PHP_RSHUTDOWN_FUNCTION
- */
-PHP_RSHUTDOWN_FUNCTION(xsl)
-{
- xsltSetGenericErrorFunc(NULL, NULL);
- return SUCCESS;
-}
-/* }}} */
-
/* {{{ PHP_MINFO_FUNCTION
*/
PHP_MINFO_FUNCTION(xsl)
diff --git a/ext/zip/tests/oo_addglob.phpt b/ext/zip/tests/oo_addglob.phpt
new file mode 100644
index 0000000000..970bfc7678
--- /dev/null
+++ b/ext/zip/tests/oo_addglob.phpt
@@ -0,0 +1,50 @@
+--TEST--
+ZipArchive::addGlob() method
+--CREDITS--
+Sammy Kaye Powers <sammyk@sammykmedia.com>
+w/Kenzo over the shoulder
+#phptek Chicago 2014
+--SKIPIF--
+<?php
+/* $Id$ */
+if(!extension_loaded('zip')) die('skip');
+?>
+--FILE--
+<?php
+$dirname = dirname(__FILE__) . '/';
+include $dirname . 'utils.inc';
+$file = $dirname . '__tmp_oo_addglob.zip';
+
+copy($dirname . 'test.zip', $file);
+touch($dirname . 'foo.txt');
+touch($dirname . 'bar.baz');
+
+$zip = new ZipArchive();
+if (!$zip->open($file)) {
+ exit('failed');
+}
+$options = array('add_path' => 'baz/', 'remove_all_path' => TRUE);
+if (!$zip->addGlob($dirname . '*.{txt,baz}', GLOB_BRACE, $options)) {
+ echo "failed1\n";
+}
+if ($zip->status == ZIPARCHIVE::ER_OK) {
+ dump_entries_name($zip);
+ $zip->close();
+} else {
+ echo "failed2\n";
+}
+?>
+--CLEAN--
+<?php
+$dirname = dirname(__FILE__) . '/';
+unlink($dirname . '__tmp_oo_addglob.zip');
+unlink($dirname . 'foo.txt');
+unlink($dirname . 'bar.baz');
+?>
+--EXPECTF--
+0 bar
+1 foobar/
+2 foobar/baz
+3 entry1.txt
+4 baz/foo.txt
+5 baz/bar.baz
diff --git a/ext/zip/tests/oo_addpattern.phpt b/ext/zip/tests/oo_addpattern.phpt
new file mode 100644
index 0000000000..4e1cab4ad9
--- /dev/null
+++ b/ext/zip/tests/oo_addpattern.phpt
@@ -0,0 +1,51 @@
+--TEST--
+ZipArchive::addPattern() method
+--CREDITS--
+Sammy Kaye Powers <sammyk@sammykmedia.com>
+w/Kenzo over the shoulder
+#phptek Chicago 2014
+--SKIPIF--
+<?php
+/* $Id$ */
+if(!extension_loaded('zip')) die('skip');
+?>
+--FILE--
+<?php
+$dirname = dirname(__FILE__) . '/';
+include $dirname . 'utils.inc';
+$file = $dirname . '__tmp_oo_addpattern.zip';
+
+copy($dirname . 'test.zip', $file);
+touch($dirname . 'foo.txt');
+touch($dirname . 'bar.txt');
+
+$zip = new ZipArchive();
+if (!$zip->open($file)) {
+ exit('failed');
+}
+$dir = realpath($dirname);
+$options = array('add_path' => 'baz/', 'remove_path' => $dir);
+if (!$zip->addPattern('/\.txt$/', $dir, $options)) {
+ echo "failed\n";
+}
+if ($zip->status == ZIPARCHIVE::ER_OK) {
+ dump_entries_name($zip);
+ $zip->close();
+} else {
+ echo "failed\n";
+}
+?>
+--CLEAN--
+<?php
+$dirname = dirname(__FILE__) . '/';
+unlink($dirname . '__tmp_oo_addpattern.zip');
+unlink($dirname . 'foo.txt');
+unlink($dirname . 'bar.txt');
+?>
+--EXPECTF--
+0 bar
+1 foobar/
+2 foobar/baz
+3 entry1.txt
+4 baz/bar.txt
+5 baz/foo.txt