diff --git a/composer.json b/composer.json index 879b082..441ab33 100644 --- a/composer.json +++ b/composer.json @@ -5,7 +5,7 @@ "license": "None", "require": { "php": ">=5.4.0", - + "ext-curl": "*", "react/promise": "~2.0", "react/event-loop": "*", "khr/php-mcurl-client": "3.*" diff --git a/src/Curl.php b/src/Curl.php index 500606f..036ecb4 100644 --- a/src/Curl.php +++ b/src/Curl.php @@ -13,7 +13,7 @@ class Curl { public $loop; /** - * @var \React\EventLoop\Timer\TimerInterface + * @var \React\EventLoop\TimerInterface */ public $loop_timer; @@ -35,7 +35,7 @@ public function __construct($loop) { $this->loop = $loop; $this->client = new \MCurl\Client(); $this->client->isSelect(false); - $this->client->setClassResult('\\KHR\\React\Curl\\Result'); + $this->client->setClassResult('\KHR\React\Curl\Result'); } /** @@ -95,7 +95,7 @@ public function run() { $this->loop_timer = $this->loop->addPeriodicTimer($this->timeout, function() { $this->run(); if (!($this->client->run() || $this->client->has())) { - $this->loop_timer->cancel(); + $this->loop->cancelTimer($this->loop_timer); $this->loop_timer = null; } });