This commit is contained in:
Default
2025-04-29 23:51:08 +08:00
parent 852a7fdf94
commit e3aa99257a
3 changed files with 193 additions and 215 deletions

View File

@@ -6,6 +6,7 @@ use League\Flysystem\Filesystem;
use League\Flysystem\AwsS3v3\AwsS3Adapter;
use Aws\S3\S3Client;
use League\Flysystem\Adapter\Local;
use League\Flysystem\Local\LocalFilesystemAdapter;
class StorageCore
{
@@ -22,7 +23,7 @@ class StorageCore
/**
* Undocumented variable
*
* @var Local
* @var LocalFilesystemAdapter
*/
private $Adapter;
@@ -30,9 +31,11 @@ class StorageCore
{
$arrConfig = config('storage');
$this->Adapter = new Local(
$arrConfig['local']['dir']
);
// $this->Adapter = new Local(
// $arrConfig['local']['dir']
// );
$this->Adapter = new LocalFilesystemAdapter($arrConfig['local']['dir']);
$this->Filesystem = new Filesystem($this->Adapter);
}
@@ -64,7 +67,7 @@ class StorageCore
public function put($strKey, $strContent, array $arrConfig = [])
{
$strContent = zstd_compress($strContent);
return $this->Filesystem->put($strKey, $strContent, $arrConfig);
return $this->Filesystem->write($strKey, $strContent, $arrConfig);
}
public function write($strKey, $strContent, array $arrConfig = [])
@@ -76,7 +79,7 @@ class StorageCore
public function update($strKey, $strContent, array $arrConfig = [])
{
$strContent = zstd_compress($strContent);
return $this->Filesystem->update($strKey, $strContent, $arrConfig);
return $this->Filesystem->write($strKey, $strContent, $arrConfig);
}
public function read($strKey)