mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-31 13:09:21 +03:00
Migrate RainLoop Webmail to use Facebook Graph API instead of FQL
This commit is contained in:
parent
9fcaf00875
commit
d0dbb26548
120 changed files with 18817 additions and 1746 deletions
|
|
@ -0,0 +1,36 @@
|
|||
<?php
|
||||
|
||||
namespace GuzzleHttp\Adapter;
|
||||
|
||||
/**
|
||||
* Sends streaming requests to a streaming compatible adapter while sending all
|
||||
* other requests to a default adapter.
|
||||
*
|
||||
* This, for example, could be useful for taking advantage of the performance
|
||||
* benefits of the CurlAdapter while still supporting true streaming through
|
||||
* the StreamAdapter.
|
||||
*/
|
||||
class StreamingProxyAdapter implements AdapterInterface
|
||||
{
|
||||
private $defaultAdapter;
|
||||
private $streamingAdapter;
|
||||
|
||||
/**
|
||||
* @param AdapterInterface $defaultAdapter Adapter used for non-streaming responses
|
||||
* @param AdapterInterface $streamingAdapter Adapter used for streaming responses
|
||||
*/
|
||||
public function __construct(
|
||||
AdapterInterface $defaultAdapter,
|
||||
AdapterInterface $streamingAdapter
|
||||
) {
|
||||
$this->defaultAdapter = $defaultAdapter;
|
||||
$this->streamingAdapter = $streamingAdapter;
|
||||
}
|
||||
|
||||
public function send(TransactionInterface $transaction)
|
||||
{
|
||||
return $transaction->getRequest()->getConfig()['stream']
|
||||
? $this->streamingAdapter->send($transaction)
|
||||
: $this->defaultAdapter->send($transaction);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue