目前正在进行重大升级和大修,所以我不确定我这边是否有问题?目前运行的是CakePHP3.6和PHP7.2和Burzum文件存储插件版本2.0.0。
在那个插件里
FileStorageBehaviour line 61
是以下方法:
protected function _isFileUploadPresent($entity) {
$field = $this->getConfig('fileField');
if ($this->getConfig('ignoreEmptyFile') === true) {
if (!isset($entity[$field]['error']) || $entity[$field]['error'] === UPLOAD_ERR_NO_FILE) {
return false;
}
}
return true;
}
但是,此时的$entity看起来像这样:
object(ArrayObject)#692 (1) {
["storage":"ArrayObject":private]=>
array(1) {
["file"]=>
array(2) {
["tmp_name"]=>
string(14) "/tmp/phpAEzNZD"
["name"]=>
string(13) "image.jpg"
}
}
}
不确定是否应始终设置$entity['file']['error'],或者if语句是否应该类似于if(isset($entity[$field]['error']&$entity[$field]['error']==UPLOAD_ERR_NO_file)?