httpclient : allow ssloptions to be set before connecting
git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@5317 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
@@ -442,6 +442,20 @@ class Httpclient
|
|||||||
}
|
}
|
||||||
// }}}
|
// }}}
|
||||||
|
|
||||||
|
/** Get/Set the ssl options
|
||||||
|
* @param array|null $ssloptions The SSL Options to use
|
||||||
|
* @return $this
|
||||||
|
*/
|
||||||
|
public function ssloptions ($ssloptions = null)
|
||||||
|
// {{{
|
||||||
|
{
|
||||||
|
if ($ssloptions === null)
|
||||||
|
return $this->ssloptions;
|
||||||
|
$this->ssloptions = $ssloptions;
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
// }}}
|
||||||
|
|
||||||
//////////////////////////////////
|
//////////////////////////////////
|
||||||
//// THE ACTIVE METHODS ////
|
//// THE ACTIVE METHODS ////
|
||||||
//////////////////////////////////
|
//////////////////////////////////
|
||||||
@@ -457,7 +471,7 @@ class Httpclient
|
|||||||
* @param array|null $ssloptions The SSL options (stream_context_set_option)
|
* @param array|null $ssloptions The SSL options (stream_context_set_option)
|
||||||
* @return the page body
|
* @return the page body
|
||||||
*/
|
*/
|
||||||
public function getPage ($url, $ssloptions = array ())
|
public function getPage ($url, $ssloptions = null)
|
||||||
// {{{
|
// {{{
|
||||||
{
|
{
|
||||||
$this->method ("GET");
|
$this->method ("GET");
|
||||||
@@ -472,11 +486,12 @@ class Httpclient
|
|||||||
* @param array|null $ssloptions The SSL options (stream_context_set_option)
|
* @param array|null $ssloptions The SSL options (stream_context_set_option)
|
||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function connect ($ssloptions = array ())
|
public function connect ($ssloptions = null)
|
||||||
// {{{
|
// {{{
|
||||||
{
|
{
|
||||||
$this->log (2, "## URL Start $this->method $this->url");
|
$this->log (2, "## URL Start $this->method $this->url");
|
||||||
$this->ssloptions = $ssloptions;
|
if ($ssloptions !== null)
|
||||||
|
$this->ssloptions = $ssloptions;
|
||||||
$this->headersReceived = array ();
|
$this->headersReceived = array ();
|
||||||
$this->bodySize = null;
|
$this->bodySize = null;
|
||||||
$this->httpCode = null;
|
$this->httpCode = null;
|
||||||
|
|||||||
Reference in New Issue
Block a user