3.0.0
This commit is contained in:
parent
917c25c99b
commit
fd1d5a988a
|
|
@ -3,7 +3,7 @@
|
|||
* Plugin Name: Flysystem Offload
|
||||
* Plugin URI: https://git.brasdrive.com.br/Brasdrive/flysystem-offload
|
||||
* Description: Reemplaza el filesystem local de WordPress con almacenamiento remoto transparente usando Flysystem v3.
|
||||
* Version: 0.3.0
|
||||
* Version: 3.0.0
|
||||
* Author: Brasdrive
|
||||
* License: GPLv2 or later
|
||||
* Text Domain: flysystem-offload
|
||||
|
|
|
|||
|
|
@ -1,20 +1,27 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FlysystemOffload\Filesystem;
|
||||
|
||||
use FlysystemOffload\Filesystem\Adapters\S3Adapter;
|
||||
use FlysystemOffload\Filesystem\Adapters\WebdavAdapter;
|
||||
use League\Flysystem\Filesystem;
|
||||
use League\Flysystem\FilesystemOperator;
|
||||
use League\Flysystem\Visibility;
|
||||
|
||||
final class FilesystemFactory {
|
||||
public function make(array $config): FilesystemOperator {
|
||||
final class FilesystemFactory
|
||||
{
|
||||
public function make(array $config): FilesystemOperator
|
||||
{
|
||||
$driver = $config['driver'] ?? 's3';
|
||||
|
||||
$adapter = match ($driver) {
|
||||
's3' => (new S3Adapter())->createAdapter($config),
|
||||
default => throw new \InvalidArgumentException(sprintf('Driver de Flysystem no soportado: "%s".', $driver)),
|
||||
'webdav' => (new WebdavAdapter())->createAdapter($config),
|
||||
default => throw new \InvalidArgumentException(
|
||||
sprintf('Driver de Flysystem no soportado: "%s".', $driver)
|
||||
),
|
||||
};
|
||||
|
||||
$filesystemConfig = [
|
||||
|
|
|
|||
Loading…
Reference in New Issue