Fix for Serialization of 'finfo' is not allowed

This commit is contained in:
Deon George 2023-09-24 00:01:44 +10:00
parent d11a2a5b8d
commit c0c8861c08

View File

@ -14,7 +14,6 @@ final class Item extends Receive
private string $recvas;
private int $recvmtime;
private int $recvsize;
private Filesystem $fs;
/**
* @throws \Exception
@ -29,20 +28,19 @@ final class Item extends Receive
$this->recvsize = $size;
$this->ftype = self::IS_FILE;
$this->fs = Storage::disk(config('fido.local_disk'));
}
public function __get($key) {
switch ($key) {
case 'exists':
return $this->fs->exists($this->rel_name);
return Storage::disk(config('fido.local_disk'))->exists($this->rel_name);
case 'pref_name':
return sprintf('%04X-%s',$this->ao->id,$this->recvas);
case 'rel_name':
return sprintf('%s/%s',config('fido.dir'),$this->pref_name);
case 'full_name':
return $this->fs->path($this->rel_name);
return Storage::disk(config('fido.local_disk'))->path($this->rel_name);
case 'match_mtime':
return $this->mtime === $this->recvmtime;
@ -60,10 +58,10 @@ final class Item extends Receive
return sprintf('%s %lu %lu',$this->recvas,$this->recvsize,$this->recvmtime);
case 'mtime':
return $this->fs->lastModified($this->rel_name);
return Storage::disk(config('fido.local_disk'))->lastModified($this->rel_name);
case 'size':
return $this->fs->size($this->rel_name);
return Storage::disk(config('fido.local_disk'))->size($this->rel_name);
default:
return parent::__get($key);