Skip to content

Commit 9dbfd50

Browse files
committed
Add alias Curl::getCookie(); Update available methods in readme
1 parent b3aa206 commit 9dbfd50

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,9 @@ Curl::downloadComplete($fh)
168168
Curl::error($callback)
169169
Curl::exec($ch = null)
170170
Curl::get($url, $data = array())
171+
Curl::getCookie($key) {
171172
Curl::getOpt($option)
173+
Curl::getResponseCookie($key) {
172174
Curl::head($url, $data = array())
173175
Curl::headerCallback($ch, $header)
174176
Curl::options($url, $data = array())

src/Curl/Curl.php

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -544,13 +544,23 @@ public function setCookie($key, $value)
544544
}
545545

546546
/**
547-
* get Cookie of Response, if Key is set. Otherwise return NULL
547+
* Get cookie.
548+
*
549+
* @access public
550+
* @param $key
551+
*/
552+
public function getCookie($key) {
553+
return $this->getResponseCookie($key);
554+
}
555+
556+
/**
557+
* Get response cookie.
548558
*
549559
* @access public
550560
* @param $key
551561
*/
552562
public function getResponseCookie($key) {
553-
return (isset($this->responseCookies[$key]))?$this->responseCookies[$key]:NULL;
563+
return isset($this->responseCookies[$key]) ? $this->responseCookies[$key] : null;
554564
}
555565

556566
/**

0 commit comments

Comments
 (0)