Re: com php-src: Bug 49898 __getCookies() method implementation: ext/soap/soap.c ext/soap/tests/bug49898.phpt
| From: | Ferenc Kovacs | Date: | Thu, 19 Jun 2014 00:13:15 +0000 |
| Subject: | Re: com php-src: Bug 49898 __getCookies() method implementation: ext/soap/soap.c ext/soap/tests/bug49898.phpt | ||
| References: | 1 | Groups: | php.cvs |
| Request: | Send a blank email to php-cvs+get-78956@lists.php.net to get a copy of this message | ||
On Mon, Jun 9, 2014 at 4:36 AM, Stanislav Malyshev <stas@php.net> wrote:
> Commit: aebb23e4dbfd9eee3f0ace6e37c876684aa62b20
> Author: Boro Sitnikovski <bsitnikovski@sugarcrm.com> Thu, 26
> Sep 2013 02:03:48 +0200
> Committer: Stanislav Malyshev <stas@php.net> Sun, 8 Jun 2014
> 19:36:18 -0700
> Parents: e43270cb2a32d090fef260f429d05b155b16c450
> Branches: PHP-5.4 PHP-5.5 PHP-5.6 master
>
> Link:
>
> http://git.php.net/?p=php-src.git;a=commitdiff;h=aebb23e4dbfd9eee3f0ace6e37c876684aa62b20
>
> Log:
> Bug 49898
> __getCookies() method implementation
>
> Bugs:
> https://bugs.php.net/49898
>
> Changed paths:
> M ext/soap/soap.c
> A ext/soap/tests/bug49898.phpt
>
>
> Diff:
> diff --git a/ext/soap/soap.c b/ext/soap/soap.c
> index ca7f206..eaa57d9 100644
> --- a/ext/soap/soap.c
> +++ b/ext/soap/soap.c
> @@ -225,6 +225,7 @@ PHP_METHOD(SoapClient, __getFunctions);
> PHP_METHOD(SoapClient, __getTypes);
> PHP_METHOD(SoapClient, __doRequest);
> PHP_METHOD(SoapClient, __setCookie);
> +PHP_METHOD(SoapClient, __getCookies);
> PHP_METHOD(SoapClient, __setLocation);
> PHP_METHOD(SoapClient, __setSoapHeaders);
>
> @@ -368,6 +369,9 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_soapclient___setcookie,
> 0, 0, 1)
> ZEND_ARG_INFO(0, value)
> ZEND_END_ARG_INFO()
>
> +ZEND_BEGIN_ARG_INFO(arginfo_soapclient___getcookies, 0)
> +ZEND_END_ARG_INFO()
> +
> ZEND_BEGIN_ARG_INFO_EX(arginfo_soapclient___setsoapheaders, 0, 0, 1)
> ZEND_ARG_INFO(0, soapheaders)
> ZEND_END_ARG_INFO()
> @@ -422,6 +426,7 @@ static const zend_function_entry
> soap_client_functions[] = {
> PHP_ME(SoapClient, __getTypes,
> arginfo_soapclient___gettypes, 0)
> PHP_ME(SoapClient, __doRequest,
> arginfo_soapclient___dorequest, 0)
> PHP_ME(SoapClient, __setCookie,
> arginfo_soapclient___setcookie, 0)
> + PHP_ME(SoapClient, __getCookies,
> arginfo_soapclient___getcookies, 0)
> PHP_ME(SoapClient, __setLocation,
> arginfo_soapclient___setlocation, 0)
> PHP_ME(SoapClient, __setSoapHeaders,
> arginfo_soapclient___setsoapheaders, 0)
> PHP_FE_END
> @@ -3132,6 +3137,24 @@ PHP_METHOD(SoapClient, __setCookie)
> }
> /* }}} */
>
> +/* {{{ proto array SoapClient::__getCookies ( void )
> + Returns list of cookies */
> +PHP_METHOD(SoapClient, __getCookies)
> +{
> + zval **cookies, *tmp;
> +
> + if (zend_parse_parameters_none() == FAILURE) {
> + return;
> + }
> +
> + array_init(return_value);
> +
> + if (zend_hash_find(Z_OBJPROP_P(this_ptr), "_cookies",
> sizeof("_cookies"), (void **)&cookies) != FAILURE) {
> + zend_hash_copy(Z_ARRVAL_P(return_value),
> Z_ARRVAL_P(*cookies), (copy_ctor_func_t) zval_add_ref, (void *)&tmp,
> sizeof(zval*));
> + }
> +}
> +/* }}} */
> +
> /* {{{ proto void SoapClient::__setSoapHeaders(array SoapHeaders)
> Sets SOAP headers for subsequent calls (replaces any previous
> values).
> diff --git a/ext/soap/tests/bug49898.phpt b/ext/soap/tests/bug49898.phpt
> new file mode 100644
> index 0000000..eea4ea4
> --- /dev/null
> +++ b/ext/soap/tests/bug49898.phpt
> @@ -0,0 +1,14 @@
> +--TEST--
> +Test for bug #49898: SoapClient::__getCookies() implementation
> +--CREDITS--
> +Boro Sitnikovski <buritomath@yahoo.com>
> +--SKIPIF--
> +<?php require_once('skipif.inc'); ?>
> +--FILE--
> +<?php
> +$client = new SoapClient(null, array('uri' =>
> 'mo:http://www.w3.org/',
> 'location' => 'http://some.url'));
> +$client->__setCookie("CookieTest", "HelloWorld");
> +var_dump($client->__getCookies()['CookieTest'][0]);
> +?>
> +--EXPECT--
> +string(10) "HelloWorld"
>
>
> --
> PHP CVS Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
Hi Stas,
This is indeed a trivial and self-contained feature, but I think that the
"on a case by case basis" from https://wiki.php.net/rfc/releaseprocess
should also mean some prior discussion on the list.
The only discussion which happened was on the github PR page, and even that
was about renaming the the PR, and not about the contents.
My biggest issue is that allowing to frequent feature introduction into
stable branches means that we can't really have feature freeze in a
development branch, because it would make no sense to have a new feature in
X.Y.Z which isn't present in the X+1.0.0, even though that the latter was
release later.
ps: And I know that we have a bunch of outstanding PRs, so I'm really glad
that there are people actually looking at those and merging them.
--
Ferenc Kovács
@Tyr43l - http://tyrael.hu