<email>mike@php.net</email>
<active>yes</active>
</lead>
-- <date>2022-02-25</date>
++ <date>2022-06-10</date>
<version>
- <release>3.2.5</release>
- <api>3.2.0</api>
- <release>4.2.2</release>
- <api>4.2.0</api>
++ <release>3.3.0</release>
++ <api>3.3.0</api>
</version>
<stability>
<release>stable</release>
</stability>
<license uri="http://copyfree.org/content/standard/licenses/2bsd/license.txt">BSD-2-Clause</license>
<notes><![CDATA[
-- * Fixed gh-issue #123: Segfault with libcurl 7.81
++ * Backport features and bug fixes from v4.
]]></notes>
<contents>
<dir name="/">
#ifndef PHP_EXT_HTTP_H
#define PHP_EXT_HTTP_H
- #define PHP_PECL_HTTP_VERSION "3.2.5"
-#define PHP_PECL_HTTP_VERSION "4.2.2"
++#define PHP_PECL_HTTP_VERSION "3.3.0dev"
extern zend_module_entry http_module_entry;
#define phpext_http_ptr &http_module_entry
RETVAL_ZVAL(getThis(), 1, 0);
}
- static HashTable *combined_options(zval *client, zval *request)
+ static HashTable *combined_options(HashTable *options, zval *client, zval *request)
{
- HashTable *options;
unsigned num_options = 0;
- zval z_roptions, z_options_tmp, *z_coptions = zend_read_property(php_http_client_class_entry, Z_OBJ_P(client), ZEND_STRL("options"), 0, &z_options_tmp);
+ zval z_roptions, z_options_tmp, *z_coptions = zend_read_property(php_http_client_class_entry, client, ZEND_STRL("options"), 0, &z_options_tmp);
if (Z_TYPE_P(z_coptions) == IS_ARRAY) {
num_options = zend_hash_num_elements(Z_ARRVAL_P(z_coptions));
PHP_METHOD(HttpHeader, getParams)
{
zval value_tmp, zctor, zparams_obj, *zargs = NULL;
-
+
ZVAL_STRINGL(&zctor, "__construct", lenof("__construct"));
-
+
object_init_ex(&zparams_obj, php_http_params_get_class_entry());
-
+
zargs = (zval *) ecalloc(ZEND_NUM_ARGS()+1, sizeof(zval));
- ZVAL_COPY_VALUE(&zargs[0], zend_read_property(php_http_header_class_entry, Z_OBJ_P(ZEND_THIS), ZEND_STRL("value"), 0, &value_tmp));
+ ZVAL_COPY_VALUE(&zargs[0], zend_read_property(php_http_header_class_entry, getThis(), ZEND_STRL("value"), 0, &value_tmp));
if (ZEND_NUM_ARGS()) {
zend_get_parameters_array(ZEND_NUM_ARGS(), ZEND_NUM_ARGS(), &zargs[1]);
}
HashTable *props = zend_get_std_object_handlers()->get_properties(object);
char *ver_str, *url_str = NULL;
size_t ver_len, url_len = 0;
- zval tmp;
PHP_HTTP_MESSAGE_OBJECT_INIT(obj);
- *is_temp = 0;
+ if (is_temp) {
+ *is_temp = 0;
+ }
#define UPDATE_PROP(name_str, action_with_tmp) \
do { \
zend_error_handling zeh;
php_http_expect(SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS(), "z", ¶ms), invalid_arg, return);
-
+
zend_replace_error_handling(EH_THROW, php_http_get_exception_bad_querystring_class_entry(), &zeh);
- ZVAL_OBJ(return_value, Z_OBJ_HT_P(instance)->clone_obj(Z_OBJ_P(instance)));
+ ZVAL_OBJ(return_value, Z_OBJ_HT_P(instance)->clone_obj(instance));
/* make sure we do not inherit the reference to _GET */
- SEPARATE_ZVAL(zend_read_property(Z_OBJCE_P(return_value), Z_OBJ_P(return_value), ZEND_STRL("queryArray"), 0, &qa_tmp));
+ SEPARATE_ZVAL(zend_read_property(Z_OBJCE_P(return_value), return_value, ZEND_STRL("queryArray"), 0, &qa_tmp));
php_http_querystring_set(return_value, params, QS_MERGE);
zend_restore_error_handling(&zeh);
}
if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS(), "S", &offset)) {
return;
}
-
+ qa = zend_read_property(php_http_querystring_class_entry, getThis(), ZEND_STRL("queryArray"), 0, &qa_tmp);
+
- qa = zend_read_property(php_http_querystring_class_entry, Z_OBJ_P(ZEND_THIS), ZEND_STRL("queryArray"), 0, &qa_tmp);
ZVAL_DEREF(qa);
if (Z_TYPE_P(qa) == IS_ARRAY) {
if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS(), "S", &offset)) {
return;
}
-
+ qa = zend_read_property(php_http_querystring_class_entry, getThis(), ZEND_STRL("queryArray"), 0, &qa_tmp);
+
- qa = zend_read_property(php_http_querystring_class_entry, Z_OBJ_P(ZEND_THIS), ZEND_STRL("queryArray"), 0, &qa_tmp);
ZVAL_DEREF(qa);
if (Z_TYPE_P(qa) == IS_ARRAY) {
class Observer implements SplObserver
{
- #[ReturnTypeWillChange]
function update(SplSubject $client, http\Client\Request $request = null, StdClass $progress = null) {
echo "P";
- if ($progress->info !== "prepare" && $client->getProgressInfo($request) != $progress) {
- var_dump($progress);
+ /* fence against buggy infof() calls in some curl versions */
+ $compare = $client->getProgressInfo($request);
+ if ($progress->info !== "prepare" && $compare && $compare != $progress) {
+ var_dump($progress, $compare);
}
}
}
--EXPECTF--
Test
- Deprecated: Function http\Client::enableEvents() is deprecated in %sclient024.php on line %d
-Deprecated: Method http\Client::enableEvents() is deprecated in %sclient024.php on line %d
++Deprecated: %s http\Client::enableEvents() is deprecated in %sclient024.php on line %d
- Deprecated: Function http\Client::enablePipelining() is deprecated in %sclient024.php on line %d
-Deprecated: Method http\Client::enablePipelining() is deprecated in %sclient024.php on line %d
++Deprecated: %s http\Client::enablePipelining() is deprecated in %sclient024.php on line %d
===DONE===