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