1
0
Fork 0

Fixed self usage in closure fails on PHP 5.3

pull/9188/head
Simon Berger 2020-09-08 11:42:50 +02:00
parent f3936b82cd
commit 7ef87626ac
2 changed files with 8 additions and 8 deletions

View File

@ -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']);
}

View File

@ -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);