summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStanislav Malyshev <stas@php.net>2014-06-08 19:44:49 -0700
committerStanislav Malyshev <stas@php.net>2014-06-08 19:46:12 -0700
commit1b8d4695e2f18b83042e9ac5d501610fce1ccf57 (patch)
treed42365fbcc672194892567ad9d9d3c30e4dbb237
parente07083c378662b593779f05724fe75f550a2619b (diff)
parent9b5d56fd6117ea62fb86c968b0cce2f7c738f6b4 (diff)
downloadphp-git-1b8d4695e2f18b83042e9ac5d501610fce1ccf57.tar.gz
Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4: add news Bug 49898 __getCookies() method implementation
-rw-r--r--NEWS3
-rw-r--r--UPGRADING3
-rw-r--r--ext/soap/soap.c23
-rw-r--r--ext/soap/tests/bug49898.phpt14
4 files changed, 43 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index dc3b8e6217..e4834d46dc 100644
--- a/NEWS
+++ b/NEWS
@@ -30,6 +30,9 @@ PHP NEWS
- PDO-ODBC:
. Fixed bug #50444 (PDO-ODBC changes for 64-bit).
+- SOAP:
+ . Implemented FR #49898 (Add SoapClient::__getCookies()). (Boro Sitnikovski)
+
- SPL:
. Fixed bug #67359 (Segfault in recursiveDirectoryIterator). (Laruence)
. Fixed bug #67360 (Missing element after ArrayObject::getIterator). (Adam)
diff --git a/UPGRADING b/UPGRADING
index 510abcc7b6..4bc5d4143d 100644
--- a/UPGRADING
+++ b/UPGRADING
@@ -309,6 +309,9 @@ PHP 5.5 UPGRADE NOTES
- LDAP:
- ldap_modify_batch() (5.5.10)
+- SOAP:
+ - SoapClient::__getCookies() (5.5.14)
+
- Sockets:
- socket_sendmsg()
- socket_recvmsg()
diff --git a/ext/soap/soap.c b/ext/soap/soap.c
index 60f6e21380..cca8c912e9 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
@@ -3153,6 +3158,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 0000000000..eea4ea490a
--- /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"