Changeset View
Changeset View
Standalone View
Standalone View
src/conduit/ConduitFuture.php
| <?php | <?php | ||||
| final class ConduitFuture extends FutureProxy { | final class ConduitFuture extends FutureProxy { | ||||
| private $client; | private $client; | ||||
| private $engine; | |||||
| private $conduitMethod; | private $conduitMethod; | ||||
| private $profilerCallID; | private $profilerCallID; | ||||
| public function setClient(ConduitClient $client, $method) { | public function setClient(ConduitClient $client, $method) { | ||||
| $this->client = $client; | $this->client = $client; | ||||
| $this->conduitMethod = $method; | $this->conduitMethod = $method; | ||||
| return $this; | return $this; | ||||
| } | } | ||||
| Show All 21 Lines | if ($this->profilerCallID !== null) { | ||||
| array()); | array()); | ||||
| } | } | ||||
| list($status, $body, $headers) = $result; | list($status, $body, $headers) = $result; | ||||
| if ($status->isError()) { | if ($status->isError()) { | ||||
| throw $status; | throw $status; | ||||
| } | } | ||||
| $capabilities = array(); | |||||
| foreach ($headers as $header) { | |||||
| list($name, $value) = $header; | |||||
| if (!strcasecmp($name, 'X-Conduit-Capabilities')) { | |||||
| $capabilities = explode(' ', $value); | |||||
| break; | |||||
| } | |||||
| } | |||||
| if ($capabilities) { | |||||
| $this->client->enableCapabilities($capabilities); | |||||
| } | |||||
| $raw = $body; | $raw = $body; | ||||
| $shield = 'for(;;);'; | $shield = 'for(;;);'; | ||||
| if (!strncmp($raw, $shield, strlen($shield))) { | if (!strncmp($raw, $shield, strlen($shield))) { | ||||
| $raw = substr($raw, strlen($shield)); | $raw = substr($raw, strlen($shield)); | ||||
| } | } | ||||
| $data = null; | $data = null; | ||||
| Show All 26 Lines | |||||