我這邊使用寶塔的《php8.0,8.1,8.3》版本安裝的1.6版本
并且workman版本已經(jīng)升級(jí)為5.0.0-rc.3
使用以下代碼替換報(bào)錯(cuò)方法才修復(fù)成功
public function file(?string $name = null): mixed
{
$files = parent::file($name);
if (null === $files) {
return $name === null ? [] : null;
}
if ($name !== null) {
// Multi files
if (is_array(current($files))) {
return $this->parseFiles($files);
}
return $this->parseFile($files);
}
$uploadFiles = [];
foreach ($files as $name => $file) {
// Multi files
if (is_array(current($file))) {
$uploadFiles[$name] = $this->parseFiles($file);
} else {
$uploadFiles[$name] = $this->parseFile($file);
}
}
return $uploadFiles;
}
我這邊已經(jīng)執(zhí)行composer require workerman/webman-framework ^1.6.6 -W 命令升級(jí)的,并且已經(jīng)刪除了鏡像
workerman/crontab 1.0.6 A crontab written in PHP based on workerman
workerman/webman-framework 1.6.6 High performance HTTP Service Framework.
workerman/workerman 4.2.1 An asynchronous event driven PHP framework for easily building fast, scalable network applications.
現(xiàn)在使用4.2.1反而正常了,之前升級(jí)的時(shí)候,是使用的5.0.0不能運(yùn)行