我这边使用宝塔的《php8.0,8.1,8.3》版本安装的1.6版本
并且workman版本已经升级为5.0.0-rc.3
使用以下代码替换报错方法才修复成功
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;
}
https://www.workerman.net/q/13501
我这边已经执行composer require workerman/webman-framework ^1.6.6 -W 命令升级的,并且已经删除了镜像
composer info | grep workerman
看下版本
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.
现在使用4.2.1反而正常了,之前升级的时候,是使用的5.0.0不能运行
5.0 还没正式发版