Fix for Serialization of 'finfo' is not allowed
This commit is contained in:
parent
d11a2a5b8d
commit
c0c8861c08
@ -14,7 +14,6 @@ final class Item extends Receive
|
|||||||
private string $recvas;
|
private string $recvas;
|
||||||
private int $recvmtime;
|
private int $recvmtime;
|
||||||
private int $recvsize;
|
private int $recvsize;
|
||||||
private Filesystem $fs;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @throws \Exception
|
* @throws \Exception
|
||||||
@ -29,20 +28,19 @@ final class Item extends Receive
|
|||||||
$this->recvsize = $size;
|
$this->recvsize = $size;
|
||||||
|
|
||||||
$this->ftype = self::IS_FILE;
|
$this->ftype = self::IS_FILE;
|
||||||
$this->fs = Storage::disk(config('fido.local_disk'));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function __get($key) {
|
public function __get($key) {
|
||||||
switch ($key) {
|
switch ($key) {
|
||||||
case 'exists':
|
case 'exists':
|
||||||
return $this->fs->exists($this->rel_name);
|
return Storage::disk(config('fido.local_disk'))->exists($this->rel_name);
|
||||||
|
|
||||||
case 'pref_name':
|
case 'pref_name':
|
||||||
return sprintf('%04X-%s',$this->ao->id,$this->recvas);
|
return sprintf('%04X-%s',$this->ao->id,$this->recvas);
|
||||||
case 'rel_name':
|
case 'rel_name':
|
||||||
return sprintf('%s/%s',config('fido.dir'),$this->pref_name);
|
return sprintf('%s/%s',config('fido.dir'),$this->pref_name);
|
||||||
case 'full_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':
|
case 'match_mtime':
|
||||||
return $this->mtime === $this->recvmtime;
|
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);
|
return sprintf('%s %lu %lu',$this->recvas,$this->recvsize,$this->recvmtime);
|
||||||
|
|
||||||
case 'mtime':
|
case 'mtime':
|
||||||
return $this->fs->lastModified($this->rel_name);
|
return Storage::disk(config('fido.local_disk'))->lastModified($this->rel_name);
|
||||||
|
|
||||||
case 'size':
|
case 'size':
|
||||||
return $this->fs->size($this->rel_name);
|
return Storage::disk(config('fido.local_disk'))->size($this->rel_name);
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return parent::__get($key);
|
return parent::__get($key);
|
||||||
|
Loading…
Reference in New Issue
Block a user