Fixed self usage in closure fails on PHP 5.3
parent
f3936b82cd
commit
7ef87626ac
|
@ -188,13 +188,13 @@ class HttpDownloader
|
||||||
$curl = $this->curl;
|
$curl = $this->curl;
|
||||||
|
|
||||||
$canceler = function () use (&$job, $curl) {
|
$canceler = function () use (&$job, $curl) {
|
||||||
if ($job['status'] === self::STATUS_QUEUED) {
|
if ($job['status'] === HttpDownloader::STATUS_QUEUED) {
|
||||||
$job['status'] = self::STATUS_ABORTED;
|
$job['status'] = HttpDownloader::STATUS_ABORTED;
|
||||||
}
|
}
|
||||||
if ($job['status'] !== self::STATUS_STARTED) {
|
if ($job['status'] !== HttpDownloader::STATUS_STARTED) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$job['status'] = self::STATUS_ABORTED;
|
$job['status'] = HttpDownloader::STATUS_ABORTED;
|
||||||
if (isset($job['curl_id'])) {
|
if (isset($job['curl_id'])) {
|
||||||
$curl->abortRequest($job['curl_id']);
|
$curl->abortRequest($job['curl_id']);
|
||||||
}
|
}
|
||||||
|
|
|
@ -158,13 +158,13 @@ class ProcessExecutor
|
||||||
$io = $this->io;
|
$io = $this->io;
|
||||||
|
|
||||||
$canceler = function () use (&$job) {
|
$canceler = function () use (&$job) {
|
||||||
if ($job['status'] === self::STATUS_QUEUED) {
|
if ($job['status'] === ProcessExecutor::STATUS_QUEUED) {
|
||||||
$job['status'] = self::STATUS_ABORTED;
|
$job['status'] = ProcessExecutor::STATUS_ABORTED;
|
||||||
}
|
}
|
||||||
if ($job['status'] !== self::STATUS_STARTED) {
|
if ($job['status'] !== ProcessExecutor::STATUS_STARTED) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$job['status'] = self::STATUS_ABORTED;
|
$job['status'] = ProcessExecutor::STATUS_ABORTED;
|
||||||
try {
|
try {
|
||||||
if (defined('SIGINT')) {
|
if (defined('SIGINT')) {
|
||||||
$job['process']->signal(SIGINT);
|
$job['process']->signal(SIGINT);
|
||||||
|
|
Loading…
Reference in New Issue