diff options
Diffstat (limited to 'ext')
32 files changed, 172 insertions, 106 deletions
diff --git a/ext/dba/dba_inifile.c b/ext/dba/dba_inifile.c index 05ee95c0ec..9461259f82 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 cc09b3dd80..5e4b22a732 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 5a25573892..8556b8d2e5 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 db8ec83a44..529fe8dfa2 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/json/json.c b/ext/json/json.c index 80bbef7b7c..d017753de6 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 fabceb4c8d..cb6d0dc3a7 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/opcache/Optimizer/block_pass.c b/ext/opcache/Optimizer/block_pass.c index 0a7b1ded0f..835c9ee716 100644 --- a/ext/opcache/Optimizer/block_pass.c +++ b/ext/opcache/Optimizer/block_pass.c @@ -1465,7 +1465,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; } @@ -1608,7 +1613,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; } @@ -1729,7 +1739,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 e12f0b981a..8e77477970 100644 --- a/ext/opcache/ZendAccelerator.c +++ b/ext/opcache/ZendAccelerator.c @@ -2532,7 +2532,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/ZendAccelerator.h b/ext/opcache/ZendAccelerator.h index bd197fb401..f23928c895 100644 --- a/ext/opcache/ZendAccelerator.h +++ b/ext/opcache/ZendAccelerator.h @@ -92,6 +92,7 @@ #define PHP_5_3_X_API_NO 220090626 #define PHP_5_4_X_API_NO 220100525 #define PHP_5_5_X_API_NO 220121212 +#define PHP_5_6_X_API_NO 220131106 /*** file locking ***/ #ifndef ZEND_WIN32 diff --git a/ext/opcache/zend_accelerator_module.c b/ext/opcache/zend_accelerator_module.c index 7596e92bbb..0e685cc198 100644 --- a/ext/opcache/zend_accelerator_module.c +++ b/ext/opcache/zend_accelerator_module.c @@ -470,10 +470,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 539b4e85af..74728f3f72 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/xp_ssl.c b/ext/openssl/xp_ssl.c index 9c9f2a3592..919b008963 100644 --- a/ext/openssl/xp_ssl.c +++ b/ext/openssl/xp_ssl.c @@ -926,7 +926,7 @@ static char * get_sni(php_stream_context *ctx, const char *resourcename, size_t if (ctx) { zval **val = NULL; - if (php_stream_context_get_option(ctx, "ssl", "SNI_enabled", &val) == SUCCESS && !zend_is_true(*val)) { + if (php_stream_context_get_option(ctx, "ssl", "SNI_enabled", &val) == SUCCESS && !zend_is_true(*val TSRMLS_CC)) { return NULL; } if (php_stream_context_get_option(ctx, "ssl", "SNI_server_name", &val) == SUCCESS) { diff --git a/ext/pcntl/pcntl.c b/ext/pcntl/pcntl.c index b66f4722e8..8dfb254cf9 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/soap/php_encoding.c b/ext/soap/php_encoding.c index 5cec3e558e..748093a3ef 100644 --- a/ext/soap/php_encoding.c +++ b/ext/soap/php_encoding.c @@ -1189,7 +1189,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 ca8076a957..3afa2b3ea8 100644 --- a/ext/spl/spl_array.c +++ b/ext/spl/spl_array.c @@ -599,7 +599,7 @@ static int spl_array_has_dimension_ex(int check_inherited, zval *object, zval *o SEPARATE_ARG_IF_REF(offset); zend_call_method_with_1_params(&object, Z_OBJCE_P(object), &intern->fptr_offset_has, "offsetExists", &rv, offset); zval_ptr_dtor(&offset); - if (rv && zend_is_true(rv)) { + if (rv && zend_is_true(rv TSRMLS_CC)) { zval_ptr_dtor(&rv); return 1; } @@ -620,7 +620,7 @@ static int spl_array_has_dimension_ex(int check_inherited, zval *object, zval *o case 2: return 1; default: - return zend_is_true(*tmp); + return zend_is_true(*tmp TSRMLS_CC); } } } @@ -643,7 +643,7 @@ static int spl_array_has_dimension_ex(int check_inherited, zval *object, zval *o case 2: return 1; default: - return zend_is_true(*tmp); + return zend_is_true(*tmp TSRMLS_CC); } } return 0; diff --git a/ext/spl/spl_directory.c b/ext/spl/spl_directory.c index f73e8ee9f0..902161953a 100644 --- a/ext/spl/spl_directory.c +++ b/ext/spl/spl_directory.c @@ -836,7 +836,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); } if (!valid) { @@ -1497,7 +1497,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 8624b35a4b..ce9efb567d 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 b79312e019..2bb97dd35f 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) { @@ -1774,7 +1774,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; } @@ -2598,7 +2598,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) { @@ -3573,7 +3573,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 d21badc87c..47f2174577 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -4277,7 +4277,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) { @@ -4290,7 +4290,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 f55925f315..33f13649cc 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -5751,7 +5751,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/ftp_fopen_wrapper.c b/ext/standard/ftp_fopen_wrapper.c index d04ef52be7..2c12857560 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 f5184ceec6..0a1ea1f467 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/type.c b/ext/standard/type.c index 5d93f66f5b..ec6630d9ed 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 41e1b9fa23..c3b901e320 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) |
