mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-02 22:17:03 +03:00
Update PHP Facebook SDK
This commit is contained in:
parent
77fb74bc4a
commit
075e184f7d
84 changed files with 9906 additions and 7761 deletions
|
|
@ -25,55 +25,56 @@ namespace Facebook\HttpClients;
|
|||
|
||||
/**
|
||||
* Class FacebookStream
|
||||
*
|
||||
* Abstraction for the procedural stream elements so that the functions can be
|
||||
* mocked and the implementation can be tested.
|
||||
*
|
||||
* @package Facebook
|
||||
*/
|
||||
class FacebookStream
|
||||
{
|
||||
/**
|
||||
* @var resource Context stream resource instance
|
||||
*/
|
||||
protected $stream;
|
||||
|
||||
/**
|
||||
* @var resource Context stream resource instance
|
||||
*/
|
||||
protected $stream;
|
||||
/**
|
||||
* @var array Response headers from the stream wrapper
|
||||
*/
|
||||
protected $responseHeaders;
|
||||
|
||||
/**
|
||||
* @var array Response headers from the stream wrapper
|
||||
*/
|
||||
protected $responseHeaders;
|
||||
/**
|
||||
* Make a new context stream reference instance
|
||||
*
|
||||
* @param array $options
|
||||
*/
|
||||
public function streamContextCreate(array $options)
|
||||
{
|
||||
$this->stream = stream_context_create($options);
|
||||
}
|
||||
|
||||
/**
|
||||
* Make a new context stream reference instance
|
||||
*
|
||||
* @param array $options
|
||||
*/
|
||||
public function streamContextCreate(array $options)
|
||||
{
|
||||
$this->stream = stream_context_create($options);
|
||||
}
|
||||
/**
|
||||
* The response headers from the stream wrapper
|
||||
*
|
||||
* @return array|null
|
||||
*/
|
||||
public function getResponseHeaders()
|
||||
{
|
||||
return $this->responseHeaders;
|
||||
}
|
||||
|
||||
/**
|
||||
* The response headers from the stream wrapper
|
||||
*
|
||||
* @return array|null
|
||||
*/
|
||||
public function getResponseHeaders()
|
||||
{
|
||||
return $this->responseHeaders;
|
||||
}
|
||||
|
||||
/**
|
||||
* Send a stream wrapped request
|
||||
*
|
||||
* @param string $url
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function fileGetContents($url)
|
||||
{
|
||||
$rawResponse = file_get_contents($url, false, $this->stream);
|
||||
$this->responseHeaders = $http_response_header;
|
||||
return $rawResponse;
|
||||
}
|
||||
/**
|
||||
* Send a stream wrapped request
|
||||
*
|
||||
* @param string $url
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function fileGetContents($url)
|
||||
{
|
||||
$rawResponse = file_get_contents($url, false, $this->stream);
|
||||
$this->responseHeaders = $http_response_header;
|
||||
|
||||
return $rawResponse;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue