From e3cf01d01f242927ac3fd497b0cbc88fad1c9df2 Mon Sep 17 00:00:00 2001 From: muzi_ys <1099438829@qq.com> Date: Sun, 6 Nov 2022 00:04:07 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0tp=E7=89=88=E6=9C=AC=EF=BC=8C?= =?UTF-8?q?=E5=AE=8C=E5=96=84=E6=96=87=E4=BB=B6=E4=B8=8A=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/controller/File.php | 61 +- vendor/composer/autoload_psr4.php | 3 - vendor/composer/autoload_static.php | 18 - vendor/composer/installed.json | 318 +---- vendor/composer/installed.php | 67 +- .../flysystem-cached-adapter/.editorconfig | 10 - .../flysystem-cached-adapter/.gitignore | 4 - .../league/flysystem-cached-adapter/.php_cs | 7 - .../flysystem-cached-adapter/.scrutinizer.yml | 34 - .../flysystem-cached-adapter/.travis.yml | 29 - .../league/flysystem-cached-adapter/LICENSE | 19 - .../clover/.gitignore | 2 - .../flysystem-cached-adapter/composer.json | 30 - .../flysystem-cached-adapter/phpspec.yml | 6 - .../flysystem-cached-adapter/phpunit.php | 3 - .../flysystem-cached-adapter/phpunit.xml | 29 - .../league/flysystem-cached-adapter/readme.md | 20 - .../spec/CachedAdapterSpec.php | 435 ------ .../src/CacheInterface.php | 101 -- .../src/CachedAdapter.php | 346 ----- .../src/Storage/AbstractCache.php | 418 ------ .../src/Storage/Adapter.php | 115 -- .../src/Storage/Memcached.php | 59 - .../src/Storage/Memory.php | 22 - .../src/Storage/Noop.php | 171 --- .../src/Storage/PhpRedis.php | 62 - .../src/Storage/Predis.php | 75 - .../src/Storage/Psr6Cache.php | 59 - .../src/Storage/Stash.php | 60 - .../tests/AdapterCacheTests.php | 104 -- .../tests/InspectionTests.php | 16 - .../tests/MemcachedTests.php | 35 - .../tests/MemoryCacheTests.php | 255 ---- .../tests/NoopCacheTests.php | 35 - .../tests/PhpRedisTests.php | 45 - .../tests/PredisTests.php | 55 - .../tests/Psr6CacheTest.php | 45 - .../tests/StashTest.php | 43 - vendor/league/flysystem/CODE_OF_CONDUCT.md | 76 - vendor/league/flysystem/LICENSE | 19 - vendor/league/flysystem/SECURITY.md | 16 - vendor/league/flysystem/composer.json | 68 - vendor/league/flysystem/deprecations.md | 19 - .../flysystem/src/Adapter/AbstractAdapter.php | 72 - .../src/Adapter/AbstractFtpAdapter.php | 705 ---------- .../src/Adapter/CanOverwriteFiles.php | 12 - vendor/league/flysystem/src/Adapter/Ftp.php | 584 -------- vendor/league/flysystem/src/Adapter/Ftpd.php | 48 - vendor/league/flysystem/src/Adapter/Local.php | 533 ------- .../flysystem/src/Adapter/NullAdapter.php | 144 -- .../Polyfill/NotSupportingVisibilityTrait.php | 33 - .../Adapter/Polyfill/StreamedCopyTrait.php | 51 - .../Adapter/Polyfill/StreamedReadingTrait.php | 44 - .../src/Adapter/Polyfill/StreamedTrait.php | 9 - .../Adapter/Polyfill/StreamedWritingTrait.php | 60 - .../flysystem/src/Adapter/SynologyFtp.php | 8 - .../league/flysystem/src/AdapterInterface.php | 118 -- vendor/league/flysystem/src/Config.php | 107 -- .../league/flysystem/src/ConfigAwareTrait.php | 49 - .../src/ConnectionErrorException.php | 9 - .../src/ConnectionRuntimeException.php | 9 - .../flysystem/src/CorruptedPathDetected.php | 17 - vendor/league/flysystem/src/Directory.php | 31 - vendor/league/flysystem/src/Exception.php | 8 - vendor/league/flysystem/src/File.php | 205 --- .../flysystem/src/FileExistsException.php | 37 - .../flysystem/src/FileNotFoundException.php | 37 - vendor/league/flysystem/src/Filesystem.php | 409 ------ .../flysystem/src/FilesystemException.php | 7 - .../flysystem/src/FilesystemInterface.php | 284 ---- .../src/FilesystemNotFoundException.php | 12 - vendor/league/flysystem/src/Handler.php | 137 -- .../flysystem/src/InvalidRootException.php | 9 - vendor/league/flysystem/src/MountManager.php | 648 --------- .../flysystem/src/NotSupportedException.php | 37 - .../flysystem/src/Plugin/AbstractPlugin.php | 24 - .../league/flysystem/src/Plugin/EmptyDir.php | 34 - .../flysystem/src/Plugin/ForcedCopy.php | 44 - .../flysystem/src/Plugin/ForcedRename.php | 44 - .../flysystem/src/Plugin/GetWithMetadata.php | 51 - .../league/flysystem/src/Plugin/ListFiles.php | 35 - .../league/flysystem/src/Plugin/ListPaths.php | 36 - .../league/flysystem/src/Plugin/ListWith.php | 60 - .../flysystem/src/Plugin/PluggableTrait.php | 97 -- .../src/Plugin/PluginNotFoundException.php | 10 - .../league/flysystem/src/PluginInterface.php | 20 - vendor/league/flysystem/src/ReadInterface.php | 88 -- .../flysystem/src/RootViolationException.php | 10 - vendor/league/flysystem/src/SafeStorage.php | 39 - .../flysystem/src/UnreadableFileException.php | 18 - vendor/league/flysystem/src/Util.php | 354 ----- .../src/Util/ContentListingFormatter.php | 122 -- vendor/league/flysystem/src/Util/MimeType.php | 80 -- .../flysystem/src/Util/StreamHasher.php | 36 - .../league/mime-type-detection/CHANGELOG.md | 31 - vendor/league/mime-type-detection/LICENSE | 19 - .../league/mime-type-detection/composer.json | 34 - .../src/EmptyExtensionToMimeTypeMap.php | 13 - .../src/ExtensionMimeTypeDetector.php | 42 - .../src/ExtensionToMimeTypeMap.php | 10 - .../src/FinfoMimeTypeDetector.php | 92 -- .../src/GeneratedExtensionToMimeTypeMap.php | 1227 ----------------- .../src/MimeTypeDetector.php | 19 - .../src/OverridingExtensionToMimeTypeMap.php | 30 - vendor/phpmailer/phpmailer/README.md | 1 + vendor/phpmailer/phpmailer/VERSION | 2 +- .../phpmailer/language/phpmailer.lang-el.php | 41 +- vendor/phpmailer/phpmailer/src/PHPMailer.php | 20 +- vendor/phpmailer/phpmailer/src/POP3.php | 2 +- vendor/phpmailer/phpmailer/src/SMTP.php | 2 +- vendor/services.php | 2 +- .../http-foundation/BinaryFileResponse.php | 83 +- vendor/symfony/http-foundation/Request.php | 9 +- vendor/symfony/http-foundation/Response.php | 2 +- vendor/topthink/framework/README.md | 7 +- vendor/topthink/framework/composer.json | 2 - vendor/topthink/framework/src/think/App.php | 3 +- .../topthink/framework/src/think/Console.php | 7 +- .../framework/src/think/Filesystem.php | 89 -- vendor/topthink/framework/src/think/Lang.php | 54 - .../framework/src/think/facade/Filesystem.php | 33 - .../src/think/filesystem/CacheStore.php | 54 - .../framework/src/think/filesystem/Driver.php | 144 -- .../src/think/filesystem/driver/Local.php | 59 - .../src/think/middleware/LoadLangPack.php | 28 +- .../framework/tests/FilesystemTest.php | 131 -- vendor/topthink/think-captcha/composer.json | 2 +- vendor/topthink/think-captcha/src/Captcha.php | 17 +- vendor/topthink/think-multi-app/composer.json | 2 +- vendor/topthink/think-multi-app/src/Url.php | 10 +- 130 files changed, 248 insertions(+), 11164 deletions(-) delete mode 100644 vendor/league/flysystem-cached-adapter/.editorconfig delete mode 100644 vendor/league/flysystem-cached-adapter/.gitignore delete mode 100644 vendor/league/flysystem-cached-adapter/.php_cs delete mode 100644 vendor/league/flysystem-cached-adapter/.scrutinizer.yml delete mode 100644 vendor/league/flysystem-cached-adapter/.travis.yml delete mode 100644 vendor/league/flysystem-cached-adapter/LICENSE delete mode 100644 vendor/league/flysystem-cached-adapter/clover/.gitignore delete mode 100644 vendor/league/flysystem-cached-adapter/composer.json delete mode 100644 vendor/league/flysystem-cached-adapter/phpspec.yml delete mode 100644 vendor/league/flysystem-cached-adapter/phpunit.php delete mode 100644 vendor/league/flysystem-cached-adapter/phpunit.xml delete mode 100644 vendor/league/flysystem-cached-adapter/readme.md delete mode 100644 vendor/league/flysystem-cached-adapter/spec/CachedAdapterSpec.php delete mode 100644 vendor/league/flysystem-cached-adapter/src/CacheInterface.php delete mode 100644 vendor/league/flysystem-cached-adapter/src/CachedAdapter.php delete mode 100644 vendor/league/flysystem-cached-adapter/src/Storage/AbstractCache.php delete mode 100644 vendor/league/flysystem-cached-adapter/src/Storage/Adapter.php delete mode 100644 vendor/league/flysystem-cached-adapter/src/Storage/Memcached.php delete mode 100644 vendor/league/flysystem-cached-adapter/src/Storage/Memory.php delete mode 100644 vendor/league/flysystem-cached-adapter/src/Storage/Noop.php delete mode 100644 vendor/league/flysystem-cached-adapter/src/Storage/PhpRedis.php delete mode 100644 vendor/league/flysystem-cached-adapter/src/Storage/Predis.php delete mode 100644 vendor/league/flysystem-cached-adapter/src/Storage/Psr6Cache.php delete mode 100644 vendor/league/flysystem-cached-adapter/src/Storage/Stash.php delete mode 100644 vendor/league/flysystem-cached-adapter/tests/AdapterCacheTests.php delete mode 100644 vendor/league/flysystem-cached-adapter/tests/InspectionTests.php delete mode 100644 vendor/league/flysystem-cached-adapter/tests/MemcachedTests.php delete mode 100644 vendor/league/flysystem-cached-adapter/tests/MemoryCacheTests.php delete mode 100644 vendor/league/flysystem-cached-adapter/tests/NoopCacheTests.php delete mode 100644 vendor/league/flysystem-cached-adapter/tests/PhpRedisTests.php delete mode 100644 vendor/league/flysystem-cached-adapter/tests/PredisTests.php delete mode 100644 vendor/league/flysystem-cached-adapter/tests/Psr6CacheTest.php delete mode 100644 vendor/league/flysystem-cached-adapter/tests/StashTest.php delete mode 100644 vendor/league/flysystem/CODE_OF_CONDUCT.md delete mode 100644 vendor/league/flysystem/LICENSE delete mode 100644 vendor/league/flysystem/SECURITY.md delete mode 100644 vendor/league/flysystem/composer.json delete mode 100644 vendor/league/flysystem/deprecations.md delete mode 100644 vendor/league/flysystem/src/Adapter/AbstractAdapter.php delete mode 100644 vendor/league/flysystem/src/Adapter/AbstractFtpAdapter.php delete mode 100644 vendor/league/flysystem/src/Adapter/CanOverwriteFiles.php delete mode 100644 vendor/league/flysystem/src/Adapter/Ftp.php delete mode 100644 vendor/league/flysystem/src/Adapter/Ftpd.php delete mode 100644 vendor/league/flysystem/src/Adapter/Local.php delete mode 100644 vendor/league/flysystem/src/Adapter/NullAdapter.php delete mode 100644 vendor/league/flysystem/src/Adapter/Polyfill/NotSupportingVisibilityTrait.php delete mode 100644 vendor/league/flysystem/src/Adapter/Polyfill/StreamedCopyTrait.php delete mode 100644 vendor/league/flysystem/src/Adapter/Polyfill/StreamedReadingTrait.php delete mode 100644 vendor/league/flysystem/src/Adapter/Polyfill/StreamedTrait.php delete mode 100644 vendor/league/flysystem/src/Adapter/Polyfill/StreamedWritingTrait.php delete mode 100644 vendor/league/flysystem/src/Adapter/SynologyFtp.php delete mode 100644 vendor/league/flysystem/src/AdapterInterface.php delete mode 100644 vendor/league/flysystem/src/Config.php delete mode 100644 vendor/league/flysystem/src/ConfigAwareTrait.php delete mode 100644 vendor/league/flysystem/src/ConnectionErrorException.php delete mode 100644 vendor/league/flysystem/src/ConnectionRuntimeException.php delete mode 100644 vendor/league/flysystem/src/CorruptedPathDetected.php delete mode 100644 vendor/league/flysystem/src/Directory.php delete mode 100644 vendor/league/flysystem/src/Exception.php delete mode 100644 vendor/league/flysystem/src/File.php delete mode 100644 vendor/league/flysystem/src/FileExistsException.php delete mode 100644 vendor/league/flysystem/src/FileNotFoundException.php delete mode 100644 vendor/league/flysystem/src/Filesystem.php delete mode 100644 vendor/league/flysystem/src/FilesystemException.php delete mode 100644 vendor/league/flysystem/src/FilesystemInterface.php delete mode 100644 vendor/league/flysystem/src/FilesystemNotFoundException.php delete mode 100644 vendor/league/flysystem/src/Handler.php delete mode 100644 vendor/league/flysystem/src/InvalidRootException.php delete mode 100644 vendor/league/flysystem/src/MountManager.php delete mode 100644 vendor/league/flysystem/src/NotSupportedException.php delete mode 100644 vendor/league/flysystem/src/Plugin/AbstractPlugin.php delete mode 100644 vendor/league/flysystem/src/Plugin/EmptyDir.php delete mode 100644 vendor/league/flysystem/src/Plugin/ForcedCopy.php delete mode 100644 vendor/league/flysystem/src/Plugin/ForcedRename.php delete mode 100644 vendor/league/flysystem/src/Plugin/GetWithMetadata.php delete mode 100644 vendor/league/flysystem/src/Plugin/ListFiles.php delete mode 100644 vendor/league/flysystem/src/Plugin/ListPaths.php delete mode 100644 vendor/league/flysystem/src/Plugin/ListWith.php delete mode 100644 vendor/league/flysystem/src/Plugin/PluggableTrait.php delete mode 100644 vendor/league/flysystem/src/Plugin/PluginNotFoundException.php delete mode 100644 vendor/league/flysystem/src/PluginInterface.php delete mode 100644 vendor/league/flysystem/src/ReadInterface.php delete mode 100644 vendor/league/flysystem/src/RootViolationException.php delete mode 100644 vendor/league/flysystem/src/SafeStorage.php delete mode 100644 vendor/league/flysystem/src/UnreadableFileException.php delete mode 100644 vendor/league/flysystem/src/Util.php delete mode 100644 vendor/league/flysystem/src/Util/ContentListingFormatter.php delete mode 100644 vendor/league/flysystem/src/Util/MimeType.php delete mode 100644 vendor/league/flysystem/src/Util/StreamHasher.php delete mode 100644 vendor/league/mime-type-detection/CHANGELOG.md delete mode 100644 vendor/league/mime-type-detection/LICENSE delete mode 100644 vendor/league/mime-type-detection/composer.json delete mode 100644 vendor/league/mime-type-detection/src/EmptyExtensionToMimeTypeMap.php delete mode 100644 vendor/league/mime-type-detection/src/ExtensionMimeTypeDetector.php delete mode 100644 vendor/league/mime-type-detection/src/ExtensionToMimeTypeMap.php delete mode 100644 vendor/league/mime-type-detection/src/FinfoMimeTypeDetector.php delete mode 100644 vendor/league/mime-type-detection/src/GeneratedExtensionToMimeTypeMap.php delete mode 100644 vendor/league/mime-type-detection/src/MimeTypeDetector.php delete mode 100644 vendor/league/mime-type-detection/src/OverridingExtensionToMimeTypeMap.php delete mode 100644 vendor/topthink/framework/src/think/Filesystem.php delete mode 100644 vendor/topthink/framework/src/think/facade/Filesystem.php delete mode 100644 vendor/topthink/framework/src/think/filesystem/CacheStore.php delete mode 100644 vendor/topthink/framework/src/think/filesystem/Driver.php delete mode 100644 vendor/topthink/framework/src/think/filesystem/driver/Local.php delete mode 100644 vendor/topthink/framework/tests/FilesystemTest.php diff --git a/app/admin/controller/File.php b/app/admin/controller/File.php index 5e7c812..f5c6c18 100644 --- a/app/admin/controller/File.php +++ b/app/admin/controller/File.php @@ -2,15 +2,14 @@ namespace app\admin\controller; - -use app\admin\extend\storage\QcloudCoService; use app\admin\extend\Util as Util; use app\common\model\Attachment; use think\db\exception\DataNotFoundException; use think\db\exception\DbException; use think\db\exception\ModelNotFoundException; use think\exception\ValidateException; -use think\facade\Filesystem; +use think\facade\Config; +use think\File as Filesystem; use think\Request; class File extends AuthController @@ -29,21 +28,39 @@ class File extends AuthController $storage_type = system_config("storage_type") ?: 1;//默认未本地存储 switch ($storage_type) { case 1: - $saveName = Filesystem::putFile($fileType, $file); - $filePath = Filesystem::url($saveName); + // 获取文件基本信息 + $fileInfo = pathinfo($file); + // 获取文件后缀 + $extension = strtolower($file->getOriginalExtension()); + // 获取文件地址和名称 + $filePath = $fileInfo['dirname'] . '/' . $fileInfo['basename']; + // 文件地址转文件类 + $file = new Filesystem($filePath); + // 文件转存目录(按自己喜好定义就行) + $savePath = Config::get('filesystem.disks.public.root').DIRECTORY_SEPARATOR.$fileType.DIRECTORY_SEPARATOR.date('Y-m-d').DIRECTORY_SEPARATOR; + // 新的文件名(按自己喜好生成就行) + $fileName = $file->md5() . '.' . $extension; + //获取文件类型 + $fileMime = $file->getMime(); + //获取文件尺寸 + $fileSize = $file->getSize(); + // 转移临时文件到指定目录 + $file->move( $savePath,$fileName); + //获取新文件地址 + $filePath = Config::get('filesystem.disks.public.url').DIRECTORY_SEPARATOR.$fileType.DIRECTORY_SEPARATOR.date('Y-m-d').DIRECTORY_SEPARATOR.$fileName; //转换因为win导致的兼容问题 if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { $filePath = str_replace(DIRECTORY_SEPARATOR, '/', $filePath); } break; case 2: - $saveName = Filesystem::putFile('image', $file); - $ext = $file->getOriginalExtension(); - $key = '/image/' . date('Ymd') . "/" . substr(md5($file->getRealPath()), 0, 5) . date('YmdHis') . rand(0, 9999) . '.' . $ext; - $filePath = QcloudCoService::put($key, $file->getRealPath()); +// $saveName = Filesystem::putFile('image', $file); +// $ext = $file->getOriginalExtension(); +// $key = '/image/' . date('Ymd') . "/" . substr(md5($file->getRealPath()), 0, 5) . date('YmdHis') . rand(0, 9999) . '.' . $ext; +// $filePath = QcloudCoService::put($key, $file->getRealPath()); break; } - return Attachment::addAttachment($this->request->param("cid", 0), $saveName, $filePath, 'image', $file->getMime(), $file->getSize(), $storage_type) ? app("json")->code()->success("上传成功", ['filePath' => $filePath, "name" => $saveName]) : app("json")->fail("上传失败"); + return Attachment::addAttachment($this->request->param("cid", 0), $fileName, $filePath, 'image', $fileMime, $fileSize, $storage_type) ? app("json")->code()->success("上传成功", ['filePath' => file_cdn($filePath), "name" => $fileName]) : app("json")->fail("上传失败"); } /** @@ -117,13 +134,31 @@ class File extends AuthController 'fileExt' => $fileExt // 更多规则请看“上传验证”的规则,文档地址https://www.kancloud.cn/manual/thinkphp6_0/1037629#_444 ]])->check(['file' => $file]); - $saveName = Filesystem::putFile($fileType, $file); - $filePath = Filesystem::url($saveName); + // 获取文件基本信息 + $fileInfo = pathinfo($file); + // 获取文件后缀 + $extension = strtolower($file->getOriginalExtension()); + // 获取文件地址和名称 + $filePath = $fileInfo['dirname'] . '/' . $fileInfo['basename']; + // 文件地址转文件类 + $file = new Filesystem($filePath); + // 文件转存目录(按自己喜好定义就行) + $savePath = Config::get('filesystem.disks.public.root').DIRECTORY_SEPARATOR.$fileType.DIRECTORY_SEPARATOR.date('Y-m-d').DIRECTORY_SEPARATOR; + // 新的文件名(按自己喜好生成就行) + $fileName = $file->md5() . '.' . $extension; + //获取文件类型 + $fileMime = $file->getMime(); + //获取文件尺寸 + $fileSize = $file->getSize(); + // 转移临时文件到指定目录 + $file->move( $savePath,$fileName); + //获取新文件地址 + $filePath = Config::get('filesystem.disks.public.url').DIRECTORY_SEPARATOR.$fileType.DIRECTORY_SEPARATOR.date('Y-m-d').DIRECTORY_SEPARATOR.$fileName; //转换因为win导致的兼容问题 if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { $filePath = str_replace(DIRECTORY_SEPARATOR, '/', $filePath); } - return $saveName ? app("json")->code()->success("上传成功", ['filePath' => $filePath, "name" => basename($saveName)]) : app("json")->fail("上传失败"); + return Attachment::addAttachment($this->request->param("cid", 0), $fileName, $filePath, $fileType, $fileMime, $fileSize, 1) ? app("json")->code()->success("上传成功", ['filePath' => file_cdn($filePath), "name" => $fileName]) : app("json")->fail("上传失败"); } catch (ValidateException $e) { return app("json")->fail($e->getMessage()); } diff --git a/vendor/composer/autoload_psr4.php b/vendor/composer/autoload_psr4.php index f39169b..12bbf97 100644 --- a/vendor/composer/autoload_psr4.php +++ b/vendor/composer/autoload_psr4.php @@ -23,9 +23,6 @@ return array( 'Psr\\Container\\' => array($vendorDir . '/psr/container/src'), 'Psr\\Cache\\' => array($vendorDir . '/psr/cache/src'), 'PHPMailer\\PHPMailer\\' => array($vendorDir . '/phpmailer/phpmailer/src'), - 'League\\MimeTypeDetection\\' => array($vendorDir . '/league/mime-type-detection/src'), - 'League\\Flysystem\\Cached\\' => array($vendorDir . '/league/flysystem-cached-adapter/src'), - 'League\\Flysystem\\' => array($vendorDir . '/league/flysystem/src'), 'FormBuilder\\' => array($vendorDir . '/xaboy/form-builder/src'), 'Doctrine\\Common\\Lexer\\' => array($vendorDir . '/doctrine/lexer/lib/Doctrine/Common/Lexer'), 'Doctrine\\Common\\Annotations\\' => array($vendorDir . '/doctrine/annotations/lib/Doctrine/Common/Annotations'), diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index 4a0b0ca..cc7d577 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -47,12 +47,6 @@ class ComposerStaticInit4b57298e8d0e895486f3307a354a7e1a 'Psr\\Cache\\' => 10, 'PHPMailer\\PHPMailer\\' => 20, ), - 'L' => - array ( - 'League\\MimeTypeDetection\\' => 25, - 'League\\Flysystem\\Cached\\' => 24, - 'League\\Flysystem\\' => 17, - ), 'F' => array ( 'FormBuilder\\' => 12, @@ -136,18 +130,6 @@ class ComposerStaticInit4b57298e8d0e895486f3307a354a7e1a array ( 0 => __DIR__ . '/..' . '/phpmailer/phpmailer/src', ), - 'League\\MimeTypeDetection\\' => - array ( - 0 => __DIR__ . '/..' . '/league/mime-type-detection/src', - ), - 'League\\Flysystem\\Cached\\' => - array ( - 0 => __DIR__ . '/..' . '/league/flysystem-cached-adapter/src', - ), - 'League\\Flysystem\\' => - array ( - 0 => __DIR__ . '/..' . '/league/flysystem/src', - ), 'FormBuilder\\' => array ( 0 => __DIR__ . '/..' . '/xaboy/form-builder/src', diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index fd2eb61..728d929 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -167,247 +167,19 @@ ], "install-path": "../doctrine/lexer" }, - { - "name": "league/flysystem", - "version": "1.1.9", - "version_normalized": "1.1.9.0", - "source": { - "type": "git", - "url": "https://github.com/thephpleague/flysystem.git", - "reference": "094defdb4a7001845300334e7c1ee2335925ef99" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/094defdb4a7001845300334e7c1ee2335925ef99", - "reference": "094defdb4a7001845300334e7c1ee2335925ef99", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] - }, - "require": { - "ext-fileinfo": "*", - "league/mime-type-detection": "^1.3", - "php": "^7.2.5 || ^8.0" - }, - "conflict": { - "league/flysystem-sftp": "<1.0.6" - }, - "require-dev": { - "phpspec/prophecy": "^1.11.1", - "phpunit/phpunit": "^8.5.8" - }, - "suggest": { - "ext-ftp": "Allows you to use FTP server storage", - "ext-openssl": "Allows you to use FTPS server storage", - "league/flysystem-aws-s3-v2": "Allows you to use S3 storage with AWS SDK v2", - "league/flysystem-aws-s3-v3": "Allows you to use S3 storage with AWS SDK v3", - "league/flysystem-azure": "Allows you to use Windows Azure Blob storage", - "league/flysystem-cached-adapter": "Flysystem adapter decorator for metadata caching", - "league/flysystem-eventable-filesystem": "Allows you to use EventableFilesystem", - "league/flysystem-rackspace": "Allows you to use Rackspace Cloud Files", - "league/flysystem-sftp": "Allows you to use SFTP server storage via phpseclib", - "league/flysystem-webdav": "Allows you to use WebDAV storage", - "league/flysystem-ziparchive": "Allows you to use ZipArchive adapter", - "spatie/flysystem-dropbox": "Allows you to use Dropbox storage", - "srmklive/flysystem-dropbox-v2": "Allows you to use Dropbox storage for PHP 5 applications" - }, - "time": "2021-12-09T09:40:50+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "League\\Flysystem\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Frank de Jonge", - "email": "info@frenky.net" - } - ], - "description": "Filesystem abstraction: Many filesystems, one API.", - "keywords": [ - "Cloud Files", - "WebDAV", - "abstraction", - "aws", - "cloud", - "copy.com", - "dropbox", - "file systems", - "files", - "filesystem", - "filesystems", - "ftp", - "rackspace", - "remote", - "s3", - "sftp", - "storage" - ], - "support": { - "issues": "https://github.com/thephpleague/flysystem/issues", - "source": "https://github.com/thephpleague/flysystem/tree/1.1.9" - }, - "funding": [ - { - "url": "https://offset.earth/frankdejonge", - "type": "other" - } - ], - "install-path": "../league/flysystem" - }, - { - "name": "league/flysystem-cached-adapter", - "version": "1.1.0", - "version_normalized": "1.1.0.0", - "source": { - "type": "git", - "url": "https://github.com/thephpleague/flysystem-cached-adapter.git", - "reference": "d1925efb2207ac4be3ad0c40b8277175f99ffaff" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem-cached-adapter/zipball/d1925efb2207ac4be3ad0c40b8277175f99ffaff", - "reference": "d1925efb2207ac4be3ad0c40b8277175f99ffaff", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] - }, - "require": { - "league/flysystem": "~1.0", - "psr/cache": "^1.0.0" - }, - "require-dev": { - "mockery/mockery": "~0.9", - "phpspec/phpspec": "^3.4", - "phpunit/phpunit": "^5.7", - "predis/predis": "~1.0", - "tedivm/stash": "~0.12" - }, - "suggest": { - "ext-phpredis": "Pure C implemented extension for PHP" - }, - "time": "2020-07-25T15:56:04+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "League\\Flysystem\\Cached\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "frankdejonge", - "email": "info@frenky.net" - } - ], - "description": "An adapter decorator to enable meta-data caching.", - "support": { - "issues": "https://github.com/thephpleague/flysystem-cached-adapter/issues", - "source": "https://github.com/thephpleague/flysystem-cached-adapter/tree/master" - }, - "install-path": "../league/flysystem-cached-adapter" - }, - { - "name": "league/mime-type-detection", - "version": "1.11.0", - "version_normalized": "1.11.0.0", - "source": { - "type": "git", - "url": "https://github.com/thephpleague/mime-type-detection.git", - "reference": "ff6248ea87a9f116e78edd6002e39e5128a0d4dd" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/thephpleague/mime-type-detection/zipball/ff6248ea87a9f116e78edd6002e39e5128a0d4dd", - "reference": "ff6248ea87a9f116e78edd6002e39e5128a0d4dd", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] - }, - "require": { - "ext-fileinfo": "*", - "php": "^7.2 || ^8.0" - }, - "require-dev": { - "friendsofphp/php-cs-fixer": "^3.2", - "phpstan/phpstan": "^0.12.68", - "phpunit/phpunit": "^8.5.8 || ^9.3" - }, - "time": "2022-04-17T13:12:02+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "League\\MimeTypeDetection\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Frank de Jonge", - "email": "info@frankdejonge.nl" - } - ], - "description": "Mime-type detection for Flysystem", - "support": { - "issues": "https://github.com/thephpleague/mime-type-detection/issues", - "source": "https://github.com/thephpleague/mime-type-detection/tree/1.11.0" - }, - "funding": [ - { - "url": "https://github.com/frankdejonge", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/league/flysystem", - "type": "tidelift" - } - ], - "install-path": "../league/mime-type-detection" - }, { "name": "phpmailer/phpmailer", - "version": "v6.6.3", - "version_normalized": "6.6.3.0", + "version": "v6.6.4", + "version_normalized": "6.6.4.0", "source": { "type": "git", "url": "https://github.com/PHPMailer/PHPMailer.git", - "reference": "9400f305a898f194caff5521f64e5dfa926626f3" + "reference": "a94fdebaea6bd17f51be0c2373ab80d3d681269b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/9400f305a898f194caff5521f64e5dfa926626f3", - "reference": "9400f305a898f194caff5521f64e5dfa926626f3", + "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/a94fdebaea6bd17f51be0c2373ab80d3d681269b", + "reference": "a94fdebaea6bd17f51be0c2373ab80d3d681269b", "shasum": "", "mirrors": [ { @@ -440,7 +212,7 @@ "stevenmaguire/oauth2-microsoft": "Needed for Microsoft XOAUTH2 authentication", "symfony/polyfill-mbstring": "To support UTF-8 if the Mbstring PHP extension is not enabled (^1.2)" }, - "time": "2022-06-20T09:21:02+00:00", + "time": "2022-08-22T09:22:00+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -472,7 +244,7 @@ "description": "PHPMailer is a full-featured email creation and transfer class for PHP", "support": { "issues": "https://github.com/PHPMailer/PHPMailer/issues", - "source": "https://github.com/PHPMailer/PHPMailer/tree/v6.6.3" + "source": "https://github.com/PHPMailer/PHPMailer/tree/v6.6.4" }, "funding": [ { @@ -915,17 +687,17 @@ }, { "name": "symfony/http-foundation", - "version": "v5.4.12", - "version_normalized": "5.4.12.0", + "version": "v5.4.15", + "version_normalized": "5.4.15.0", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "f4bfe9611b113b15d98a43da68ec9b5a00d56791" + "reference": "75bd663ff2db90141bfb733682459d5bbe9e29c3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/f4bfe9611b113b15d98a43da68ec9b5a00d56791", - "reference": "f4bfe9611b113b15d98a43da68ec9b5a00d56791", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/75bd663ff2db90141bfb733682459d5bbe9e29c3", + "reference": "75bd663ff2db90141bfb733682459d5bbe9e29c3", "shasum": "", "mirrors": [ { @@ -952,7 +724,7 @@ "suggest": { "symfony/mime": "To use the file extension guesser" }, - "time": "2022-08-19T07:33:17+00:00", + "time": "2022-10-12T09:43:19+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -980,7 +752,7 @@ "description": "Defines an object-oriented layer for the HTTP specification", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-foundation/tree/v5.4.12" + "source": "https://github.com/symfony/http-foundation/tree/v5.4.15" }, "funding": [ { @@ -1269,17 +1041,17 @@ }, { "name": "symfony/var-dumper", - "version": "v4.4.44", - "version_normalized": "4.4.44.0", + "version": "v4.4.46", + "version_normalized": "4.4.46.0", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "f19951007dae942cc79b979c1fe26bfdfbeb54ed" + "reference": "90425fd98d1ecad98e4b2dca9f54f62069193b15" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/f19951007dae942cc79b979c1fe26bfdfbeb54ed", - "reference": "f19951007dae942cc79b979c1fe26bfdfbeb54ed", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/90425fd98d1ecad98e4b2dca9f54f62069193b15", + "reference": "90425fd98d1ecad98e4b2dca9f54f62069193b15", "shasum": "", "mirrors": [ { @@ -1309,7 +1081,7 @@ "ext-intl": "To show region name in time zone dump", "symfony/console": "To use the ServerDumpCommand and/or the bin/var-dump-server script" }, - "time": "2022-07-20T09:59:04+00:00", + "time": "2022-09-03T23:07:25+00:00", "bin": [ "Resources/bin/var-dump-server" ], @@ -1347,7 +1119,7 @@ "dump" ], "support": { - "source": "https://github.com/symfony/var-dumper/tree/v4.4.44" + "source": "https://github.com/symfony/var-dumper/tree/v4.4.46" }, "funding": [ { @@ -1367,17 +1139,17 @@ }, { "name": "topthink/framework", - "version": "v6.0.13", - "version_normalized": "6.0.13.0", + "version": "v6.1.1", + "version_normalized": "6.1.1.0", "source": { "type": "git", "url": "https://github.com/top-think/framework.git", - "reference": "126d5b2cbacb73d6e2a85cbc7a2c6ee59d0b3fa6" + "reference": "2cb56f3e6f3c479fe90ea5f28d38d3b5ef6c4210" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/top-think/framework/zipball/126d5b2cbacb73d6e2a85cbc7a2c6ee59d0b3fa6", - "reference": "126d5b2cbacb73d6e2a85cbc7a2c6ee59d0b3fa6", + "url": "https://api.github.com/repos/top-think/framework/zipball/2cb56f3e6f3c479fe90ea5f28d38d3b5ef6c4210", + "reference": "2cb56f3e6f3c479fe90ea5f28d38d3b5ef6c4210", "shasum": "", "mirrors": [ { @@ -1389,8 +1161,6 @@ "require": { "ext-json": "*", "ext-mbstring": "*", - "league/flysystem": "^1.1.4", - "league/flysystem-cached-adapter": "^1.0", "php": ">=7.2.5", "psr/container": "~1.0", "psr/http-message": "^1.0", @@ -1405,7 +1175,7 @@ "mockery/mockery": "^1.2", "phpunit/phpunit": "^7.0" }, - "time": "2022-07-15T02:52:08+00:00", + "time": "2022-10-26T03:48:53+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -1437,23 +1207,23 @@ ], "support": { "issues": "https://github.com/top-think/framework/issues", - "source": "https://github.com/top-think/framework/tree/v6.0.13" + "source": "https://github.com/top-think/framework/tree/v6.1.1" }, "install-path": "../topthink/framework" }, { "name": "topthink/think-captcha", - "version": "v3.0.7", - "version_normalized": "3.0.7.0", + "version": "v3.0.8", + "version_normalized": "3.0.8.0", "source": { "type": "git", "url": "https://github.com/top-think/think-captcha.git", - "reference": "a450602932a5d9ba183e288b79921ba3b9a92331" + "reference": "52fba122c953995bec3013c635025172491ae299" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/top-think/think-captcha/zipball/a450602932a5d9ba183e288b79921ba3b9a92331", - "reference": "a450602932a5d9ba183e288b79921ba3b9a92331", + "url": "https://api.github.com/repos/top-think/think-captcha/zipball/52fba122c953995bec3013c635025172491ae299", + "reference": "52fba122c953995bec3013c635025172491ae299", "shasum": "", "mirrors": [ { @@ -1463,9 +1233,9 @@ ] }, "require": { - "topthink/framework": "^6.0.0" + "topthink/framework": "^6.0" }, - "time": "2022-04-23T02:38:14+00:00", + "time": "2022-10-26T07:59:42+00:00", "type": "library", "extra": { "think": { @@ -1499,7 +1269,7 @@ "description": "captcha package for thinkphp", "support": { "issues": "https://github.com/top-think/think-captcha/issues", - "source": "https://github.com/top-think/think-captcha/tree/v3.0.7" + "source": "https://github.com/top-think/think-captcha/tree/v3.0.8" }, "install-path": "../topthink/think-captcha" }, @@ -1560,17 +1330,17 @@ }, { "name": "topthink/think-multi-app", - "version": "v1.0.14", - "version_normalized": "1.0.14.0", + "version": "v1.0.15", + "version_normalized": "1.0.15.0", "source": { "type": "git", "url": "https://github.com/top-think/think-multi-app.git", - "reference": "ccaad7c2d33f42cb1cc2a78d6610aaec02cea4c3" + "reference": "387e0dac059c20f92cac5da41a871e10829c1c97" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/top-think/think-multi-app/zipball/ccaad7c2d33f42cb1cc2a78d6610aaec02cea4c3", - "reference": "ccaad7c2d33f42cb1cc2a78d6610aaec02cea4c3", + "url": "https://api.github.com/repos/top-think/think-multi-app/zipball/387e0dac059c20f92cac5da41a871e10829c1c97", + "reference": "387e0dac059c20f92cac5da41a871e10829c1c97", "shasum": "", "mirrors": [ { @@ -1581,9 +1351,9 @@ }, "require": { "php": ">=7.1.0", - "topthink/framework": "^6.0.0" + "topthink/framework": "^6.0" }, - "time": "2020-07-12T13:50:37+00:00", + "time": "2022-10-26T08:03:06+00:00", "type": "library", "extra": { "think": { @@ -1611,7 +1381,7 @@ "description": "thinkphp6 multi app support", "support": { "issues": "https://github.com/top-think/think-multi-app/issues", - "source": "https://github.com/top-think/think-multi-app/tree/master" + "source": "https://github.com/top-think/think-multi-app/tree/v1.0.15" }, "install-path": "../topthink/think-multi-app" }, diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index 767c1a5..89292c0 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -3,7 +3,7 @@ 'name' => 'topthink/think', 'pretty_version' => 'dev-master', 'version' => 'dev-master', - 'reference' => 'ecdf50d35553ba71e48f82e41d38feb090fd0f7b', + 'reference' => '79c3c9ec53e5564fa6f2d96d7bc96fecde590cf8', 'type' => 'project', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), @@ -28,37 +28,10 @@ 'aliases' => array(), 'dev_requirement' => false, ), - 'league/flysystem' => array( - 'pretty_version' => '1.1.9', - 'version' => '1.1.9.0', - 'reference' => '094defdb4a7001845300334e7c1ee2335925ef99', - 'type' => 'library', - 'install_path' => __DIR__ . '/../league/flysystem', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'league/flysystem-cached-adapter' => array( - 'pretty_version' => '1.1.0', - 'version' => '1.1.0.0', - 'reference' => 'd1925efb2207ac4be3ad0c40b8277175f99ffaff', - 'type' => 'library', - 'install_path' => __DIR__ . '/../league/flysystem-cached-adapter', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'league/mime-type-detection' => array( - 'pretty_version' => '1.11.0', - 'version' => '1.11.0.0', - 'reference' => 'ff6248ea87a9f116e78edd6002e39e5128a0d4dd', - 'type' => 'library', - 'install_path' => __DIR__ . '/../league/mime-type-detection', - 'aliases' => array(), - 'dev_requirement' => false, - ), 'phpmailer/phpmailer' => array( - 'pretty_version' => 'v6.6.3', - 'version' => '6.6.3.0', - 'reference' => '9400f305a898f194caff5521f64e5dfa926626f3', + 'pretty_version' => 'v6.6.4', + 'version' => '6.6.4.0', + 'reference' => 'a94fdebaea6bd17f51be0c2373ab80d3d681269b', 'type' => 'library', 'install_path' => __DIR__ . '/../phpmailer/phpmailer', 'aliases' => array(), @@ -128,9 +101,9 @@ 'dev_requirement' => false, ), 'symfony/http-foundation' => array( - 'pretty_version' => 'v5.4.12', - 'version' => '5.4.12.0', - 'reference' => 'f4bfe9611b113b15d98a43da68ec9b5a00d56791', + 'pretty_version' => 'v5.4.15', + 'version' => '5.4.15.0', + 'reference' => '75bd663ff2db90141bfb733682459d5bbe9e29c3', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/http-foundation', 'aliases' => array(), @@ -164,18 +137,18 @@ 'dev_requirement' => false, ), 'symfony/var-dumper' => array( - 'pretty_version' => 'v4.4.44', - 'version' => '4.4.44.0', - 'reference' => 'f19951007dae942cc79b979c1fe26bfdfbeb54ed', + 'pretty_version' => 'v4.4.46', + 'version' => '4.4.46.0', + 'reference' => '90425fd98d1ecad98e4b2dca9f54f62069193b15', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/var-dumper', 'aliases' => array(), 'dev_requirement' => true, ), 'topthink/framework' => array( - 'pretty_version' => 'v6.0.13', - 'version' => '6.0.13.0', - 'reference' => '126d5b2cbacb73d6e2a85cbc7a2c6ee59d0b3fa6', + 'pretty_version' => 'v6.1.1', + 'version' => '6.1.1.0', + 'reference' => '2cb56f3e6f3c479fe90ea5f28d38d3b5ef6c4210', 'type' => 'library', 'install_path' => __DIR__ . '/../topthink/framework', 'aliases' => array(), @@ -184,16 +157,16 @@ 'topthink/think' => array( 'pretty_version' => 'dev-master', 'version' => 'dev-master', - 'reference' => 'ecdf50d35553ba71e48f82e41d38feb090fd0f7b', + 'reference' => '79c3c9ec53e5564fa6f2d96d7bc96fecde590cf8', 'type' => 'project', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), 'dev_requirement' => false, ), 'topthink/think-captcha' => array( - 'pretty_version' => 'v3.0.7', - 'version' => '3.0.7.0', - 'reference' => 'a450602932a5d9ba183e288b79921ba3b9a92331', + 'pretty_version' => 'v3.0.8', + 'version' => '3.0.8.0', + 'reference' => '52fba122c953995bec3013c635025172491ae299', 'type' => 'library', 'install_path' => __DIR__ . '/../topthink/think-captcha', 'aliases' => array(), @@ -209,9 +182,9 @@ 'dev_requirement' => false, ), 'topthink/think-multi-app' => array( - 'pretty_version' => 'v1.0.14', - 'version' => '1.0.14.0', - 'reference' => 'ccaad7c2d33f42cb1cc2a78d6610aaec02cea4c3', + 'pretty_version' => 'v1.0.15', + 'version' => '1.0.15.0', + 'reference' => '387e0dac059c20f92cac5da41a871e10829c1c97', 'type' => 'library', 'install_path' => __DIR__ . '/../topthink/think-multi-app', 'aliases' => array(), diff --git a/vendor/league/flysystem-cached-adapter/.editorconfig b/vendor/league/flysystem-cached-adapter/.editorconfig deleted file mode 100644 index 153cf3e..0000000 --- a/vendor/league/flysystem-cached-adapter/.editorconfig +++ /dev/null @@ -1,10 +0,0 @@ -; top-most EditorConfig file -root = true - -; Unix-style newlines -[*] -end_of_line = LF - -[*.php] -indent_style = space -indent_size = 4 diff --git a/vendor/league/flysystem-cached-adapter/.gitignore b/vendor/league/flysystem-cached-adapter/.gitignore deleted file mode 100644 index 7aea75f..0000000 --- a/vendor/league/flysystem-cached-adapter/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -coverage -coverage.xml -composer.lock -vendor \ No newline at end of file diff --git a/vendor/league/flysystem-cached-adapter/.php_cs b/vendor/league/flysystem-cached-adapter/.php_cs deleted file mode 100644 index 6643a32..0000000 --- a/vendor/league/flysystem-cached-adapter/.php_cs +++ /dev/null @@ -1,7 +0,0 @@ -level(Symfony\CS\FixerInterface::PSR2_LEVEL) - ->fixers(['-yoda_conditions', 'ordered_use', 'short_array_syntax']) - ->finder(Symfony\CS\Finder\DefaultFinder::create() - ->in(__DIR__.'/src/')); \ No newline at end of file diff --git a/vendor/league/flysystem-cached-adapter/.scrutinizer.yml b/vendor/league/flysystem-cached-adapter/.scrutinizer.yml deleted file mode 100644 index fa39b52..0000000 --- a/vendor/league/flysystem-cached-adapter/.scrutinizer.yml +++ /dev/null @@ -1,34 +0,0 @@ -filter: - paths: [src/*] -checks: - php: - code_rating: true - remove_extra_empty_lines: true - remove_php_closing_tag: true - remove_trailing_whitespace: true - fix_use_statements: - remove_unused: true - preserve_multiple: false - preserve_blanklines: true - order_alphabetically: true - fix_php_opening_tag: true - fix_linefeed: true - fix_line_ending: true - fix_identation_4spaces: true - fix_doc_comments: true -tools: - external_code_coverage: - timeout: 900 - runs: 6 - php_code_coverage: false - php_code_sniffer: - config: - standard: PSR2 - filter: - paths: ['src'] - php_loc: - enabled: true - excluded_dirs: [vendor, spec, stubs] - php_cpd: - enabled: true - excluded_dirs: [vendor, spec, stubs] \ No newline at end of file diff --git a/vendor/league/flysystem-cached-adapter/.travis.yml b/vendor/league/flysystem-cached-adapter/.travis.yml deleted file mode 100644 index 6706449..0000000 --- a/vendor/league/flysystem-cached-adapter/.travis.yml +++ /dev/null @@ -1,29 +0,0 @@ -language: php - -php: - - 5.5 - - 5.6 - - 7.0 - - 7.1 - - 7.2 - -matrix: - allow_failures: - - php: 5.5 - -env: - - COMPOSER_OPTS="" - - COMPOSER_OPTS="--prefer-lowest" - -install: - - if [[ "${TRAVIS_PHP_VERSION}" == "5.5" ]]; then composer require phpunit/phpunit:^4.8.36 phpspec/phpspec:^2 --prefer-dist --update-with-dependencies; fi - - if [[ "${TRAVIS_PHP_VERSION}" == "7.2" ]]; then composer require phpunit/phpunit:^6.0 --prefer-dist --update-with-dependencies; fi - - travis_retry composer update --prefer-dist $COMPOSER_OPTS - -script: - - vendor/bin/phpspec run - - vendor/bin/phpunit - -after_script: - - wget https://scrutinizer-ci.com/ocular.phar' - - php ocular.phar code-coverage:upload --format=php-clover ./clover/phpunit.xml' diff --git a/vendor/league/flysystem-cached-adapter/LICENSE b/vendor/league/flysystem-cached-adapter/LICENSE deleted file mode 100644 index 666f6c8..0000000 --- a/vendor/league/flysystem-cached-adapter/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2015 Frank de Jonge - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/league/flysystem-cached-adapter/clover/.gitignore b/vendor/league/flysystem-cached-adapter/clover/.gitignore deleted file mode 100644 index d6b7ef3..0000000 --- a/vendor/league/flysystem-cached-adapter/clover/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -* -!.gitignore diff --git a/vendor/league/flysystem-cached-adapter/composer.json b/vendor/league/flysystem-cached-adapter/composer.json deleted file mode 100644 index df7fb7f..0000000 --- a/vendor/league/flysystem-cached-adapter/composer.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "name": "league/flysystem-cached-adapter", - "description": "An adapter decorator to enable meta-data caching.", - "autoload": { - "psr-4": { - "League\\Flysystem\\Cached\\": "src/" - } - }, - "require": { - "league/flysystem": "~1.0", - "psr/cache": "^1.0.0" - }, - "require-dev": { - "phpspec/phpspec": "^3.4", - "phpunit/phpunit": "^5.7", - "mockery/mockery": "~0.9", - "predis/predis": "~1.0", - "tedivm/stash": "~0.12" - }, - "suggest": { - "ext-phpredis": "Pure C implemented extension for PHP" - }, - "license": "MIT", - "authors": [ - { - "name": "frankdejonge", - "email": "info@frenky.net" - } - ] -} diff --git a/vendor/league/flysystem-cached-adapter/phpspec.yml b/vendor/league/flysystem-cached-adapter/phpspec.yml deleted file mode 100644 index 5eabcb2..0000000 --- a/vendor/league/flysystem-cached-adapter/phpspec.yml +++ /dev/null @@ -1,6 +0,0 @@ ---- -suites: - cached_adapter_suite: - namespace: League\Flysystem\Cached - psr4_prefix: League\Flysystem\Cached -formatter.name: pretty diff --git a/vendor/league/flysystem-cached-adapter/phpunit.php b/vendor/league/flysystem-cached-adapter/phpunit.php deleted file mode 100644 index d109587..0000000 --- a/vendor/league/flysystem-cached-adapter/phpunit.php +++ /dev/null @@ -1,3 +0,0 @@ - - - - - ./tests/ - - - - - ./src/ - - - - - - - - diff --git a/vendor/league/flysystem-cached-adapter/readme.md b/vendor/league/flysystem-cached-adapter/readme.md deleted file mode 100644 index dd1433d..0000000 --- a/vendor/league/flysystem-cached-adapter/readme.md +++ /dev/null @@ -1,20 +0,0 @@ -# Flysystem Cached CachedAdapter - -[![Author](http://img.shields.io/badge/author-@frankdejonge-blue.svg?style=flat-square)](https://twitter.com/frankdejonge) -[![Build Status](https://img.shields.io/travis/thephpleague/flysystem-cached-adapter/master.svg?style=flat-square)](https://travis-ci.org/thephpleague/flysystem-cached-adapter) -[![Coverage Status](https://img.shields.io/scrutinizer/coverage/g/thephpleague/flysystem-cached-adapter.svg?style=flat-square)](https://scrutinizer-ci.com/g/thephpleague/flysystem-cached-adapter/code-structure) -[![Quality Score](https://img.shields.io/scrutinizer/g/thephpleague/flysystem-cached-adapter.svg?style=flat-square)](https://scrutinizer-ci.com/g/thephpleague/flysystem-cached-adapter) -[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE) -[![Packagist Version](https://img.shields.io/packagist/v/league/flysystem-cached-adapter.svg?style=flat-square)](https://packagist.org/packages/league/flysystem-cached-adapter) -[![Total Downloads](https://img.shields.io/packagist/dt/league/flysystem-cached-adapter.svg?style=flat-square)](https://packagist.org/packages/league/flysystem-cached-adapter) - - -The adapter decorator caches metadata and directory listings. - -```bash -composer require league/flysystem-cached-adapter -``` - -## Usage - -[Check out the docs.](https://flysystem.thephpleague.com/docs/advanced/caching/) diff --git a/vendor/league/flysystem-cached-adapter/spec/CachedAdapterSpec.php b/vendor/league/flysystem-cached-adapter/spec/CachedAdapterSpec.php deleted file mode 100644 index 69428d9..0000000 --- a/vendor/league/flysystem-cached-adapter/spec/CachedAdapterSpec.php +++ /dev/null @@ -1,435 +0,0 @@ -adapter = $adapter; - $this->cache = $cache; - $this->cache->load()->shouldBeCalled(); - $this->beConstructedWith($adapter, $cache); - } - - public function it_is_initializable() - { - $this->shouldHaveType('League\Flysystem\Cached\CachedAdapter'); - $this->shouldHaveType('League\Flysystem\AdapterInterface'); - } - - public function it_should_forward_read_streams() - { - $path = 'path.txt'; - $response = ['path' => $path]; - $this->adapter->readStream($path)->willReturn($response); - $this->readStream($path)->shouldbe($response); - } - - public function it_should_cache_writes() - { - $type = 'file'; - $path = 'path.txt'; - $contents = 'contents'; - $config = new Config(); - $response = compact('path', 'contents', 'type'); - $this->adapter->write($path, $contents, $config)->willReturn($response); - $this->cache->updateObject($path, $response, true)->shouldBeCalled(); - $this->write($path, $contents, $config)->shouldBe($response); - } - - public function it_should_cache_streamed_writes() - { - $type = 'file'; - $path = 'path.txt'; - $stream = tmpfile(); - $config = new Config(); - $response = compact('path', 'stream', 'type'); - $this->adapter->writeStream($path, $stream, $config)->willReturn($response); - $this->cache->updateObject($path, ['contents' => false] + $response, true)->shouldBeCalled(); - $this->writeStream($path, $stream, $config)->shouldBe($response); - fclose($stream); - } - - public function it_should_cache_streamed_updates() - { - $type = 'file'; - $path = 'path.txt'; - $stream = tmpfile(); - $config = new Config(); - $response = compact('path', 'stream', 'type'); - $this->adapter->updateStream($path, $stream, $config)->willReturn($response); - $this->cache->updateObject($path, ['contents' => false] + $response, true)->shouldBeCalled(); - $this->updateStream($path, $stream, $config)->shouldBe($response); - fclose($stream); - } - - public function it_should_ignore_failed_writes() - { - $path = 'path.txt'; - $contents = 'contents'; - $config = new Config(); - $this->adapter->write($path, $contents, $config)->willReturn(false); - $this->write($path, $contents, $config)->shouldBe(false); - } - - public function it_should_ignore_failed_streamed_writes() - { - $path = 'path.txt'; - $contents = tmpfile(); - $config = new Config(); - $this->adapter->writeStream($path, $contents, $config)->willReturn(false); - $this->writeStream($path, $contents, $config)->shouldBe(false); - fclose($contents); - } - - public function it_should_cache_updated() - { - $type = 'file'; - $path = 'path.txt'; - $contents = 'contents'; - $config = new Config(); - $response = compact('path', 'contents', 'type'); - $this->adapter->update($path, $contents, $config)->willReturn($response); - $this->cache->updateObject($path, $response, true)->shouldBeCalled(); - $this->update($path, $contents, $config)->shouldBe($response); - } - - public function it_should_ignore_failed_updates() - { - $path = 'path.txt'; - $contents = 'contents'; - $config = new Config(); - $this->adapter->update($path, $contents, $config)->willReturn(false); - $this->update($path, $contents, $config)->shouldBe(false); - } - - public function it_should_ignore_failed_streamed_updates() - { - $path = 'path.txt'; - $contents = tmpfile(); - $config = new Config(); - $this->adapter->updateStream($path, $contents, $config)->willReturn(false); - $this->updateStream($path, $contents, $config)->shouldBe(false); - fclose($contents); - } - - public function it_should_cache_renames() - { - $old = 'old.txt'; - $new = 'new.txt'; - $this->adapter->rename($old, $new)->willReturn(true); - $this->cache->rename($old, $new)->shouldBeCalled(); - $this->rename($old, $new)->shouldBe(true); - } - - public function it_should_ignore_rename_fails() - { - $old = 'old.txt'; - $new = 'new.txt'; - $this->adapter->rename($old, $new)->willReturn(false); - $this->rename($old, $new)->shouldBe(false); - } - - public function it_should_cache_copies() - { - $old = 'old.txt'; - $new = 'new.txt'; - $this->adapter->copy($old, $new)->willReturn(true); - $this->cache->copy($old, $new)->shouldBeCalled(); - $this->copy($old, $new)->shouldBe(true); - } - - public function it_should_ignore_copy_fails() - { - $old = 'old.txt'; - $new = 'new.txt'; - $this->adapter->copy($old, $new)->willReturn(false); - $this->copy($old, $new)->shouldBe(false); - } - - public function it_should_cache_deletes() - { - $delete = 'delete.txt'; - $this->adapter->delete($delete)->willReturn(true); - $this->cache->delete($delete)->shouldBeCalled(); - $this->delete($delete)->shouldBe(true); - } - - public function it_should_ignore_delete_fails() - { - $delete = 'delete.txt'; - $this->adapter->delete($delete)->willReturn(false); - $this->delete($delete)->shouldBe(false); - } - - public function it_should_cache_dir_deletes() - { - $delete = 'delete'; - $this->adapter->deleteDir($delete)->willReturn(true); - $this->cache->deleteDir($delete)->shouldBeCalled(); - $this->deleteDir($delete)->shouldBe(true); - } - - public function it_should_ignore_delete_dir_fails() - { - $delete = 'delete'; - $this->adapter->deleteDir($delete)->willReturn(false); - $this->deleteDir($delete)->shouldBe(false); - } - - public function it_should_cache_dir_creates() - { - $dirname = 'dirname'; - $config = new Config(); - $response = ['path' => $dirname, 'type' => 'dir']; - $this->adapter->createDir($dirname, $config)->willReturn($response); - $this->cache->updateObject($dirname, $response, true)->shouldBeCalled(); - $this->createDir($dirname, $config)->shouldBe($response); - } - - public function it_should_ignore_create_dir_fails() - { - $dirname = 'dirname'; - $config = new Config(); - $this->adapter->createDir($dirname, $config)->willReturn(false); - $this->createDir($dirname, $config)->shouldBe(false); - } - - public function it_should_cache_set_visibility() - { - $path = 'path.txt'; - $visibility = AdapterInterface::VISIBILITY_PUBLIC; - $this->adapter->setVisibility($path, $visibility)->willReturn(true); - $this->cache->updateObject($path, ['path' => $path, 'visibility' => $visibility], true)->shouldBeCalled(); - $this->setVisibility($path, $visibility)->shouldBe(true); - } - - public function it_should_ignore_set_visibility_fails() - { - $dirname = 'delete'; - $visibility = AdapterInterface::VISIBILITY_PUBLIC; - $this->adapter->setVisibility($dirname, $visibility)->willReturn(false); - $this->setVisibility($dirname, $visibility)->shouldBe(false); - } - - public function it_should_indicate_missing_files() - { - $this->cache->has($path = 'path.txt')->willReturn(false); - $this->has($path)->shouldBe(false); - } - - public function it_should_indicate_file_existance() - { - $this->cache->has($path = 'path.txt')->willReturn(true); - $this->has($path)->shouldBe(true); - } - - public function it_should_cache_missing_files() - { - $this->cache->has($path = 'path.txt')->willReturn(null); - $this->adapter->has($path)->willReturn(false); - $this->cache->storeMiss($path)->shouldBeCalled(); - $this->has($path)->shouldBe(false); - } - - public function it_should_delete_when_metadata_is_missing() - { - $path = 'path.txt'; - $this->cache->has($path)->willReturn(true); - $this->cache->getSize($path)->willReturn(['path' => $path]); - $this->adapter->getSize($path)->willReturn($response = ['path' => $path, 'size' => 1024]); - $this->cache->updateObject($path, $response, true)->shouldBeCalled(); - $this->getSize($path)->shouldBe($response); - } - - public function it_should_cache_has() - { - $this->cache->has($path = 'path.txt')->willReturn(null); - $this->adapter->has($path)->willReturn(true); - $this->cache->updateObject($path, compact('path'), true)->shouldBeCalled(); - $this->has($path)->shouldBe(true); - } - - public function it_should_list_cached_contents() - { - $this->cache->isComplete($dirname = 'dirname', $recursive = true)->willReturn(true); - $response = [['path' => 'path.txt']]; - $this->cache->listContents($dirname, $recursive)->willReturn($response); - $this->listContents($dirname, $recursive)->shouldBe($response); - } - - public function it_should_ignore_failed_list_contents() - { - $this->cache->isComplete($dirname = 'dirname', $recursive = true)->willReturn(false); - $this->adapter->listContents($dirname, $recursive)->willReturn(false); - $this->listContents($dirname, $recursive)->shouldBe(false); - } - - public function it_should_cache_contents_listings() - { - $this->cache->isComplete($dirname = 'dirname', $recursive = true)->willReturn(false); - $response = [['path' => 'path.txt']]; - $this->adapter->listContents($dirname, $recursive)->willReturn($response); - $this->cache->storeContents($dirname, $response, $recursive)->shouldBeCalled(); - $this->listContents($dirname, $recursive)->shouldBe($response); - } - - public function it_should_use_cached_visibility() - { - $this->make_it_use_getter_cache('getVisibility', 'path.txt', [ - 'path' => 'path.txt', - 'visibility' => AdapterInterface::VISIBILITY_PUBLIC, - ]); - } - - public function it_should_cache_get_visibility() - { - $path = 'path.txt'; - $response = ['visibility' => AdapterInterface::VISIBILITY_PUBLIC, 'path' => $path]; - $this->make_it_cache_getter('getVisibility', $path, $response); - } - - public function it_should_ignore_failed_get_visibility() - { - $path = 'path.txt'; - $this->make_it_ignore_failed_getter('getVisibility', $path); - } - - public function it_should_use_cached_timestamp() - { - $this->make_it_use_getter_cache('getTimestamp', 'path.txt', [ - 'path' => 'path.txt', - 'timestamp' => 1234, - ]); - } - - public function it_should_cache_timestamps() - { - $this->make_it_cache_getter('getTimestamp', 'path.txt', [ - 'path' => 'path.txt', - 'timestamp' => 1234, - ]); - } - - public function it_should_ignore_failed_get_timestamps() - { - $this->make_it_ignore_failed_getter('getTimestamp', 'path.txt'); - } - - public function it_should_cache_get_metadata() - { - $path = 'path.txt'; - $response = ['visibility' => AdapterInterface::VISIBILITY_PUBLIC, 'path' => $path]; - $this->make_it_cache_getter('getMetadata', $path, $response); - } - - public function it_should_use_cached_metadata() - { - $this->make_it_use_getter_cache('getMetadata', 'path.txt', [ - 'path' => 'path.txt', - 'timestamp' => 1234, - ]); - } - - public function it_should_ignore_failed_get_metadata() - { - $this->make_it_ignore_failed_getter('getMetadata', 'path.txt'); - } - - public function it_should_cache_get_size() - { - $path = 'path.txt'; - $response = ['size' => 1234, 'path' => $path]; - $this->make_it_cache_getter('getSize', $path, $response); - } - - public function it_should_use_cached_size() - { - $this->make_it_use_getter_cache('getSize', 'path.txt', [ - 'path' => 'path.txt', - 'size' => 1234, - ]); - } - - public function it_should_ignore_failed_get_size() - { - $this->make_it_ignore_failed_getter('getSize', 'path.txt'); - } - - public function it_should_cache_get_mimetype() - { - $path = 'path.txt'; - $response = ['mimetype' => 'text/plain', 'path' => $path]; - $this->make_it_cache_getter('getMimetype', $path, $response); - } - - public function it_should_use_cached_mimetype() - { - $this->make_it_use_getter_cache('getMimetype', 'path.txt', [ - 'path' => 'path.txt', - 'mimetype' => 'text/plain', - ]); - } - - public function it_should_ignore_failed_get_mimetype() - { - $this->make_it_ignore_failed_getter('getMimetype', 'path.txt'); - } - - public function it_should_cache_reads() - { - $path = 'path.txt'; - $response = ['path' => $path, 'contents' => 'contents']; - $this->make_it_cache_getter('read', $path, $response); - } - - public function it_should_use_cached_file_contents() - { - $this->make_it_use_getter_cache('read', 'path.txt', [ - 'path' => 'path.txt', - 'contents' => 'contents' - ]); - } - - public function it_should_ignore_failed_reads() - { - $this->make_it_ignore_failed_getter('read', 'path.txt'); - } - - protected function make_it_use_getter_cache($method, $path, $response) - { - $this->cache->{$method}($path)->willReturn($response); - $this->{$method}($path)->shouldBe($response); - } - - protected function make_it_cache_getter($method, $path, $response) - { - $this->cache->{$method}($path)->willReturn(false); - $this->adapter->{$method}($path)->willReturn($response); - $this->cache->updateObject($path, $response, true)->shouldBeCalled(); - $this->{$method}($path)->shouldBe($response); - } - - protected function make_it_ignore_failed_getter($method, $path) - { - $this->cache->{$method}($path)->willReturn(false); - $this->adapter->{$method}($path)->willReturn(false); - $this->{$method}($path)->shouldBe(false); - } -} diff --git a/vendor/league/flysystem-cached-adapter/src/CacheInterface.php b/vendor/league/flysystem-cached-adapter/src/CacheInterface.php deleted file mode 100644 index de3ab3d..0000000 --- a/vendor/league/flysystem-cached-adapter/src/CacheInterface.php +++ /dev/null @@ -1,101 +0,0 @@ -adapter = $adapter; - $this->cache = $cache; - $this->cache->load(); - } - - /** - * Get the underlying Adapter implementation. - * - * @return AdapterInterface - */ - public function getAdapter() - { - return $this->adapter; - } - - /** - * Get the used Cache implementation. - * - * @return CacheInterface - */ - public function getCache() - { - return $this->cache; - } - - /** - * {@inheritdoc} - */ - public function write($path, $contents, Config $config) - { - $result = $this->adapter->write($path, $contents, $config); - - if ($result !== false) { - $result['type'] = 'file'; - $this->cache->updateObject($path, $result + compact('path', 'contents'), true); - } - - return $result; - } - - /** - * {@inheritdoc} - */ - public function writeStream($path, $resource, Config $config) - { - $result = $this->adapter->writeStream($path, $resource, $config); - - if ($result !== false) { - $result['type'] = 'file'; - $contents = false; - $this->cache->updateObject($path, $result + compact('path', 'contents'), true); - } - - return $result; - } - - /** - * {@inheritdoc} - */ - public function update($path, $contents, Config $config) - { - $result = $this->adapter->update($path, $contents, $config); - - if ($result !== false) { - $result['type'] = 'file'; - $this->cache->updateObject($path, $result + compact('path', 'contents'), true); - } - - return $result; - } - - /** - * {@inheritdoc} - */ - public function updateStream($path, $resource, Config $config) - { - $result = $this->adapter->updateStream($path, $resource, $config); - - if ($result !== false) { - $result['type'] = 'file'; - $contents = false; - $this->cache->updateObject($path, $result + compact('path', 'contents'), true); - } - - return $result; - } - - /** - * {@inheritdoc} - */ - public function rename($path, $newPath) - { - $result = $this->adapter->rename($path, $newPath); - - if ($result !== false) { - $this->cache->rename($path, $newPath); - } - - return $result; - } - - /** - * {@inheritdoc} - */ - public function copy($path, $newpath) - { - $result = $this->adapter->copy($path, $newpath); - - if ($result !== false) { - $this->cache->copy($path, $newpath); - } - - return $result; - } - - /** - * {@inheritdoc} - */ - public function delete($path) - { - $result = $this->adapter->delete($path); - - if ($result !== false) { - $this->cache->delete($path); - } - - return $result; - } - - /** - * {@inheritdoc} - */ - public function deleteDir($dirname) - { - $result = $this->adapter->deleteDir($dirname); - - if ($result !== false) { - $this->cache->deleteDir($dirname); - } - - return $result; - } - - /** - * {@inheritdoc} - */ - public function createDir($dirname, Config $config) - { - $result = $this->adapter->createDir($dirname, $config); - - if ($result !== false) { - $type = 'dir'; - $path = $dirname; - $this->cache->updateObject($dirname, compact('path', 'type'), true); - } - - return $result; - } - - /** - * {@inheritdoc} - */ - public function setVisibility($path, $visibility) - { - $result = $this->adapter->setVisibility($path, $visibility); - - if ($result !== false) { - $this->cache->updateObject($path, compact('path', 'visibility'), true); - } - - return $result; - } - - /** - * {@inheritdoc} - */ - public function has($path) - { - $cacheHas = $this->cache->has($path); - - if ($cacheHas !== null) { - return $cacheHas; - } - - $adapterResponse = $this->adapter->has($path); - - if (! $adapterResponse) { - $this->cache->storeMiss($path); - } else { - $cacheEntry = is_array($adapterResponse) ? $adapterResponse : compact('path'); - $this->cache->updateObject($path, $cacheEntry, true); - } - - return $adapterResponse; - } - - /** - * {@inheritdoc} - */ - public function read($path) - { - return $this->callWithFallback('contents', $path, 'read'); - } - - /** - * {@inheritdoc} - */ - public function readStream($path) - { - return $this->adapter->readStream($path); - } - - /** - * Get the path prefix. - * - * @return string|null path prefix or null if pathPrefix is empty - */ - public function getPathPrefix() - { - return $this->adapter->getPathPrefix(); - } - - /** - * Prefix a path. - * - * @param string $path - * - * @return string prefixed path - */ - public function applyPathPrefix($path) - { - return $this->adapter->applyPathPrefix($path); - } - - /** - * {@inheritdoc} - */ - public function listContents($directory = '', $recursive = false) - { - if ($this->cache->isComplete($directory, $recursive)) { - return $this->cache->listContents($directory, $recursive); - } - - $result = $this->adapter->listContents($directory, $recursive); - - if ($result !== false) { - $this->cache->storeContents($directory, $result, $recursive); - } - - return $result; - } - - /** - * {@inheritdoc} - */ - public function getMetadata($path) - { - return $this->callWithFallback(null, $path, 'getMetadata'); - } - - /** - * {@inheritdoc} - */ - public function getSize($path) - { - return $this->callWithFallback('size', $path, 'getSize'); - } - - /** - * {@inheritdoc} - */ - public function getMimetype($path) - { - return $this->callWithFallback('mimetype', $path, 'getMimetype'); - } - - /** - * {@inheritdoc} - */ - public function getTimestamp($path) - { - return $this->callWithFallback('timestamp', $path, 'getTimestamp'); - } - - /** - * {@inheritdoc} - */ - public function getVisibility($path) - { - return $this->callWithFallback('visibility', $path, 'getVisibility'); - } - - /** - * Call a method and cache the response. - * - * @param string $property - * @param string $path - * @param string $method - * - * @return mixed - */ - protected function callWithFallback($property, $path, $method) - { - $result = $this->cache->{$method}($path); - - if ($result !== false && ($property === null || array_key_exists($property, $result))) { - return $result; - } - - $result = $this->adapter->{$method}($path); - - if ($result) { - $object = $result + compact('path'); - $this->cache->updateObject($path, $object, true); - } - - return $result; - } -} diff --git a/vendor/league/flysystem-cached-adapter/src/Storage/AbstractCache.php b/vendor/league/flysystem-cached-adapter/src/Storage/AbstractCache.php deleted file mode 100644 index 141b468..0000000 --- a/vendor/league/flysystem-cached-adapter/src/Storage/AbstractCache.php +++ /dev/null @@ -1,418 +0,0 @@ -autosave) { - $this->save(); - } - } - - /** - * Get the autosave setting. - * - * @return bool autosave - */ - public function getAutosave() - { - return $this->autosave; - } - - /** - * Get the autosave setting. - * - * @param bool $autosave - */ - public function setAutosave($autosave) - { - $this->autosave = $autosave; - } - - /** - * Store the contents listing. - * - * @param string $directory - * @param array $contents - * @param bool $recursive - * - * @return array contents listing - */ - public function storeContents($directory, array $contents, $recursive = false) - { - $directories = [$directory]; - - foreach ($contents as $object) { - $this->updateObject($object['path'], $object); - $object = $this->cache[$object['path']]; - - if ($recursive && $this->pathIsInDirectory($directory, $object['path'])) { - $directories[] = $object['dirname']; - } - } - - foreach (array_unique($directories) as $directory) { - $this->setComplete($directory, $recursive); - } - - $this->autosave(); - } - - /** - * Update the metadata for an object. - * - * @param string $path object path - * @param array $object object metadata - * @param bool $autosave whether to trigger the autosave routine - */ - public function updateObject($path, array $object, $autosave = false) - { - if (! $this->has($path)) { - $this->cache[$path] = Util::pathinfo($path); - } - - $this->cache[$path] = array_merge($this->cache[$path], $object); - - if ($autosave) { - $this->autosave(); - } - - $this->ensureParentDirectories($path); - } - - /** - * Store object hit miss. - * - * @param string $path - */ - public function storeMiss($path) - { - $this->cache[$path] = false; - $this->autosave(); - } - - /** - * Get the contents listing. - * - * @param string $dirname - * @param bool $recursive - * - * @return array contents listing - */ - public function listContents($dirname = '', $recursive = false) - { - $result = []; - - foreach ($this->cache as $object) { - if ($object === false) { - continue; - } - if ($object['dirname'] === $dirname) { - $result[] = $object; - } elseif ($recursive && $this->pathIsInDirectory($dirname, $object['path'])) { - $result[] = $object; - } - } - - return $result; - } - - /** - * {@inheritdoc} - */ - public function has($path) - { - if ($path !== false && array_key_exists($path, $this->cache)) { - return $this->cache[$path] !== false; - } - - if ($this->isComplete(Util::dirname($path), false)) { - return false; - } - } - - /** - * {@inheritdoc} - */ - public function read($path) - { - if (isset($this->cache[$path]['contents']) && $this->cache[$path]['contents'] !== false) { - return $this->cache[$path]; - } - - return false; - } - - /** - * {@inheritdoc} - */ - public function readStream($path) - { - return false; - } - - /** - * {@inheritdoc} - */ - public function rename($path, $newpath) - { - if ($this->has($path)) { - $object = $this->cache[$path]; - unset($this->cache[$path]); - $object['path'] = $newpath; - $object = array_merge($object, Util::pathinfo($newpath)); - $this->cache[$newpath] = $object; - $this->autosave(); - } - } - - /** - * {@inheritdoc} - */ - public function copy($path, $newpath) - { - if ($this->has($path)) { - $object = $this->cache[$path]; - $object = array_merge($object, Util::pathinfo($newpath)); - $this->updateObject($newpath, $object, true); - } - } - - /** - * {@inheritdoc} - */ - public function delete($path) - { - $this->storeMiss($path); - } - - /** - * {@inheritdoc} - */ - public function deleteDir($dirname) - { - foreach ($this->cache as $path => $object) { - if ($this->pathIsInDirectory($dirname, $path) || $path === $dirname) { - unset($this->cache[$path]); - } - } - - unset($this->complete[$dirname]); - - $this->autosave(); - } - - /** - * {@inheritdoc} - */ - public function getMimetype($path) - { - if (isset($this->cache[$path]['mimetype'])) { - return $this->cache[$path]; - } - - if (! $result = $this->read($path)) { - return false; - } - - $mimetype = Util::guessMimeType($path, $result['contents']); - $this->cache[$path]['mimetype'] = $mimetype; - - return $this->cache[$path]; - } - - /** - * {@inheritdoc} - */ - public function getSize($path) - { - if (isset($this->cache[$path]['size'])) { - return $this->cache[$path]; - } - - return false; - } - - /** - * {@inheritdoc} - */ - public function getTimestamp($path) - { - if (isset($this->cache[$path]['timestamp'])) { - return $this->cache[$path]; - } - - return false; - } - - /** - * {@inheritdoc} - */ - public function getVisibility($path) - { - if (isset($this->cache[$path]['visibility'])) { - return $this->cache[$path]; - } - - return false; - } - - /** - * {@inheritdoc} - */ - public function getMetadata($path) - { - if (isset($this->cache[$path]['type'])) { - return $this->cache[$path]; - } - - return false; - } - - /** - * {@inheritdoc} - */ - public function isComplete($dirname, $recursive) - { - if (! array_key_exists($dirname, $this->complete)) { - return false; - } - - if ($recursive && $this->complete[$dirname] !== 'recursive') { - return false; - } - - return true; - } - - /** - * {@inheritdoc} - */ - public function setComplete($dirname, $recursive) - { - $this->complete[$dirname] = $recursive ? 'recursive' : true; - } - - /** - * Filter the contents from a listing. - * - * @param array $contents object listing - * - * @return array filtered contents - */ - public function cleanContents(array $contents) - { - $cachedProperties = array_flip([ - 'path', 'dirname', 'basename', 'extension', 'filename', - 'size', 'mimetype', 'visibility', 'timestamp', 'type', - 'md5', - ]); - - foreach ($contents as $path => $object) { - if (is_array($object)) { - $contents[$path] = array_intersect_key($object, $cachedProperties); - } - } - - return $contents; - } - - /** - * {@inheritdoc} - */ - public function flush() - { - $this->cache = []; - $this->complete = []; - $this->autosave(); - } - - /** - * {@inheritdoc} - */ - public function autosave() - { - if ($this->autosave) { - $this->save(); - } - } - - /** - * Retrieve serialized cache data. - * - * @return string serialized data - */ - public function getForStorage() - { - $cleaned = $this->cleanContents($this->cache); - - return json_encode([$cleaned, $this->complete]); - } - - /** - * Load from serialized cache data. - * - * @param string $json - */ - public function setFromStorage($json) - { - list($cache, $complete) = json_decode($json, true); - - if (json_last_error() === JSON_ERROR_NONE && is_array($cache) && is_array($complete)) { - $this->cache = $cache; - $this->complete = $complete; - } - } - - /** - * Ensure parent directories of an object. - * - * @param string $path object path - */ - public function ensureParentDirectories($path) - { - $object = $this->cache[$path]; - - while ($object['dirname'] !== '' && ! isset($this->cache[$object['dirname']])) { - $object = Util::pathinfo($object['dirname']); - $object['type'] = 'dir'; - $this->cache[$object['path']] = $object; - } - } - - /** - * Determines if the path is inside the directory. - * - * @param string $directory - * @param string $path - * - * @return bool - */ - protected function pathIsInDirectory($directory, $path) - { - return $directory === '' || strpos($path, $directory . '/') === 0; - } -} diff --git a/vendor/league/flysystem-cached-adapter/src/Storage/Adapter.php b/vendor/league/flysystem-cached-adapter/src/Storage/Adapter.php deleted file mode 100644 index 649a60e..0000000 --- a/vendor/league/flysystem-cached-adapter/src/Storage/Adapter.php +++ /dev/null @@ -1,115 +0,0 @@ -adapter = $adapter; - $this->file = $file; - $this->setExpire($expire); - } - - /** - * Set the expiration time in seconds. - * - * @param int $expire relative expiration time - */ - protected function setExpire($expire) - { - if ($expire) { - $this->expire = $this->getTime($expire); - } - } - - /** - * Get expiration time in seconds. - * - * @param int $time relative expiration time - * - * @return int actual expiration time - */ - protected function getTime($time = 0) - { - return intval(microtime(true)) + $time; - } - - /** - * {@inheritdoc} - */ - public function setFromStorage($json) - { - list($cache, $complete, $expire) = json_decode($json, true); - - if (! $expire || $expire > $this->getTime()) { - $this->cache = is_array($cache) ? $cache : []; - $this->complete = is_array($complete) ? $complete : []; - } else { - $this->adapter->delete($this->file); - } - } - - /** - * {@inheritdoc} - */ - public function load() - { - if ($this->adapter->has($this->file)) { - $file = $this->adapter->read($this->file); - if ($file && !empty($file['contents'])) { - $this->setFromStorage($file['contents']); - } - } - } - - /** - * {@inheritdoc} - */ - public function getForStorage() - { - $cleaned = $this->cleanContents($this->cache); - - return json_encode([$cleaned, $this->complete, $this->expire]); - } - - /** - * {@inheritdoc} - */ - public function save() - { - $config = new Config(); - $contents = $this->getForStorage(); - - if ($this->adapter->has($this->file)) { - $this->adapter->update($this->file, $contents, $config); - } else { - $this->adapter->write($this->file, $contents, $config); - } - } -} diff --git a/vendor/league/flysystem-cached-adapter/src/Storage/Memcached.php b/vendor/league/flysystem-cached-adapter/src/Storage/Memcached.php deleted file mode 100644 index f67d271..0000000 --- a/vendor/league/flysystem-cached-adapter/src/Storage/Memcached.php +++ /dev/null @@ -1,59 +0,0 @@ -key = $key; - $this->expire = $expire; - $this->memcached = $memcached; - } - - /** - * {@inheritdoc} - */ - public function load() - { - $contents = $this->memcached->get($this->key); - - if ($contents !== false) { - $this->setFromStorage($contents); - } - } - - /** - * {@inheritdoc} - */ - public function save() - { - $contents = $this->getForStorage(); - $expiration = $this->expire === null ? 0 : time() + $this->expire; - $this->memcached->set($this->key, $contents, $expiration); - } -} diff --git a/vendor/league/flysystem-cached-adapter/src/Storage/Memory.php b/vendor/league/flysystem-cached-adapter/src/Storage/Memory.php deleted file mode 100644 index d0914fa..0000000 --- a/vendor/league/flysystem-cached-adapter/src/Storage/Memory.php +++ /dev/null @@ -1,22 +0,0 @@ -client = $client ?: new Redis(); - $this->key = $key; - $this->expire = $expire; - } - - /** - * {@inheritdoc} - */ - public function load() - { - $contents = $this->client->get($this->key); - - if ($contents !== false) { - $this->setFromStorage($contents); - } - } - - /** - * {@inheritdoc} - */ - public function save() - { - $contents = $this->getForStorage(); - $this->client->set($this->key, $contents); - - if ($this->expire !== null) { - $this->client->expire($this->key, $this->expire); - } - } -} diff --git a/vendor/league/flysystem-cached-adapter/src/Storage/Predis.php b/vendor/league/flysystem-cached-adapter/src/Storage/Predis.php deleted file mode 100644 index 8a29574..0000000 --- a/vendor/league/flysystem-cached-adapter/src/Storage/Predis.php +++ /dev/null @@ -1,75 +0,0 @@ -client = $client ?: new Client(); - $this->key = $key; - $this->expire = $expire; - } - - /** - * {@inheritdoc} - */ - public function load() - { - if (($contents = $this->executeCommand('get', [$this->key])) !== null) { - $this->setFromStorage($contents); - } - } - - /** - * {@inheritdoc} - */ - public function save() - { - $contents = $this->getForStorage(); - $this->executeCommand('set', [$this->key, $contents]); - - if ($this->expire !== null) { - $this->executeCommand('expire', [$this->key, $this->expire]); - } - } - - /** - * Execute a Predis command. - * - * @param string $name - * @param array $arguments - * - * @return string - */ - protected function executeCommand($name, array $arguments) - { - $command = $this->client->createCommand($name, $arguments); - - return $this->client->executeCommand($command); - } -} diff --git a/vendor/league/flysystem-cached-adapter/src/Storage/Psr6Cache.php b/vendor/league/flysystem-cached-adapter/src/Storage/Psr6Cache.php deleted file mode 100644 index 43be87e..0000000 --- a/vendor/league/flysystem-cached-adapter/src/Storage/Psr6Cache.php +++ /dev/null @@ -1,59 +0,0 @@ -pool = $pool; - $this->key = $key; - $this->expire = $expire; - } - - /** - * {@inheritdoc} - */ - public function save() - { - $item = $this->pool->getItem($this->key); - $item->set($this->getForStorage()); - $item->expiresAfter($this->expire); - $this->pool->save($item); - } - - /** - * {@inheritdoc} - */ - public function load() - { - $item = $this->pool->getItem($this->key); - if ($item->isHit()) { - $this->setFromStorage($item->get()); - } - } -} \ No newline at end of file diff --git a/vendor/league/flysystem-cached-adapter/src/Storage/Stash.php b/vendor/league/flysystem-cached-adapter/src/Storage/Stash.php deleted file mode 100644 index e05b832..0000000 --- a/vendor/league/flysystem-cached-adapter/src/Storage/Stash.php +++ /dev/null @@ -1,60 +0,0 @@ -key = $key; - $this->expire = $expire; - $this->pool = $pool; - } - - /** - * {@inheritdoc} - */ - public function load() - { - $item = $this->pool->getItem($this->key); - $contents = $item->get(); - - if ($item->isMiss() === false) { - $this->setFromStorage($contents); - } - } - - /** - * {@inheritdoc} - */ - public function save() - { - $contents = $this->getForStorage(); - $item = $this->pool->getItem($this->key); - $item->set($contents, $this->expire); - } -} diff --git a/vendor/league/flysystem-cached-adapter/tests/AdapterCacheTests.php b/vendor/league/flysystem-cached-adapter/tests/AdapterCacheTests.php deleted file mode 100644 index b63cba7..0000000 --- a/vendor/league/flysystem-cached-adapter/tests/AdapterCacheTests.php +++ /dev/null @@ -1,104 +0,0 @@ -shouldReceive('has')->once()->with('file.json')->andReturn(false); - $cache = new Adapter($adapter, 'file.json', 10); - $cache->load(); - $this->assertFalse($cache->isComplete('', false)); - } - - public function testLoadExpired() - { - $response = ['contents' => json_encode([[], ['' => true], 1234567890]), 'path' => 'file.json']; - $adapter = Mockery::mock('League\Flysystem\AdapterInterface'); - $adapter->shouldReceive('has')->once()->with('file.json')->andReturn(true); - $adapter->shouldReceive('read')->once()->with('file.json')->andReturn($response); - $adapter->shouldReceive('delete')->once()->with('file.json'); - $cache = new Adapter($adapter, 'file.json', 10); - $cache->load(); - $this->assertFalse($cache->isComplete('', false)); - } - - public function testLoadSuccess() - { - $response = ['contents' => json_encode([[], ['' => true], 9876543210]), 'path' => 'file.json']; - $adapter = Mockery::mock('League\Flysystem\AdapterInterface'); - $adapter->shouldReceive('has')->once()->with('file.json')->andReturn(true); - $adapter->shouldReceive('read')->once()->with('file.json')->andReturn($response); - $cache = new Adapter($adapter, 'file.json', 10); - $cache->load(); - $this->assertTrue($cache->isComplete('', false)); - } - - public function testSaveExists() - { - $response = json_encode([[], [], null]); - $adapter = Mockery::mock('League\Flysystem\AdapterInterface'); - $adapter->shouldReceive('has')->once()->with('file.json')->andReturn(true); - $adapter->shouldReceive('update')->once()->with('file.json', $response, Mockery::any()); - $cache = new Adapter($adapter, 'file.json', null); - $cache->save(); - } - - public function testSaveNew() - { - $response = json_encode([[], [], null]); - $adapter = Mockery::mock('League\Flysystem\AdapterInterface'); - $adapter->shouldReceive('has')->once()->with('file.json')->andReturn(false); - $adapter->shouldReceive('write')->once()->with('file.json', $response, Mockery::any()); - $cache = new Adapter($adapter, 'file.json', null); - $cache->save(); - } - - public function testStoreContentsRecursive() - { - $adapter = Mockery::mock('League\Flysystem\AdapterInterface'); - $adapter->shouldReceive('has')->once()->with('file.json')->andReturn(false); - $adapter->shouldReceive('write')->once()->with('file.json', Mockery::any(), Mockery::any()); - - $cache = new Adapter($adapter, 'file.json', null); - - $contents = [ - ['path' => 'foo/bar', 'dirname' => 'foo'], - ['path' => 'afoo/bang', 'dirname' => 'afoo'], - ]; - - $cache->storeContents('foo', $contents, true); - - $this->assertTrue($cache->isComplete('foo', true)); - $this->assertFalse($cache->isComplete('afoo', true)); - } - - public function testDeleteDir() - { - $cache_data = [ - 'foo' => ['path' => 'foo', 'type' => 'dir', 'dirname' => ''], - 'foo/bar' => ['path' => 'foo/bar', 'type' => 'file', 'dirname' => 'foo'], - 'foobaz' => ['path' => 'foobaz', 'type' => 'file', 'dirname' => ''], - ]; - - $response = [ - 'contents' => json_encode([$cache_data, [], null]), - 'path' => 'file.json', - ]; - - $adapter = Mockery::mock('League\Flysystem\AdapterInterface'); - $adapter->shouldReceive('has')->zeroOrMoreTimes()->with('file.json')->andReturn(true); - $adapter->shouldReceive('read')->once()->with('file.json')->andReturn($response); - $adapter->shouldReceive('update')->once()->with('file.json', Mockery::any(), Mockery::any())->andReturn(true); - - $cache = new Adapter($adapter, 'file.json', null); - $cache->load(); - - $cache->deleteDir('foo', true); - - $this->assertSame(1, count($cache->listContents('', true))); - } -} diff --git a/vendor/league/flysystem-cached-adapter/tests/InspectionTests.php b/vendor/league/flysystem-cached-adapter/tests/InspectionTests.php deleted file mode 100644 index 40d4c91..0000000 --- a/vendor/league/flysystem-cached-adapter/tests/InspectionTests.php +++ /dev/null @@ -1,16 +0,0 @@ -shouldReceive('load')->once(); - $cached_adapter = new CachedAdapter($adapter, $cache); - $this->assertInstanceOf('League\Flysystem\AdapterInterface', $cached_adapter->getAdapter()); - } -} diff --git a/vendor/league/flysystem-cached-adapter/tests/MemcachedTests.php b/vendor/league/flysystem-cached-adapter/tests/MemcachedTests.php deleted file mode 100644 index e3d9ad9..0000000 --- a/vendor/league/flysystem-cached-adapter/tests/MemcachedTests.php +++ /dev/null @@ -1,35 +0,0 @@ -shouldReceive('get')->once()->andReturn(false); - $cache = new Memcached($client); - $cache->load(); - $this->assertFalse($cache->isComplete('', false)); - } - - public function testLoadSuccess() - { - $response = json_encode([[], ['' => true]]); - $client = Mockery::mock('Memcached'); - $client->shouldReceive('get')->once()->andReturn($response); - $cache = new Memcached($client); - $cache->load(); - $this->assertTrue($cache->isComplete('', false)); - } - - public function testSave() - { - $response = json_encode([[], []]); - $client = Mockery::mock('Memcached'); - $client->shouldReceive('set')->once()->andReturn($response); - $cache = new Memcached($client); - $cache->save(); - } -} diff --git a/vendor/league/flysystem-cached-adapter/tests/MemoryCacheTests.php b/vendor/league/flysystem-cached-adapter/tests/MemoryCacheTests.php deleted file mode 100644 index 3ac58fd..0000000 --- a/vendor/league/flysystem-cached-adapter/tests/MemoryCacheTests.php +++ /dev/null @@ -1,255 +0,0 @@ -setAutosave(true); - $this->assertTrue($cache->getAutosave()); - $cache->setAutosave(false); - $this->assertFalse($cache->getAutosave()); - } - - public function testCacheMiss() - { - $cache = new Memory(); - $cache->storeMiss('path.txt'); - $this->assertFalse($cache->has('path.txt')); - } - - public function testIsComplete() - { - $cache = new Memory(); - $this->assertFalse($cache->isComplete('dirname', false)); - $cache->setComplete('dirname', false); - $this->assertFalse($cache->isComplete('dirname', true)); - $cache->setComplete('dirname', true); - $this->assertTrue($cache->isComplete('dirname', true)); - } - - public function testCleanContents() - { - $cache = new Memory(); - $input = [[ - 'path' => 'path.txt', - 'visibility' => 'public', - 'invalid' => 'thing', - ]]; - - $expected = [[ - 'path' => 'path.txt', - 'visibility' => 'public', - ]]; - - $output = $cache->cleanContents($input); - $this->assertEquals($expected, $output); - } - - public function testGetForStorage() - { - $cache = new Memory(); - $input = [[ - 'path' => 'path.txt', - 'visibility' => 'public', - 'type' => 'file', - ]]; - - $cache->storeContents('', $input, true); - $contents = $cache->listContents('', true); - $cached = []; - foreach ($contents as $item) { - $cached[$item['path']] = $item; - } - - $this->assertEquals(json_encode([$cached, ['' => 'recursive']]), $cache->getForStorage()); - } - - public function testParentCompleteIsUsedDuringHas() - { - $cache = new Memory(); - $cache->setComplete('dirname', false); - $this->assertFalse($cache->has('dirname/path.txt')); - } - - public function testFlush() - { - $cache = new Memory(); - $cache->setComplete('dirname', true); - $cache->updateObject('path.txt', [ - 'path' => 'path.txt', - 'visibility' => 'public', - ]); - $cache->flush(); - $this->assertFalse($cache->isComplete('dirname', true)); - $this->assertNull($cache->has('path.txt')); - } - - public function testSetFromStorage() - { - $cache = new Memory(); - $json = [[ - 'path.txt' => ['path' => 'path.txt', 'type' => 'file'], - ], ['dirname' => 'recursive']]; - $jsonString = json_encode($json); - $cache->setFromStorage($jsonString); - $this->assertTrue($cache->has('path.txt')); - $this->assertTrue($cache->isComplete('dirname', true)); - } - - public function testGetMetadataFail() - { - $cache = new Memory(); - $this->assertFalse($cache->getMetadata('path.txt')); - } - - public function metaGetterProvider() - { - return [ - ['getTimestamp', 'timestamp', 12344], - ['getMimetype', 'mimetype', 'text/plain'], - ['getSize', 'size', 12], - ['getVisibility', 'visibility', 'private'], - ['read', 'contents', '__contents__'], - ]; - } - - /** - * @dataProvider metaGetterProvider - * - * @param $method - * @param $key - * @param $value - */ - public function testMetaGetters($method, $key, $value) - { - $cache = new Memory(); - $this->assertFalse($cache->{$method}('path.txt')); - $cache->updateObject('path.txt', $object = [ - 'path' => 'path.txt', - 'type' => 'file', - $key => $value, - ] + Util::pathinfo('path.txt'), true); - $this->assertEquals($object, $cache->{$method}('path.txt')); - $this->assertEquals($object, $cache->getMetadata('path.txt')); - } - - public function testGetDerivedMimetype() - { - $cache = new Memory(); - $cache->updateObject('path.txt', [ - 'contents' => 'something', - ]); - $response = $cache->getMimetype('path.txt'); - $this->assertEquals('text/plain', $response['mimetype']); - } - - public function testCopyFail() - { - $cache = new Memory(); - $cache->copy('one', 'two'); - $this->assertNull($cache->has('two')); - $this->assertNull($cache->load()); - } - - public function testStoreContents() - { - $cache = new Memory(); - $cache->storeContents('dirname', [ - ['path' => 'dirname', 'type' => 'dir'], - ['path' => 'dirname/nested', 'type' => 'dir'], - ['path' => 'dirname/nested/deep', 'type' => 'dir'], - ['path' => 'other/nested/deep', 'type' => 'dir'], - ], true); - - $this->isTrue($cache->isComplete('other/nested', true)); - } - - public function testDelete() - { - $cache = new Memory(); - $cache->updateObject('path.txt', ['type' => 'file']); - $this->assertTrue($cache->has('path.txt')); - $cache->delete('path.txt'); - $this->assertFalse($cache->has('path.txt')); - } - - public function testDeleteDir() - { - $cache = new Memory(); - $cache->storeContents('dirname', [ - ['path' => 'dirname/path.txt', 'type' => 'file'], - ]); - $this->assertTrue($cache->isComplete('dirname', false)); - $this->assertTrue($cache->has('dirname/path.txt')); - $cache->deleteDir('dirname'); - $this->assertFalse($cache->isComplete('dirname', false)); - $this->assertNull($cache->has('dirname/path.txt')); - } - - public function testReadStream() - { - $cache = new Memory(); - $this->assertFalse($cache->readStream('path.txt')); - } - - public function testRename() - { - $cache = new Memory(); - $cache->updateObject('path.txt', ['type' => 'file']); - $cache->rename('path.txt', 'newpath.txt'); - $this->assertTrue($cache->has('newpath.txt')); - } - - public function testCopy() - { - $cache = new Memory(); - $cache->updateObject('path.txt', ['type' => 'file']); - $cache->copy('path.txt', 'newpath.txt'); - $this->assertTrue($cache->has('newpath.txt')); - } - - public function testComplextListContents() - { - $cache = new Memory(); - $cache->storeContents('', [ - ['path' => 'dirname', 'type' => 'dir'], - ['path' => 'dirname/file.txt', 'type' => 'file'], - ['path' => 'other', 'type' => 'dir'], - ['path' => 'other/file.txt', 'type' => 'file'], - ['path' => 'other/nested/file.txt', 'type' => 'file'], - ]); - - $this->assertCount(3, $cache->listContents('other', true)); - } - - public function testComplextListContentsWithDeletedFile() - { - $cache = new Memory(); - $cache->storeContents('', [ - ['path' => 'dirname', 'type' => 'dir'], - ['path' => 'dirname/file.txt', 'type' => 'file'], - ['path' => 'other', 'type' => 'dir'], - ['path' => 'other/file.txt', 'type' => 'file'], - ['path' => 'other/another_file.txt', 'type' => 'file'], - ]); - - $cache->delete('other/another_file.txt'); - $this->assertCount(4, $cache->listContents('', true)); - } - - public function testCacheMissIfContentsIsFalse() - { - $cache = new Memory(); - $cache->updateObject('path.txt', [ - 'path' => 'path.txt', - 'contents' => false, - ], true); - - $this->assertFalse($cache->read('path.txt')); - } -} diff --git a/vendor/league/flysystem-cached-adapter/tests/NoopCacheTests.php b/vendor/league/flysystem-cached-adapter/tests/NoopCacheTests.php deleted file mode 100644 index 148616f..0000000 --- a/vendor/league/flysystem-cached-adapter/tests/NoopCacheTests.php +++ /dev/null @@ -1,35 +0,0 @@ -assertEquals($cache, $cache->storeMiss('file.txt')); - $this->assertNull($cache->setComplete('', false)); - $this->assertNull($cache->load()); - $this->assertNull($cache->flush()); - $this->assertNull($cache->has('path.txt')); - $this->assertNull($cache->autosave()); - $this->assertFalse($cache->isComplete('', false)); - $this->assertFalse($cache->read('something')); - $this->assertFalse($cache->readStream('something')); - $this->assertFalse($cache->getMetadata('something')); - $this->assertFalse($cache->getMimetype('something')); - $this->assertFalse($cache->getSize('something')); - $this->assertFalse($cache->getTimestamp('something')); - $this->assertFalse($cache->getVisibility('something')); - $this->assertEmpty($cache->listContents('', false)); - $this->assertFalse($cache->rename('', '')); - $this->assertFalse($cache->copy('', '')); - $this->assertNull($cache->save()); - $object = ['path' => 'path.ext']; - $this->assertEquals($object, $cache->updateObject('path.txt', $object)); - $this->assertEquals([['path' => 'some/file.txt']], $cache->storeContents('unknwon', [ - ['path' => 'some/file.txt'], - ], false)); - } -} diff --git a/vendor/league/flysystem-cached-adapter/tests/PhpRedisTests.php b/vendor/league/flysystem-cached-adapter/tests/PhpRedisTests.php deleted file mode 100644 index d1ccb65..0000000 --- a/vendor/league/flysystem-cached-adapter/tests/PhpRedisTests.php +++ /dev/null @@ -1,45 +0,0 @@ -shouldReceive('get')->with('flysystem')->once()->andReturn(false); - $cache = new PhpRedis($client); - $cache->load(); - $this->assertFalse($cache->isComplete('', false)); - } - - public function testLoadSuccess() - { - $response = json_encode([[], ['' => true]]); - $client = Mockery::mock('Redis'); - $client->shouldReceive('get')->with('flysystem')->once()->andReturn($response); - $cache = new PhpRedis($client); - $cache->load(); - $this->assertTrue($cache->isComplete('', false)); - } - - public function testSave() - { - $data = json_encode([[], []]); - $client = Mockery::mock('Redis'); - $client->shouldReceive('set')->with('flysystem', $data)->once(); - $cache = new PhpRedis($client); - $cache->save(); - } - - public function testSaveWithExpire() - { - $data = json_encode([[], []]); - $client = Mockery::mock('Redis'); - $client->shouldReceive('set')->with('flysystem', $data)->once(); - $client->shouldReceive('expire')->with('flysystem', 20)->once(); - $cache = new PhpRedis($client, 'flysystem', 20); - $cache->save(); - } -} diff --git a/vendor/league/flysystem-cached-adapter/tests/PredisTests.php b/vendor/league/flysystem-cached-adapter/tests/PredisTests.php deleted file mode 100644 index e33e104..0000000 --- a/vendor/league/flysystem-cached-adapter/tests/PredisTests.php +++ /dev/null @@ -1,55 +0,0 @@ -shouldReceive('createCommand')->with('get', ['flysystem'])->once()->andReturn($command); - $client->shouldReceive('executeCommand')->with($command)->andReturn(null); - $cache = new Predis($client); - $cache->load(); - $this->assertFalse($cache->isComplete('', false)); - } - - public function testLoadSuccess() - { - $response = json_encode([[], ['' => true]]); - $client = Mockery::mock('Predis\Client'); - $command = Mockery::mock('Predis\Command\CommandInterface'); - $client->shouldReceive('createCommand')->with('get', ['flysystem'])->once()->andReturn($command); - $client->shouldReceive('executeCommand')->with($command)->andReturn($response); - $cache = new Predis($client); - $cache->load(); - $this->assertTrue($cache->isComplete('', false)); - } - - public function testSave() - { - $data = json_encode([[], []]); - $client = Mockery::mock('Predis\Client'); - $command = Mockery::mock('Predis\Command\CommandInterface'); - $client->shouldReceive('createCommand')->with('set', ['flysystem', $data])->once()->andReturn($command); - $client->shouldReceive('executeCommand')->with($command)->once(); - $cache = new Predis($client); - $cache->save(); - } - - public function testSaveWithExpire() - { - $data = json_encode([[], []]); - $client = Mockery::mock('Predis\Client'); - $command = Mockery::mock('Predis\Command\CommandInterface'); - $client->shouldReceive('createCommand')->with('set', ['flysystem', $data])->once()->andReturn($command); - $client->shouldReceive('executeCommand')->with($command)->once(); - $expireCommand = Mockery::mock('Predis\Command\CommandInterface'); - $client->shouldReceive('createCommand')->with('expire', ['flysystem', 20])->once()->andReturn($expireCommand); - $client->shouldReceive('executeCommand')->with($expireCommand)->once(); - $cache = new Predis($client, 'flysystem', 20); - $cache->save(); - } -} diff --git a/vendor/league/flysystem-cached-adapter/tests/Psr6CacheTest.php b/vendor/league/flysystem-cached-adapter/tests/Psr6CacheTest.php deleted file mode 100644 index d5e5700..0000000 --- a/vendor/league/flysystem-cached-adapter/tests/Psr6CacheTest.php +++ /dev/null @@ -1,45 +0,0 @@ -shouldReceive('isHit')->once()->andReturn(false); - $pool->shouldReceive('getItem')->once()->andReturn($item); - $cache = new Psr6Cache($pool); - $cache->load(); - $this->assertFalse($cache->isComplete('', false)); - } - - public function testLoadSuccess() - { - $response = json_encode([[], ['' => true]]); - $pool = Mockery::mock('Psr\Cache\CacheItemPoolInterface'); - $item = Mockery::mock('Psr\Cache\CacheItemInterface'); - $item->shouldReceive('get')->once()->andReturn($response); - $item->shouldReceive('isHit')->once()->andReturn(true); - $pool->shouldReceive('getItem')->once()->andReturn($item); - $cache = new Psr6Cache($pool); - $cache->load(); - $this->assertTrue($cache->isComplete('', false)); - } - - public function testSave() - { - $response = json_encode([[], []]); - $ttl = 4711; - $pool = Mockery::mock('Psr\Cache\CacheItemPoolInterface'); - $item = Mockery::mock('Psr\Cache\CacheItemInterface'); - $item->shouldReceive('expiresAfter')->once()->with($ttl); - $item->shouldReceive('set')->once()->andReturn($response); - $pool->shouldReceive('getItem')->once()->andReturn($item); - $pool->shouldReceive('save')->once()->with($item); - $cache = new Psr6Cache($pool, 'foo', $ttl); - $cache->save(); - } -} diff --git a/vendor/league/flysystem-cached-adapter/tests/StashTest.php b/vendor/league/flysystem-cached-adapter/tests/StashTest.php deleted file mode 100644 index 29e142d..0000000 --- a/vendor/league/flysystem-cached-adapter/tests/StashTest.php +++ /dev/null @@ -1,43 +0,0 @@ -shouldReceive('get')->once()->andReturn(null); - $item->shouldReceive('isMiss')->once()->andReturn(true); - $pool->shouldReceive('getItem')->once()->andReturn($item); - $cache = new Stash($pool); - $cache->load(); - $this->assertFalse($cache->isComplete('', false)); - } - - public function testLoadSuccess() - { - $response = json_encode([[], ['' => true]]); - $pool = Mockery::mock('Stash\Pool'); - $item = Mockery::mock('Stash\Item'); - $item->shouldReceive('get')->once()->andReturn($response); - $item->shouldReceive('isMiss')->once()->andReturn(false); - $pool->shouldReceive('getItem')->once()->andReturn($item); - $cache = new Stash($pool); - $cache->load(); - $this->assertTrue($cache->isComplete('', false)); - } - - public function testSave() - { - $response = json_encode([[], []]); - $pool = Mockery::mock('Stash\Pool'); - $item = Mockery::mock('Stash\Item'); - $item->shouldReceive('set')->once()->andReturn($response); - $pool->shouldReceive('getItem')->once()->andReturn($item); - $cache = new Stash($pool); - $cache->save(); - } -} diff --git a/vendor/league/flysystem/CODE_OF_CONDUCT.md b/vendor/league/flysystem/CODE_OF_CONDUCT.md deleted file mode 100644 index 89569c0..0000000 --- a/vendor/league/flysystem/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,76 +0,0 @@ -# Contributor Covenant Code of Conduct - -## Our Pledge - -In the interest of fostering an open and welcoming environment, we as -contributors and maintainers pledge to making participation in our project and -our community a harassment-free experience for everyone, regardless of age, body -size, disability, ethnicity, sex characteristics, gender identity and expression, -level of experience, education, socio-economic status, nationality, personal -appearance, race, religion, or sexual identity and orientation. - -## Our Standards - -Examples of behavior that contributes to creating a positive environment -include: - -* Using welcoming and inclusive language -* Being respectful of differing viewpoints and experiences -* Gracefully accepting constructive criticism -* Focusing on what is best for the community -* Showing empathy towards other community members - -Examples of unacceptable behavior by participants include: - -* The use of sexualized language or imagery and unwelcome sexual attention or - advances -* Trolling, insulting/derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or electronic - address, without explicit permission -* Other conduct which could reasonably be considered inappropriate in a - professional setting - -## Our Responsibilities - -Project maintainers are responsible for clarifying the standards of acceptable -behavior and are expected to take appropriate and fair corrective action in -response to any instances of unacceptable behavior. - -Project maintainers have the right and responsibility to remove, edit, or -reject comments, commits, code, wiki edits, issues, and other contributions -that are not aligned to this Code of Conduct, or to ban temporarily or -permanently any contributor for other behaviors that they deem inappropriate, -threatening, offensive, or harmful. - -## Scope - -This Code of Conduct applies both within project spaces and in public spaces -when an individual is representing the project or its community. Examples of -representing a project or community include using an official project e-mail -address, posting via an official social media account, or acting as an appointed -representative at an online or offline event. Representation of a project may be -further defined and clarified by project maintainers. - -## Enforcement - -Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported by contacting the project team at info+flysystem@frankdejonge.nl. All -complaints will be reviewed and investigated and will result in a response that -is deemed necessary and appropriate to the circumstances. The project team is -obligated to maintain confidentiality with regard to the reporter of an incident. -Further details of specific enforcement policies may be posted separately. - -Project maintainers who do not follow or enforce the Code of Conduct in good -faith may face temporary or permanent repercussions as determined by other -members of the project's leadership. - -## Attribution - -This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, -available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html - -[homepage]: https://www.contributor-covenant.org - -For answers to common questions about this code of conduct, see -https://www.contributor-covenant.org/faq diff --git a/vendor/league/flysystem/LICENSE b/vendor/league/flysystem/LICENSE deleted file mode 100644 index f2684c8..0000000 --- a/vendor/league/flysystem/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2013-2019 Frank de Jonge - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/league/flysystem/SECURITY.md b/vendor/league/flysystem/SECURITY.md deleted file mode 100644 index f5b205e..0000000 --- a/vendor/league/flysystem/SECURITY.md +++ /dev/null @@ -1,16 +0,0 @@ -# Security Policy - -## Supported Versions - -| Version | Supported | -| ------- | ------------------ | -| 1.0.x | :white_check_mark: | -| 2.0.x | :x: | - -## Reporting a Vulnerability - -When you've encountered a security vulnerability, please disclose it securely. - -The security process is described at: -[https://flysystem.thephpleague.com/docs/security/](https://flysystem.thephpleague.com/docs/security/) - diff --git a/vendor/league/flysystem/composer.json b/vendor/league/flysystem/composer.json deleted file mode 100644 index 32ec81d..0000000 --- a/vendor/league/flysystem/composer.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "name": "league/flysystem", - "type": "library", - "description": "Filesystem abstraction: Many filesystems, one API.", - "keywords": [ - "filesystem", "filesystems", "files", "storage", "dropbox", "aws", - "abstraction", "s3", "ftp", "sftp", "remote", "webdav", - "file systems", "cloud", "cloud files", "rackspace", "copy.com" - ], - "funding": [ - { - "type": "other", - "url": "https://offset.earth/frankdejonge" - } - ], - "license": "MIT", - "authors": [ - { - "name": "Frank de Jonge", - "email": "info@frenky.net" - } - ], - "require": { - "php": "^7.2.5 || ^8.0", - "ext-fileinfo": "*", - "league/mime-type-detection": "^1.3" - }, - "require-dev": { - "phpspec/prophecy": "^1.11.1", - "phpunit/phpunit": "^8.5.8" - }, - "autoload": { - "psr-4": { - "League\\Flysystem\\": "src/" - } - }, - "autoload-dev": { - "psr-4": { - "League\\Flysystem\\Stub\\": "stub/" - } - }, - "suggest": { - "league/flysystem-eventable-filesystem": "Allows you to use EventableFilesystem", - "league/flysystem-rackspace": "Allows you to use Rackspace Cloud Files", - "league/flysystem-azure": "Allows you to use Windows Azure Blob storage", - "league/flysystem-webdav": "Allows you to use WebDAV storage", - "league/flysystem-aws-s3-v2": "Allows you to use S3 storage with AWS SDK v2", - "league/flysystem-aws-s3-v3": "Allows you to use S3 storage with AWS SDK v3", - "spatie/flysystem-dropbox": "Allows you to use Dropbox storage", - "srmklive/flysystem-dropbox-v2": "Allows you to use Dropbox storage for PHP 5 applications", - "league/flysystem-cached-adapter": "Flysystem adapter decorator for metadata caching", - "ext-ftp": "Allows you to use FTP server storage", - "ext-openssl": "Allows you to use FTPS server storage", - "league/flysystem-sftp": "Allows you to use SFTP server storage via phpseclib", - "league/flysystem-ziparchive": "Allows you to use ZipArchive adapter" - }, - "conflict": { - "league/flysystem-sftp": "<1.0.6" - }, - "extra": { - "branch-alias": { - "dev-master": "1.1-dev" - } - }, - "scripts": { - "phpstan": "php phpstan.php" - } -} diff --git a/vendor/league/flysystem/deprecations.md b/vendor/league/flysystem/deprecations.md deleted file mode 100644 index c336a42..0000000 --- a/vendor/league/flysystem/deprecations.md +++ /dev/null @@ -1,19 +0,0 @@ -# Deprecations - -This document lists all the planned deprecations. - -## Handlers will be removed in 2.0 - -The `Handler` type and associated calls will be removed in version 2.0. - -### Upgrade path - -You should create your own implementation for handling OOP usage, -but it's recommended to move away from using an OOP-style wrapper entirely. - -The reason for this is that it's too easy for implementation details (for -your application this is Flysystem) to leak into the application. The most -important part for Flysystem is that it improves portability and creates a -solid boundary between your application core and the infrastructure you use. -The OOP-style handling breaks this principle, therefore I want to stop -promoting it. diff --git a/vendor/league/flysystem/src/Adapter/AbstractAdapter.php b/vendor/league/flysystem/src/Adapter/AbstractAdapter.php deleted file mode 100644 index a6a8ed0..0000000 --- a/vendor/league/flysystem/src/Adapter/AbstractAdapter.php +++ /dev/null @@ -1,72 +0,0 @@ -pathPrefix = null; - - return; - } - - $this->pathPrefix = rtrim($prefix, '\\/') . $this->pathSeparator; - } - - /** - * Get the path prefix. - * - * @return string|null path prefix or null if pathPrefix is empty - */ - public function getPathPrefix() - { - return $this->pathPrefix; - } - - /** - * Prefix a path. - * - * @param string $path - * - * @return string prefixed path - */ - public function applyPathPrefix($path) - { - return $this->getPathPrefix() . ltrim($path, '\\/'); - } - - /** - * Remove a path prefix. - * - * @param string $path - * - * @return string path without the prefix - */ - public function removePathPrefix($path) - { - return substr($path, strlen((string) $this->getPathPrefix())); - } -} diff --git a/vendor/league/flysystem/src/Adapter/AbstractFtpAdapter.php b/vendor/league/flysystem/src/Adapter/AbstractFtpAdapter.php deleted file mode 100644 index 25d949e..0000000 --- a/vendor/league/flysystem/src/Adapter/AbstractFtpAdapter.php +++ /dev/null @@ -1,705 +0,0 @@ -safeStorage = new SafeStorage(); - $this->setConfig($config); - } - - /** - * Set the config. - * - * @param array $config - * - * @return $this - */ - public function setConfig(array $config) - { - foreach ($this->configurable as $setting) { - if ( ! isset($config[$setting])) { - continue; - } - - $method = 'set' . ucfirst($setting); - - if (method_exists($this, $method)) { - $this->$method($config[$setting]); - } - } - - return $this; - } - - /** - * Returns the host. - * - * @return string - */ - public function getHost() - { - return $this->host; - } - - /** - * Set the host. - * - * @param string $host - * - * @return $this - */ - public function setHost($host) - { - $this->host = $host; - - return $this; - } - - /** - * Set the public permission value. - * - * @param int $permPublic - * - * @return $this - */ - public function setPermPublic($permPublic) - { - $this->permPublic = $permPublic; - - return $this; - } - - /** - * Set the private permission value. - * - * @param int $permPrivate - * - * @return $this - */ - public function setPermPrivate($permPrivate) - { - $this->permPrivate = $permPrivate; - - return $this; - } - - /** - * Returns the ftp port. - * - * @return int - */ - public function getPort() - { - return $this->port; - } - - /** - * Returns the root folder to work from. - * - * @return string - */ - public function getRoot() - { - return $this->root; - } - - /** - * Set the ftp port. - * - * @param int|string $port - * - * @return $this - */ - public function setPort($port) - { - $this->port = (int) $port; - - return $this; - } - - /** - * Set the root folder to work from. - * - * @param string $root - * - * @return $this - */ - public function setRoot($root) - { - $this->root = rtrim($root, '\\/') . $this->separator; - - return $this; - } - - /** - * Returns the ftp username. - * - * @return string username - */ - public function getUsername() - { - $username = $this->safeStorage->retrieveSafely('username'); - - return $username !== null ? $username : 'anonymous'; - } - - /** - * Set ftp username. - * - * @param string $username - * - * @return $this - */ - public function setUsername($username) - { - $this->safeStorage->storeSafely('username', $username); - - return $this; - } - - /** - * Returns the password. - * - * @return string password - */ - public function getPassword() - { - return $this->safeStorage->retrieveSafely('password'); - } - - /** - * Set the ftp password. - * - * @param string $password - * - * @return $this - */ - public function setPassword($password) - { - $this->safeStorage->storeSafely('password', $password); - - return $this; - } - - /** - * Returns the amount of seconds before the connection will timeout. - * - * @return int - */ - public function getTimeout() - { - return $this->timeout; - } - - /** - * Set the amount of seconds before the connection should timeout. - * - * @param int $timeout - * - * @return $this - */ - public function setTimeout($timeout) - { - $this->timeout = (int) $timeout; - - return $this; - } - - /** - * Return the FTP system type. - * - * @return string - */ - public function getSystemType() - { - return $this->systemType; - } - - /** - * Set the FTP system type (windows or unix). - * - * @param string $systemType - * - * @return $this - */ - public function setSystemType($systemType) - { - $this->systemType = strtolower($systemType); - - return $this; - } - - /** - * True to enable timestamps for FTP servers that return unix-style listings. - * - * @param bool $bool - * - * @return $this - */ - public function setEnableTimestampsOnUnixListings($bool = false) - { - $this->enableTimestampsOnUnixListings = $bool; - - return $this; - } - - /** - * @inheritdoc - */ - public function listContents($directory = '', $recursive = false) - { - return $this->listDirectoryContents($directory, $recursive); - } - - abstract protected function listDirectoryContents($directory, $recursive = false); - - /** - * Normalize a directory listing. - * - * @param array $listing - * @param string $prefix - * - * @return array directory listing - */ - protected function normalizeListing(array $listing, $prefix = '') - { - $base = $prefix; - $result = []; - $listing = $this->removeDotDirectories($listing); - - while ($item = array_shift($listing)) { - if (preg_match('#^.*:$#', $item)) { - $base = preg_replace('~^\./*|:$~', '', $item); - continue; - } - - $result[] = $this->normalizeObject($item, $base); - } - - return $this->sortListing($result); - } - - /** - * Sort a directory listing. - * - * @param array $result - * - * @return array sorted listing - */ - protected function sortListing(array $result) - { - $compare = function ($one, $two) { - return strnatcmp($one['path'], $two['path']); - }; - - usort($result, $compare); - - return $result; - } - - /** - * Normalize a file entry. - * - * @param string $item - * @param string $base - * - * @return array normalized file array - * - * @throws NotSupportedException - */ - protected function normalizeObject($item, $base) - { - $systemType = $this->systemType ?: $this->detectSystemType($item); - - if ($systemType === 'unix') { - return $this->normalizeUnixObject($item, $base); - } elseif ($systemType === 'windows') { - return $this->normalizeWindowsObject($item, $base); - } - - throw NotSupportedException::forFtpSystemType($systemType); - } - - /** - * Normalize a Unix file entry. - * - * Given $item contains: - * '-rw-r--r-- 1 ftp ftp 409 Aug 19 09:01 file1.txt' - * - * This function will return: - * [ - * 'type' => 'file', - * 'path' => 'file1.txt', - * 'visibility' => 'public', - * 'size' => 409, - * 'timestamp' => 1566205260 - * ] - * - * @param string $item - * @param string $base - * - * @return array normalized file array - */ - protected function normalizeUnixObject($item, $base) - { - $item = preg_replace('#\s+#', ' ', trim($item), 7); - - if (count(explode(' ', $item, 9)) !== 9) { - throw new RuntimeException("Metadata can't be parsed from item '$item' , not enough parts."); - } - - list($permissions, /* $number */, /* $owner */, /* $group */, $size, $month, $day, $timeOrYear, $name) = explode(' ', $item, 9); - $type = $this->detectType($permissions); - $path = $base === '' ? $name : $base . $this->separator . $name; - - if ($type === 'dir') { - $result = compact('type', 'path'); - if ($this->enableTimestampsOnUnixListings) { - $timestamp = $this->normalizeUnixTimestamp($month, $day, $timeOrYear); - $result += compact('timestamp'); - } - - return $result; - } - - $permissions = $this->normalizePermissions($permissions); - $visibility = $permissions & 0044 ? AdapterInterface::VISIBILITY_PUBLIC : AdapterInterface::VISIBILITY_PRIVATE; - $size = (int) $size; - - $result = compact('type', 'path', 'visibility', 'size'); - if ($this->enableTimestampsOnUnixListings) { - $timestamp = $this->normalizeUnixTimestamp($month, $day, $timeOrYear); - $result += compact('timestamp'); - } - - return $result; - } - - /** - * Only accurate to the minute (current year), or to the day. - * - * Inadequacies in timestamp accuracy are due to limitations of the FTP 'LIST' command - * - * Note: The 'MLSD' command is a machine-readable replacement for 'LIST' - * but many FTP servers do not support it :( - * - * @param string $month e.g. 'Aug' - * @param string $day e.g. '19' - * @param string $timeOrYear e.g. '09:01' OR '2015' - * - * @return int - */ - protected function normalizeUnixTimestamp($month, $day, $timeOrYear) - { - if (is_numeric($timeOrYear)) { - $year = $timeOrYear; - $hour = '00'; - $minute = '00'; - $seconds = '00'; - } else { - $year = date('Y'); - list($hour, $minute) = explode(':', $timeOrYear); - $seconds = '00'; - } - $dateTime = DateTime::createFromFormat('Y-M-j-G:i:s', "{$year}-{$month}-{$day}-{$hour}:{$minute}:{$seconds}"); - - return $dateTime->getTimestamp(); - } - - /** - * Normalize a Windows/DOS file entry. - * - * @param string $item - * @param string $base - * - * @return array normalized file array - */ - protected function normalizeWindowsObject($item, $base) - { - $item = preg_replace('#\s+#', ' ', trim($item), 3); - - if (count(explode(' ', $item, 4)) !== 4) { - throw new RuntimeException("Metadata can't be parsed from item '$item' , not enough parts."); - } - - list($date, $time, $size, $name) = explode(' ', $item, 4); - $path = $base === '' ? $name : $base . $this->separator . $name; - - // Check for the correct date/time format - $format = strlen($date) === 8 ? 'm-d-yH:iA' : 'Y-m-dH:i'; - $dt = DateTime::createFromFormat($format, $date . $time); - $timestamp = $dt ? $dt->getTimestamp() : (int) strtotime("$date $time"); - - if ($size === '') { - $type = 'dir'; - - return compact('type', 'path', 'timestamp'); - } - - $type = 'file'; - $visibility = AdapterInterface::VISIBILITY_PUBLIC; - $size = (int) $size; - - return compact('type', 'path', 'visibility', 'size', 'timestamp'); - } - - /** - * Get the system type from a listing item. - * - * @param string $item - * - * @return string the system type - */ - protected function detectSystemType($item) - { - return preg_match('/^[0-9]{2,4}-[0-9]{2}-[0-9]{2}/', trim($item)) ? 'windows' : 'unix'; - } - - /** - * Get the file type from the permissions. - * - * @param string $permissions - * - * @return string file type - */ - protected function detectType($permissions) - { - return substr($permissions, 0, 1) === 'd' ? 'dir' : 'file'; - } - - /** - * Normalize a permissions string. - * - * @param string $permissions - * - * @return int - */ - protected function normalizePermissions($permissions) - { - if (is_numeric($permissions)) { - return ((int) $permissions) & 0777; - } - - // remove the type identifier - $permissions = substr($permissions, 1); - - // map the string rights to the numeric counterparts - $map = ['-' => '0', 'r' => '4', 'w' => '2', 'x' => '1']; - $permissions = strtr($permissions, $map); - - // split up the permission groups - $parts = str_split($permissions, 3); - - // convert the groups - $mapper = function ($part) { - return array_sum(str_split($part)); - }; - - // converts to decimal number - return octdec(implode('', array_map($mapper, $parts))); - } - - /** - * Filter out dot-directories. - * - * @param array $list - * - * @return array - */ - public function removeDotDirectories(array $list) - { - $filter = function ($line) { - return $line !== '' && ! preg_match('#.* \.(\.)?$|^total#', $line); - }; - - return array_filter($list, $filter); - } - - /** - * @inheritdoc - */ - public function has($path) - { - return $this->getMetadata($path); - } - - /** - * @inheritdoc - */ - public function getSize($path) - { - return $this->getMetadata($path); - } - - /** - * @inheritdoc - */ - public function getVisibility($path) - { - return $this->getMetadata($path); - } - - /** - * Ensure a directory exists. - * - * @param string $dirname - */ - public function ensureDirectory($dirname) - { - $dirname = (string) $dirname; - - if ($dirname !== '' && ! $this->has($dirname)) { - $this->createDir($dirname, new Config()); - } - } - - /** - * @return mixed - */ - public function getConnection() - { - if ( ! $this->isConnected()) { - $this->disconnect(); - $this->connect(); - } - - return $this->connection; - } - - /** - * Get the public permission value. - * - * @return int - */ - public function getPermPublic() - { - return $this->permPublic; - } - - /** - * Get the private permission value. - * - * @return int - */ - public function getPermPrivate() - { - return $this->permPrivate; - } - - /** - * Disconnect on destruction. - */ - public function __destruct() - { - $this->disconnect(); - } - - /** - * Establish a connection. - */ - abstract public function connect(); - - /** - * Close the connection. - */ - abstract public function disconnect(); - - /** - * Check if a connection is active. - * - * @return bool - */ - abstract public function isConnected(); - - protected function escapePath($path) - { - return str_replace(['*', '[', ']'], ['\\*', '\\[', '\\]'], $path); - } -} diff --git a/vendor/league/flysystem/src/Adapter/CanOverwriteFiles.php b/vendor/league/flysystem/src/Adapter/CanOverwriteFiles.php deleted file mode 100644 index fd8d216..0000000 --- a/vendor/league/flysystem/src/Adapter/CanOverwriteFiles.php +++ /dev/null @@ -1,12 +0,0 @@ -transferMode = $mode; - - return $this; - } - - /** - * Set if Ssl is enabled. - * - * @param bool $ssl - * - * @return $this - */ - public function setSsl($ssl) - { - $this->ssl = (bool) $ssl; - - return $this; - } - - /** - * Set if passive mode should be used. - * - * @param bool $passive - */ - public function setPassive($passive = true) - { - $this->passive = $passive; - } - - /** - * @param bool $ignorePassiveAddress - */ - public function setIgnorePassiveAddress($ignorePassiveAddress) - { - $this->ignorePassiveAddress = $ignorePassiveAddress; - } - - /** - * @param bool $recurseManually - */ - public function setRecurseManually($recurseManually) - { - $this->recurseManually = $recurseManually; - } - - /** - * @param bool $utf8 - */ - public function setUtf8($utf8) - { - $this->utf8 = (bool) $utf8; - } - - /** - * Connect to the FTP server. - */ - public function connect() - { - $tries = 3; - start_connecting: - - if ($this->ssl) { - $this->connection = @ftp_ssl_connect($this->getHost(), $this->getPort(), $this->getTimeout()); - } else { - $this->connection = @ftp_connect($this->getHost(), $this->getPort(), $this->getTimeout()); - } - - if ( ! $this->connection) { - $tries--; - - if ($tries > 0) goto start_connecting; - - throw new ConnectionRuntimeException('Could not connect to host: ' . $this->getHost() . ', port:' . $this->getPort()); - } - - $this->login(); - $this->setUtf8Mode(); - $this->setConnectionPassiveMode(); - $this->setConnectionRoot(); - $this->isPureFtpd = $this->isPureFtpdServer(); - } - - /** - * Set the connection to UTF-8 mode. - */ - protected function setUtf8Mode() - { - if ($this->utf8) { - $response = ftp_raw($this->connection, "OPTS UTF8 ON"); - if (!in_array(substr($response[0], 0, 3), ['200', '202'])) { - throw new ConnectionRuntimeException( - 'Could not set UTF-8 mode for connection: ' . $this->getHost() . '::' . $this->getPort() - ); - } - } - } - - /** - * Set the connections to passive mode. - * - * @throws ConnectionRuntimeException - */ - protected function setConnectionPassiveMode() - { - if (is_bool($this->ignorePassiveAddress) && defined('FTP_USEPASVADDRESS')) { - ftp_set_option($this->connection, FTP_USEPASVADDRESS, ! $this->ignorePassiveAddress); - } - - if ( ! ftp_pasv($this->connection, $this->passive)) { - throw new ConnectionRuntimeException( - 'Could not set passive mode for connection: ' . $this->getHost() . '::' . $this->getPort() - ); - } - } - - /** - * Set the connection root. - */ - protected function setConnectionRoot() - { - $root = $this->getRoot(); - $connection = $this->connection; - - if ($root && ! ftp_chdir($connection, $root)) { - throw new InvalidRootException('Root is invalid or does not exist: ' . $this->getRoot()); - } - - // Store absolute path for further reference. - // This is needed when creating directories and - // initial root was a relative path, else the root - // would be relative to the chdir'd path. - $this->root = ftp_pwd($connection); - } - - /** - * Login. - * - * @throws ConnectionRuntimeException - */ - protected function login() - { - set_error_handler(function () { - }); - $isLoggedIn = ftp_login( - $this->connection, - $this->getUsername(), - $this->getPassword() - ); - restore_error_handler(); - - if ( ! $isLoggedIn) { - $this->disconnect(); - throw new ConnectionRuntimeException( - 'Could not login with connection: ' . $this->getHost() . '::' . $this->getPort( - ) . ', username: ' . $this->getUsername() - ); - } - } - - /** - * Disconnect from the FTP server. - */ - public function disconnect() - { - if ($this->hasFtpConnection()) { - @ftp_close($this->connection); - } - - $this->connection = null; - } - - /** - * @inheritdoc - */ - public function write($path, $contents, Config $config) - { - $stream = fopen('php://temp', 'w+b'); - fwrite($stream, $contents); - rewind($stream); - $result = $this->writeStream($path, $stream, $config); - fclose($stream); - - if ($result === false) { - return false; - } - - $result['contents'] = $contents; - $result['mimetype'] = $config->get('mimetype') ?: Util::guessMimeType($path, $contents); - - return $result; - } - - /** - * @inheritdoc - */ - public function writeStream($path, $resource, Config $config) - { - $this->ensureDirectory(Util::dirname($path)); - - if ( ! ftp_fput($this->getConnection(), $path, $resource, $this->transferMode)) { - return false; - } - - if ($visibility = $config->get('visibility')) { - $this->setVisibility($path, $visibility); - } - - $type = 'file'; - - return compact('type', 'path', 'visibility'); - } - - /** - * @inheritdoc - */ - public function update($path, $contents, Config $config) - { - return $this->write($path, $contents, $config); - } - - /** - * @inheritdoc - */ - public function updateStream($path, $resource, Config $config) - { - return $this->writeStream($path, $resource, $config); - } - - /** - * @inheritdoc - */ - public function rename($path, $newpath) - { - return ftp_rename($this->getConnection(), $path, $newpath); - } - - /** - * @inheritdoc - */ - public function delete($path) - { - return ftp_delete($this->getConnection(), $path); - } - - /** - * @inheritdoc - */ - public function deleteDir($dirname) - { - $connection = $this->getConnection(); - $contents = array_reverse($this->listDirectoryContents($dirname, false)); - - foreach ($contents as $object) { - if ($object['type'] === 'file') { - if ( ! ftp_delete($connection, $object['path'])) { - return false; - } - } elseif ( ! $this->deleteDir($object['path'])) { - return false; - } - } - - return ftp_rmdir($connection, $dirname); - } - - /** - * @inheritdoc - */ - public function createDir($dirname, Config $config) - { - $connection = $this->getConnection(); - $directories = explode('/', $dirname); - - foreach ($directories as $directory) { - if (false === $this->createActualDirectory($directory, $connection)) { - $this->setConnectionRoot(); - - return false; - } - - ftp_chdir($connection, $directory); - } - - $this->setConnectionRoot(); - - return ['type' => 'dir', 'path' => $dirname]; - } - - /** - * Create a directory. - * - * @param string $directory - * @param resource $connection - * - * @return bool - */ - protected function createActualDirectory($directory, $connection) - { - // List the current directory - $listing = ftp_nlist($connection, '.') ?: []; - - foreach ($listing as $key => $item) { - if (preg_match('~^\./.*~', $item)) { - $listing[$key] = substr($item, 2); - } - } - - if (in_array($directory, $listing, true)) { - return true; - } - - return (boolean) ftp_mkdir($connection, $directory); - } - - /** - * @inheritdoc - */ - public function getMetadata($path) - { - if ($path === '') { - return ['type' => 'dir', 'path' => '']; - } - - if (@ftp_chdir($this->getConnection(), $path) === true) { - $this->setConnectionRoot(); - - return ['type' => 'dir', 'path' => $path]; - } - - $listing = $this->ftpRawlist('-A', $path); - - if (empty($listing) || in_array('total 0', $listing, true)) { - return false; - } - - if (preg_match('/.* not found/', $listing[0])) { - return false; - } - - if (preg_match('/^total [0-9]*$/', $listing[0])) { - array_shift($listing); - } - - return $this->normalizeObject($listing[0], ''); - } - - /** - * @inheritdoc - */ - public function getMimetype($path) - { - if ( ! $metadata = $this->getMetadata($path)) { - return false; - } - - $metadata['mimetype'] = MimeType::detectByFilename($path); - - return $metadata; - } - - /** - * @inheritdoc - */ - public function getTimestamp($path) - { - $timestamp = ftp_mdtm($this->getConnection(), $path); - - return ($timestamp !== -1) ? ['path' => $path, 'timestamp' => $timestamp] : false; - } - - /** - * @inheritdoc - */ - public function read($path) - { - if ( ! $object = $this->readStream($path)) { - return false; - } - - $object['contents'] = stream_get_contents($object['stream']); - fclose($object['stream']); - unset($object['stream']); - - return $object; - } - - /** - * @inheritdoc - */ - public function readStream($path) - { - $stream = fopen('php://temp', 'w+b'); - $result = ftp_fget($this->getConnection(), $stream, $path, $this->transferMode); - rewind($stream); - - if ( ! $result) { - fclose($stream); - - return false; - } - - return ['type' => 'file', 'path' => $path, 'stream' => $stream]; - } - - /** - * @inheritdoc - */ - public function setVisibility($path, $visibility) - { - $mode = $visibility === AdapterInterface::VISIBILITY_PUBLIC ? $this->getPermPublic() : $this->getPermPrivate(); - - if ( ! ftp_chmod($this->getConnection(), $mode, $path)) { - return false; - } - - return compact('path', 'visibility'); - } - - /** - * @inheritdoc - * - * @param string $directory - */ - protected function listDirectoryContents($directory, $recursive = true) - { - if ($recursive && $this->recurseManually) { - return $this->listDirectoryContentsRecursive($directory); - } - - $options = $recursive ? '-alnR' : '-aln'; - $listing = $this->ftpRawlist($options, $directory); - - return $listing ? $this->normalizeListing($listing, $directory) : []; - } - - /** - * @inheritdoc - * - * @param string $directory - */ - protected function listDirectoryContentsRecursive($directory) - { - $listing = $this->normalizeListing($this->ftpRawlist('-aln', $directory) ?: [], $directory); - $output = []; - - foreach ($listing as $item) { - $output[] = $item; - if ($item['type'] !== 'dir') { - continue; - } - $output = array_merge($output, $this->listDirectoryContentsRecursive($item['path'])); - } - - return $output; - } - - /** - * Check if the connection is open. - * - * @return bool - * - * @throws ConnectionErrorException - */ - public function isConnected() - { - return $this->hasFtpConnection() && $this->getRawExecResponseCode('NOOP') === 200; - } - - /** - * @return bool - */ - protected function isPureFtpdServer() - { - $response = ftp_raw($this->connection, 'HELP'); - - return stripos(implode(' ', $response), 'Pure-FTPd') !== false; - } - - /** - * The ftp_rawlist function with optional escaping. - * - * @param string $options - * @param string $path - * - * @return array - */ - protected function ftpRawlist($options, $path) - { - $connection = $this->getConnection(); - - if ($this->isPureFtpd) { - $path = str_replace([' ', '[', ']'], ['\ ', '\\[', '\\]'], $path); - } - - return ftp_rawlist($connection, $options . ' ' . $this->escapePath($path)); - } - - private function getRawExecResponseCode($command) - { - $response = @ftp_raw($this->connection, trim($command)); - - return (int) preg_replace('/\D/', '', implode(' ', $response)); - } - - private function hasFtpConnection(): bool - { - return is_resource($this->connection) || $this->connection instanceof \FTP\Connection; - } -} diff --git a/vendor/league/flysystem/src/Adapter/Ftpd.php b/vendor/league/flysystem/src/Adapter/Ftpd.php deleted file mode 100644 index 7e71d19..0000000 --- a/vendor/league/flysystem/src/Adapter/Ftpd.php +++ /dev/null @@ -1,48 +0,0 @@ - 'dir', 'path' => '']; - } - - if (@ftp_chdir($this->getConnection(), $path) === true) { - $this->setConnectionRoot(); - - return ['type' => 'dir', 'path' => $path]; - } - - $object = ftp_raw($this->getConnection(), 'STAT ' . $this->escapePath($path)); - - if ( ! $object || count($object) < 3) { - return false; - } - - if (substr($object[1], 0, 5) === "ftpd:") { - return false; - } - - return $this->normalizeObject($object[1], ''); - } - - /** - * @inheritdoc - */ - protected function listDirectoryContents($directory, $recursive = true) - { - $listing = ftp_rawlist($this->getConnection(), $this->escapePath($directory), $recursive); - - if ($listing === false || ( ! empty($listing) && substr($listing[0], 0, 5) === "ftpd:")) { - return []; - } - - return $this->normalizeListing($listing, $directory); - } -} diff --git a/vendor/league/flysystem/src/Adapter/Local.php b/vendor/league/flysystem/src/Adapter/Local.php deleted file mode 100644 index 747c463..0000000 --- a/vendor/league/flysystem/src/Adapter/Local.php +++ /dev/null @@ -1,533 +0,0 @@ - [ - 'public' => 0644, - 'private' => 0600, - ], - 'dir' => [ - 'public' => 0755, - 'private' => 0700, - ], - ]; - - /** - * @var string - */ - protected $pathSeparator = DIRECTORY_SEPARATOR; - - /** - * @var array - */ - protected $permissionMap; - - /** - * @var int - */ - protected $writeFlags; - - /** - * @var int - */ - private $linkHandling; - - /** - * Constructor. - * - * @param string $root - * @param int $writeFlags - * @param int $linkHandling - * @param array $permissions - * - * @throws LogicException - */ - public function __construct($root, $writeFlags = LOCK_EX, $linkHandling = self::DISALLOW_LINKS, array $permissions = []) - { - $root = is_link($root) ? realpath($root) : $root; - $this->permissionMap = array_replace_recursive(static::$permissions, $permissions); - $this->ensureDirectory($root); - - if ( ! is_dir($root) || ! is_readable($root)) { - throw new LogicException('The root path ' . $root . ' is not readable.'); - } - - $this->setPathPrefix($root); - $this->writeFlags = $writeFlags; - $this->linkHandling = $linkHandling; - } - - /** - * Ensure the root directory exists. - * - * @param string $root root directory path - * - * @return void - * - * @throws Exception in case the root directory can not be created - */ - protected function ensureDirectory($root) - { - if ( ! is_dir($root)) { - $umask = umask(0); - - if ( ! @mkdir($root, $this->permissionMap['dir']['public'], true)) { - $mkdirError = error_get_last(); - } - - umask($umask); - clearstatcache(false, $root); - - if ( ! is_dir($root)) { - $errorMessage = isset($mkdirError['message']) ? $mkdirError['message'] : ''; - throw new Exception(sprintf('Impossible to create the root directory "%s". %s', $root, $errorMessage)); - } - } - } - - /** - * @inheritdoc - */ - public function has($path) - { - $location = $this->applyPathPrefix($path); - - return file_exists($location); - } - - /** - * @inheritdoc - */ - public function write($path, $contents, Config $config) - { - $location = $this->applyPathPrefix($path); - $this->ensureDirectory(dirname($location)); - - if (($size = file_put_contents($location, $contents, $this->writeFlags)) === false) { - return false; - } - - $type = 'file'; - $result = compact('contents', 'type', 'size', 'path'); - - if ($visibility = $config->get('visibility')) { - $result['visibility'] = $visibility; - $this->setVisibility($path, $visibility); - } - - return $result; - } - - /** - * @inheritdoc - */ - public function writeStream($path, $resource, Config $config) - { - $location = $this->applyPathPrefix($path); - $this->ensureDirectory(dirname($location)); - $stream = fopen($location, 'w+b'); - - if ( ! $stream || stream_copy_to_stream($resource, $stream) === false || ! fclose($stream)) { - return false; - } - - $type = 'file'; - $result = compact('type', 'path'); - - if ($visibility = $config->get('visibility')) { - $this->setVisibility($path, $visibility); - $result['visibility'] = $visibility; - } - - return $result; - } - - /** - * @inheritdoc - */ - public function readStream($path) - { - $location = $this->applyPathPrefix($path); - $stream = fopen($location, 'rb'); - - return ['type' => 'file', 'path' => $path, 'stream' => $stream]; - } - - /** - * @inheritdoc - */ - public function updateStream($path, $resource, Config $config) - { - return $this->writeStream($path, $resource, $config); - } - - /** - * @inheritdoc - */ - public function update($path, $contents, Config $config) - { - $location = $this->applyPathPrefix($path); - $size = file_put_contents($location, $contents, $this->writeFlags); - - if ($size === false) { - return false; - } - - $type = 'file'; - - $result = compact('type', 'path', 'size', 'contents'); - - if ($visibility = $config->get('visibility')) { - $this->setVisibility($path, $visibility); - $result['visibility'] = $visibility; - } - - return $result; - } - - /** - * @inheritdoc - */ - public function read($path) - { - $location = $this->applyPathPrefix($path); - $contents = @file_get_contents($location); - - if ($contents === false) { - return false; - } - - return ['type' => 'file', 'path' => $path, 'contents' => $contents]; - } - - /** - * @inheritdoc - */ - public function rename($path, $newpath) - { - $location = $this->applyPathPrefix($path); - $destination = $this->applyPathPrefix($newpath); - $parentDirectory = $this->applyPathPrefix(Util::dirname($newpath)); - $this->ensureDirectory($parentDirectory); - - return rename($location, $destination); - } - - /** - * @inheritdoc - */ - public function copy($path, $newpath) - { - $location = $this->applyPathPrefix($path); - $destination = $this->applyPathPrefix($newpath); - $this->ensureDirectory(dirname($destination)); - - return copy($location, $destination); - } - - /** - * @inheritdoc - */ - public function delete($path) - { - $location = $this->applyPathPrefix($path); - - return @unlink($location); - } - - /** - * @inheritdoc - */ - public function listContents($directory = '', $recursive = false) - { - $result = []; - $location = $this->applyPathPrefix($directory); - - if ( ! is_dir($location)) { - return []; - } - - $iterator = $recursive ? $this->getRecursiveDirectoryIterator($location) : $this->getDirectoryIterator($location); - - foreach ($iterator as $file) { - $path = $this->getFilePath($file); - - if (preg_match('#(^|/|\\\\)\.{1,2}$#', $path)) { - continue; - } - - $result[] = $this->normalizeFileInfo($file); - } - - unset($iterator); - - return array_filter($result); - } - - /** - * @inheritdoc - */ - public function getMetadata($path) - { - $location = $this->applyPathPrefix($path); - clearstatcache(false, $location); - $info = new SplFileInfo($location); - - return $this->normalizeFileInfo($info); - } - - /** - * @inheritdoc - */ - public function getSize($path) - { - return $this->getMetadata($path); - } - - /** - * @inheritdoc - */ - public function getMimetype($path) - { - $location = $this->applyPathPrefix($path); - $finfo = new Finfo(FILEINFO_MIME_TYPE); - $mimetype = $finfo->file($location); - - if (in_array($mimetype, ['application/octet-stream', 'inode/x-empty', 'application/x-empty'])) { - $mimetype = Util\MimeType::detectByFilename($location); - } - - return ['path' => $path, 'type' => 'file', 'mimetype' => $mimetype]; - } - - /** - * @inheritdoc - */ - public function getTimestamp($path) - { - return $this->getMetadata($path); - } - - /** - * @inheritdoc - */ - public function getVisibility($path) - { - $location = $this->applyPathPrefix($path); - clearstatcache(false, $location); - $permissions = octdec(substr(sprintf('%o', fileperms($location)), -4)); - $type = is_dir($location) ? 'dir' : 'file'; - - foreach ($this->permissionMap[$type] as $visibility => $visibilityPermissions) { - if ($visibilityPermissions == $permissions) { - return compact('path', 'visibility'); - } - } - - $visibility = substr(sprintf('%o', fileperms($location)), -4); - - return compact('path', 'visibility'); - } - - /** - * @inheritdoc - */ - public function setVisibility($path, $visibility) - { - $location = $this->applyPathPrefix($path); - $type = is_dir($location) ? 'dir' : 'file'; - $success = chmod($location, $this->permissionMap[$type][$visibility]); - - if ($success === false) { - return false; - } - - return compact('path', 'visibility'); - } - - /** - * @inheritdoc - */ - public function createDir($dirname, Config $config) - { - $location = $this->applyPathPrefix($dirname); - $umask = umask(0); - $visibility = $config->get('visibility', 'public'); - $return = ['path' => $dirname, 'type' => 'dir']; - - if ( ! is_dir($location)) { - if (false === @mkdir($location, $this->permissionMap['dir'][$visibility], true) - || false === is_dir($location)) { - $return = false; - } - } - - umask($umask); - - return $return; - } - - /** - * @inheritdoc - */ - public function deleteDir($dirname) - { - $location = $this->applyPathPrefix($dirname); - - if ( ! is_dir($location)) { - return false; - } - - $contents = $this->getRecursiveDirectoryIterator($location, RecursiveIteratorIterator::CHILD_FIRST); - - /** @var SplFileInfo $file */ - foreach ($contents as $file) { - $this->guardAgainstUnreadableFileInfo($file); - $this->deleteFileInfoObject($file); - } - - unset($contents); - - return rmdir($location); - } - - /** - * @param SplFileInfo $file - */ - protected function deleteFileInfoObject(SplFileInfo $file) - { - switch ($file->getType()) { - case 'dir': - rmdir($file->getRealPath()); - break; - case 'link': - unlink($file->getPathname()); - break; - default: - unlink($file->getRealPath()); - } - } - - /** - * Normalize the file info. - * - * @param SplFileInfo $file - * - * @return array|void - * - * @throws NotSupportedException - */ - protected function normalizeFileInfo(SplFileInfo $file) - { - if ( ! $file->isLink()) { - return $this->mapFileInfo($file); - } - - if ($this->linkHandling & self::DISALLOW_LINKS) { - throw NotSupportedException::forLink($file); - } - } - - /** - * Get the normalized path from a SplFileInfo object. - * - * @param SplFileInfo $file - * - * @return string - */ - protected function getFilePath(SplFileInfo $file) - { - $location = $file->getPathname(); - $path = $this->removePathPrefix($location); - - return trim(str_replace('\\', '/', $path), '/'); - } - - /** - * @param string $path - * @param int $mode - * - * @return RecursiveIteratorIterator - */ - protected function getRecursiveDirectoryIterator($path, $mode = RecursiveIteratorIterator::SELF_FIRST) - { - return new RecursiveIteratorIterator( - new RecursiveDirectoryIterator($path, FilesystemIterator::SKIP_DOTS), - $mode - ); - } - - /** - * @param string $path - * - * @return DirectoryIterator - */ - protected function getDirectoryIterator($path) - { - $iterator = new DirectoryIterator($path); - - return $iterator; - } - - /** - * @param SplFileInfo $file - * - * @return array - */ - protected function mapFileInfo(SplFileInfo $file) - { - $normalized = [ - 'type' => $file->getType(), - 'path' => $this->getFilePath($file), - ]; - - $normalized['timestamp'] = $file->getMTime(); - - if ($normalized['type'] === 'file') { - $normalized['size'] = $file->getSize(); - } - - return $normalized; - } - - /** - * @param SplFileInfo $file - * - * @throws UnreadableFileException - */ - protected function guardAgainstUnreadableFileInfo(SplFileInfo $file) - { - if ( ! $file->isReadable()) { - throw UnreadableFileException::forFileInfo($file); - } - } -} diff --git a/vendor/league/flysystem/src/Adapter/NullAdapter.php b/vendor/league/flysystem/src/Adapter/NullAdapter.php deleted file mode 100644 index 2527087..0000000 --- a/vendor/league/flysystem/src/Adapter/NullAdapter.php +++ /dev/null @@ -1,144 +0,0 @@ -get('visibility')) { - $result['visibility'] = $visibility; - } - - return $result; - } - - /** - * @inheritdoc - */ - public function update($path, $contents, Config $config) - { - return false; - } - - /** - * @inheritdoc - */ - public function read($path) - { - return false; - } - - /** - * @inheritdoc - */ - public function rename($path, $newpath) - { - return false; - } - - /** - * @inheritdoc - */ - public function delete($path) - { - return false; - } - - /** - * @inheritdoc - */ - public function listContents($directory = '', $recursive = false) - { - return []; - } - - /** - * @inheritdoc - */ - public function getMetadata($path) - { - return false; - } - - /** - * @inheritdoc - */ - public function getSize($path) - { - return false; - } - - /** - * @inheritdoc - */ - public function getMimetype($path) - { - return false; - } - - /** - * @inheritdoc - */ - public function getTimestamp($path) - { - return false; - } - - /** - * @inheritdoc - */ - public function getVisibility($path) - { - return false; - } - - /** - * @inheritdoc - */ - public function setVisibility($path, $visibility) - { - return compact('visibility'); - } - - /** - * @inheritdoc - */ - public function createDir($dirname, Config $config) - { - return ['path' => $dirname, 'type' => 'dir']; - } - - /** - * @inheritdoc - */ - public function deleteDir($dirname) - { - return false; - } -} diff --git a/vendor/league/flysystem/src/Adapter/Polyfill/NotSupportingVisibilityTrait.php b/vendor/league/flysystem/src/Adapter/Polyfill/NotSupportingVisibilityTrait.php deleted file mode 100644 index fc0a747..0000000 --- a/vendor/league/flysystem/src/Adapter/Polyfill/NotSupportingVisibilityTrait.php +++ /dev/null @@ -1,33 +0,0 @@ -readStream($path); - - if ($response === false || ! is_resource($response['stream'])) { - return false; - } - - $result = $this->writeStream($newpath, $response['stream'], new Config()); - - if ($result !== false && is_resource($response['stream'])) { - fclose($response['stream']); - } - - return $result !== false; - } - - // Required abstract method - - /** - * @param string $path - * - * @return resource - */ - abstract public function readStream($path); - - /** - * @param string $path - * @param resource $resource - * @param Config $config - * - * @return resource - */ - abstract public function writeStream($path, $resource, Config $config); -} diff --git a/vendor/league/flysystem/src/Adapter/Polyfill/StreamedReadingTrait.php b/vendor/league/flysystem/src/Adapter/Polyfill/StreamedReadingTrait.php deleted file mode 100644 index 2b31c01..0000000 --- a/vendor/league/flysystem/src/Adapter/Polyfill/StreamedReadingTrait.php +++ /dev/null @@ -1,44 +0,0 @@ -read($path)) { - return false; - } - - $stream = fopen('php://temp', 'w+b'); - fwrite($stream, $data['contents']); - rewind($stream); - $data['stream'] = $stream; - unset($data['contents']); - - return $data; - } - - /** - * Reads a file. - * - * @param string $path - * - * @return array|false - * - * @see League\Flysystem\ReadInterface::read() - */ - abstract public function read($path); -} diff --git a/vendor/league/flysystem/src/Adapter/Polyfill/StreamedTrait.php b/vendor/league/flysystem/src/Adapter/Polyfill/StreamedTrait.php deleted file mode 100644 index 8042496..0000000 --- a/vendor/league/flysystem/src/Adapter/Polyfill/StreamedTrait.php +++ /dev/null @@ -1,9 +0,0 @@ -stream($path, $resource, $config, 'write'); - } - - /** - * Update a file using a stream. - * - * @param string $path - * @param resource $resource - * @param Config $config Config object or visibility setting - * - * @return mixed false of file metadata - */ - public function updateStream($path, $resource, Config $config) - { - return $this->stream($path, $resource, $config, 'update'); - } - - // Required abstract methods - abstract public function write($pash, $contents, Config $config); - abstract public function update($pash, $contents, Config $config); -} diff --git a/vendor/league/flysystem/src/Adapter/SynologyFtp.php b/vendor/league/flysystem/src/Adapter/SynologyFtp.php deleted file mode 100644 index fe0d344..0000000 --- a/vendor/league/flysystem/src/Adapter/SynologyFtp.php +++ /dev/null @@ -1,8 +0,0 @@ -settings = $settings; - } - - /** - * Get a setting. - * - * @param string $key - * @param mixed $default - * - * @return mixed config setting or default when not found - */ - public function get($key, $default = null) - { - if ( ! array_key_exists($key, $this->settings)) { - return $this->getDefault($key, $default); - } - - return $this->settings[$key]; - } - - /** - * Check if an item exists by key. - * - * @param string $key - * - * @return bool - */ - public function has($key) - { - if (array_key_exists($key, $this->settings)) { - return true; - } - - return $this->fallback instanceof Config - ? $this->fallback->has($key) - : false; - } - - /** - * Try to retrieve a default setting from a config fallback. - * - * @param string $key - * @param mixed $default - * - * @return mixed config setting or default when not found - */ - protected function getDefault($key, $default) - { - if ( ! $this->fallback) { - return $default; - } - - return $this->fallback->get($key, $default); - } - - /** - * Set a setting. - * - * @param string $key - * @param mixed $value - * - * @return $this - */ - public function set($key, $value) - { - $this->settings[$key] = $value; - - return $this; - } - - /** - * Set the fallback. - * - * @param Config $fallback - * - * @return $this - */ - public function setFallback(Config $fallback) - { - $this->fallback = $fallback; - - return $this; - } -} diff --git a/vendor/league/flysystem/src/ConfigAwareTrait.php b/vendor/league/flysystem/src/ConfigAwareTrait.php deleted file mode 100644 index 202d605..0000000 --- a/vendor/league/flysystem/src/ConfigAwareTrait.php +++ /dev/null @@ -1,49 +0,0 @@ -config = $config ? Util::ensureConfig($config) : new Config; - } - - /** - * Get the Config. - * - * @return Config config object - */ - public function getConfig() - { - return $this->config; - } - - /** - * Convert a config array to a Config object with the correct fallback. - * - * @param array $config - * - * @return Config - */ - protected function prepareConfig(array $config) - { - $config = new Config($config); - $config->setFallback($this->getConfig()); - - return $config; - } -} diff --git a/vendor/league/flysystem/src/ConnectionErrorException.php b/vendor/league/flysystem/src/ConnectionErrorException.php deleted file mode 100644 index adb651d..0000000 --- a/vendor/league/flysystem/src/ConnectionErrorException.php +++ /dev/null @@ -1,9 +0,0 @@ -filesystem->deleteDir($this->path); - } - - /** - * List the directory contents. - * - * @param bool $recursive - * - * @return array|bool directory contents or false - */ - public function getContents($recursive = false) - { - return $this->filesystem->listContents($this->path, $recursive); - } -} diff --git a/vendor/league/flysystem/src/Exception.php b/vendor/league/flysystem/src/Exception.php deleted file mode 100644 index 4596c0a..0000000 --- a/vendor/league/flysystem/src/Exception.php +++ /dev/null @@ -1,8 +0,0 @@ -filesystem->has($this->path); - } - - /** - * Read the file. - * - * @return string|false file contents - */ - public function read() - { - return $this->filesystem->read($this->path); - } - - /** - * Read the file as a stream. - * - * @return resource|false file stream - */ - public function readStream() - { - return $this->filesystem->readStream($this->path); - } - - /** - * Write the new file. - * - * @param string $content - * - * @return bool success boolean - */ - public function write($content) - { - return $this->filesystem->write($this->path, $content); - } - - /** - * Write the new file using a stream. - * - * @param resource $resource - * - * @return bool success boolean - */ - public function writeStream($resource) - { - return $this->filesystem->writeStream($this->path, $resource); - } - - /** - * Update the file contents. - * - * @param string $content - * - * @return bool success boolean - */ - public function update($content) - { - return $this->filesystem->update($this->path, $content); - } - - /** - * Update the file contents with a stream. - * - * @param resource $resource - * - * @return bool success boolean - */ - public function updateStream($resource) - { - return $this->filesystem->updateStream($this->path, $resource); - } - - /** - * Create the file or update if exists. - * - * @param string $content - * - * @return bool success boolean - */ - public function put($content) - { - return $this->filesystem->put($this->path, $content); - } - - /** - * Create the file or update if exists using a stream. - * - * @param resource $resource - * - * @return bool success boolean - */ - public function putStream($resource) - { - return $this->filesystem->putStream($this->path, $resource); - } - - /** - * Rename the file. - * - * @param string $newpath - * - * @return bool success boolean - */ - public function rename($newpath) - { - if ($this->filesystem->rename($this->path, $newpath)) { - $this->path = $newpath; - - return true; - } - - return false; - } - - /** - * Copy the file. - * - * @param string $newpath - * - * @return File|false new file or false - */ - public function copy($newpath) - { - if ($this->filesystem->copy($this->path, $newpath)) { - return new File($this->filesystem, $newpath); - } - - return false; - } - - /** - * Get the file's timestamp. - * - * @return string|false The timestamp or false on failure. - */ - public function getTimestamp() - { - return $this->filesystem->getTimestamp($this->path); - } - - /** - * Get the file's mimetype. - * - * @return string|false The file mime-type or false on failure. - */ - public function getMimetype() - { - return $this->filesystem->getMimetype($this->path); - } - - /** - * Get the file's visibility. - * - * @return string|false The visibility (public|private) or false on failure. - */ - public function getVisibility() - { - return $this->filesystem->getVisibility($this->path); - } - - /** - * Get the file's metadata. - * - * @return array|false The file metadata or false on failure. - */ - public function getMetadata() - { - return $this->filesystem->getMetadata($this->path); - } - - /** - * Get the file size. - * - * @return int|false The file size or false on failure. - */ - public function getSize() - { - return $this->filesystem->getSize($this->path); - } - - /** - * Delete the file. - * - * @return bool success boolean - */ - public function delete() - { - return $this->filesystem->delete($this->path); - } -} diff --git a/vendor/league/flysystem/src/FileExistsException.php b/vendor/league/flysystem/src/FileExistsException.php deleted file mode 100644 index c82e20c..0000000 --- a/vendor/league/flysystem/src/FileExistsException.php +++ /dev/null @@ -1,37 +0,0 @@ -path = $path; - - parent::__construct('File already exists at path: ' . $this->getPath(), $code, $previous); - } - - /** - * Get the path which was found. - * - * @return string - */ - public function getPath() - { - return $this->path; - } -} diff --git a/vendor/league/flysystem/src/FileNotFoundException.php b/vendor/league/flysystem/src/FileNotFoundException.php deleted file mode 100644 index 989df69..0000000 --- a/vendor/league/flysystem/src/FileNotFoundException.php +++ /dev/null @@ -1,37 +0,0 @@ -path = $path; - - parent::__construct('File not found at path: ' . $this->getPath(), $code, $previous); - } - - /** - * Get the path which was not found. - * - * @return string - */ - public function getPath() - { - return $this->path; - } -} diff --git a/vendor/league/flysystem/src/Filesystem.php b/vendor/league/flysystem/src/Filesystem.php deleted file mode 100644 index c4eaf27..0000000 --- a/vendor/league/flysystem/src/Filesystem.php +++ /dev/null @@ -1,409 +0,0 @@ -adapter = $adapter; - $this->setConfig($config); - } - - /** - * Get the Adapter. - * - * @return AdapterInterface adapter - */ - public function getAdapter() - { - return $this->adapter; - } - - /** - * @inheritdoc - */ - public function has($path) - { - $path = Util::normalizePath($path); - - return strlen($path) === 0 ? false : (bool) $this->getAdapter()->has($path); - } - - /** - * @inheritdoc - */ - public function write($path, $contents, array $config = []) - { - $path = Util::normalizePath($path); - $this->assertAbsent($path); - $config = $this->prepareConfig($config); - - return (bool) $this->getAdapter()->write($path, $contents, $config); - } - - /** - * @inheritdoc - */ - public function writeStream($path, $resource, array $config = []) - { - if ( ! is_resource($resource) || get_resource_type($resource) !== 'stream') { - throw new InvalidArgumentException(__METHOD__ . ' expects argument #2 to be a valid resource.'); - } - - $path = Util::normalizePath($path); - $this->assertAbsent($path); - $config = $this->prepareConfig($config); - - Util::rewindStream($resource); - - return (bool) $this->getAdapter()->writeStream($path, $resource, $config); - } - - /** - * @inheritdoc - */ - public function put($path, $contents, array $config = []) - { - $path = Util::normalizePath($path); - $config = $this->prepareConfig($config); - - if ( ! $this->getAdapter() instanceof CanOverwriteFiles && $this->has($path)) { - return (bool) $this->getAdapter()->update($path, $contents, $config); - } - - return (bool) $this->getAdapter()->write($path, $contents, $config); - } - - /** - * @inheritdoc - */ - public function putStream($path, $resource, array $config = []) - { - if ( ! is_resource($resource) || get_resource_type($resource) !== 'stream') { - throw new InvalidArgumentException(__METHOD__ . ' expects argument #2 to be a valid resource.'); - } - - $path = Util::normalizePath($path); - $config = $this->prepareConfig($config); - Util::rewindStream($resource); - - if ( ! $this->getAdapter() instanceof CanOverwriteFiles && $this->has($path)) { - return (bool) $this->getAdapter()->updateStream($path, $resource, $config); - } - - return (bool) $this->getAdapter()->writeStream($path, $resource, $config); - } - - /** - * @inheritdoc - */ - public function readAndDelete($path) - { - $path = Util::normalizePath($path); - $this->assertPresent($path); - $contents = $this->read($path); - - if ($contents === false) { - return false; - } - - $this->delete($path); - - return $contents; - } - - /** - * @inheritdoc - */ - public function update($path, $contents, array $config = []) - { - $path = Util::normalizePath($path); - $config = $this->prepareConfig($config); - - $this->assertPresent($path); - - return (bool) $this->getAdapter()->update($path, $contents, $config); - } - - /** - * @inheritdoc - */ - public function updateStream($path, $resource, array $config = []) - { - if ( ! is_resource($resource) || get_resource_type($resource) !== 'stream') { - throw new InvalidArgumentException(__METHOD__ . ' expects argument #2 to be a valid resource.'); - } - - $path = Util::normalizePath($path); - $config = $this->prepareConfig($config); - $this->assertPresent($path); - Util::rewindStream($resource); - - return (bool) $this->getAdapter()->updateStream($path, $resource, $config); - } - - /** - * @inheritdoc - */ - public function read($path) - { - $path = Util::normalizePath($path); - $this->assertPresent($path); - - if ( ! ($object = $this->getAdapter()->read($path))) { - return false; - } - - return $object['contents']; - } - - /** - * @inheritdoc - */ - public function readStream($path) - { - $path = Util::normalizePath($path); - $this->assertPresent($path); - - if ( ! $object = $this->getAdapter()->readStream($path)) { - return false; - } - - return $object['stream']; - } - - /** - * @inheritdoc - */ - public function rename($path, $newpath) - { - $path = Util::normalizePath($path); - $newpath = Util::normalizePath($newpath); - $this->assertPresent($path); - $this->assertAbsent($newpath); - - return (bool) $this->getAdapter()->rename($path, $newpath); - } - - /** - * @inheritdoc - */ - public function copy($path, $newpath) - { - $path = Util::normalizePath($path); - $newpath = Util::normalizePath($newpath); - $this->assertPresent($path); - $this->assertAbsent($newpath); - - return $this->getAdapter()->copy($path, $newpath); - } - - /** - * @inheritdoc - */ - public function delete($path) - { - $path = Util::normalizePath($path); - $this->assertPresent($path); - - return $this->getAdapter()->delete($path); - } - - /** - * @inheritdoc - */ - public function deleteDir($dirname) - { - $dirname = Util::normalizePath($dirname); - - if ($dirname === '') { - throw new RootViolationException('Root directories can not be deleted.'); - } - - return (bool) $this->getAdapter()->deleteDir($dirname); - } - - /** - * @inheritdoc - */ - public function createDir($dirname, array $config = []) - { - $dirname = Util::normalizePath($dirname); - $config = $this->prepareConfig($config); - - return (bool) $this->getAdapter()->createDir($dirname, $config); - } - - /** - * @inheritdoc - */ - public function listContents($directory = '', $recursive = false) - { - $directory = Util::normalizePath($directory); - $contents = $this->getAdapter()->listContents($directory, $recursive); - - return (new ContentListingFormatter($directory, $recursive, $this->config->get('case_sensitive', true))) - ->formatListing($contents); - } - - /** - * @inheritdoc - */ - public function getMimetype($path) - { - $path = Util::normalizePath($path); - $this->assertPresent($path); - - if (( ! $object = $this->getAdapter()->getMimetype($path)) || ! array_key_exists('mimetype', $object)) { - return false; - } - - return $object['mimetype']; - } - - /** - * @inheritdoc - */ - public function getTimestamp($path) - { - $path = Util::normalizePath($path); - $this->assertPresent($path); - - if (( ! $object = $this->getAdapter()->getTimestamp($path)) || ! array_key_exists('timestamp', $object)) { - return false; - } - - return (int) $object['timestamp']; - } - - /** - * @inheritdoc - */ - public function getVisibility($path) - { - $path = Util::normalizePath($path); - $this->assertPresent($path); - - if (( ! $object = $this->getAdapter()->getVisibility($path)) || ! array_key_exists('visibility', $object)) { - return false; - } - - return $object['visibility']; - } - - /** - * @inheritdoc - */ - public function getSize($path) - { - $path = Util::normalizePath($path); - $this->assertPresent($path); - - if (( ! $object = $this->getAdapter()->getSize($path)) || ! array_key_exists('size', $object)) { - return false; - } - - return (int) $object['size']; - } - - /** - * @inheritdoc - */ - public function setVisibility($path, $visibility) - { - $path = Util::normalizePath($path); - $this->assertPresent($path); - - return (bool) $this->getAdapter()->setVisibility($path, $visibility); - } - - /** - * @inheritdoc - */ - public function getMetadata($path) - { - $path = Util::normalizePath($path); - $this->assertPresent($path); - - return $this->getAdapter()->getMetadata($path); - } - - /** - * @inheritdoc - */ - public function get($path, Handler $handler = null) - { - $path = Util::normalizePath($path); - - if ( ! $handler) { - $metadata = $this->getMetadata($path); - $handler = ($metadata && $metadata['type'] === 'file') ? new File($this, $path) : new Directory($this, $path); - } - - $handler->setPath($path); - $handler->setFilesystem($this); - - return $handler; - } - - /** - * Assert a file is present. - * - * @param string $path path to file - * - * @throws FileNotFoundException - * - * @return void - */ - public function assertPresent($path) - { - if ($this->config->get('disable_asserts', false) === false && ! $this->has($path)) { - throw new FileNotFoundException($path); - } - } - - /** - * Assert a file is absent. - * - * @param string $path path to file - * - * @throws FileExistsException - * - * @return void - */ - public function assertAbsent($path) - { - if ($this->config->get('disable_asserts', false) === false && $this->has($path)) { - throw new FileExistsException($path); - } - } -} diff --git a/vendor/league/flysystem/src/FilesystemException.php b/vendor/league/flysystem/src/FilesystemException.php deleted file mode 100644 index 3121e53..0000000 --- a/vendor/league/flysystem/src/FilesystemException.php +++ /dev/null @@ -1,7 +0,0 @@ -path = $path; - $this->filesystem = $filesystem; - } - - /** - * Check whether the entree is a directory. - * - * @return bool - */ - public function isDir() - { - return $this->getType() === 'dir'; - } - - /** - * Check whether the entree is a file. - * - * @return bool - */ - public function isFile() - { - return $this->getType() === 'file'; - } - - /** - * Retrieve the entree type (file|dir). - * - * @return string file or dir - */ - public function getType() - { - $metadata = $this->filesystem->getMetadata($this->path); - - return $metadata ? $metadata['type'] : 'dir'; - } - - /** - * Set the Filesystem object. - * - * @param FilesystemInterface $filesystem - * - * @return $this - */ - public function setFilesystem(FilesystemInterface $filesystem) - { - $this->filesystem = $filesystem; - - return $this; - } - - /** - * Retrieve the Filesystem object. - * - * @return FilesystemInterface - */ - public function getFilesystem() - { - return $this->filesystem; - } - - /** - * Set the entree path. - * - * @param string $path - * - * @return $this - */ - public function setPath($path) - { - $this->path = $path; - - return $this; - } - - /** - * Retrieve the entree path. - * - * @return string path - */ - public function getPath() - { - return $this->path; - } - - /** - * Plugins pass-through. - * - * @param string $method - * @param array $arguments - * - * @return mixed - */ - public function __call($method, array $arguments) - { - array_unshift($arguments, $this->path); - $callback = [$this->filesystem, $method]; - - try { - return call_user_func_array($callback, $arguments); - } catch (BadMethodCallException $e) { - throw new BadMethodCallException( - 'Call to undefined method ' - . get_called_class() - . '::' . $method - ); - } - } -} diff --git a/vendor/league/flysystem/src/InvalidRootException.php b/vendor/league/flysystem/src/InvalidRootException.php deleted file mode 100644 index 468d1d5..0000000 --- a/vendor/league/flysystem/src/InvalidRootException.php +++ /dev/null @@ -1,9 +0,0 @@ - Filesystem,] - * - * @throws InvalidArgumentException - */ - public function __construct(array $filesystems = []) - { - $this->mountFilesystems($filesystems); - } - - /** - * Mount filesystems. - * - * @param FilesystemInterface[] $filesystems [:prefix => Filesystem,] - * - * @throws InvalidArgumentException - * - * @return $this - */ - public function mountFilesystems(array $filesystems) - { - foreach ($filesystems as $prefix => $filesystem) { - $this->mountFilesystem($prefix, $filesystem); - } - - return $this; - } - - /** - * Mount filesystems. - * - * @param string $prefix - * @param FilesystemInterface $filesystem - * - * @throws InvalidArgumentException - * - * @return $this - */ - public function mountFilesystem($prefix, FilesystemInterface $filesystem) - { - if ( ! is_string($prefix)) { - throw new InvalidArgumentException(__METHOD__ . ' expects argument #1 to be a string.'); - } - - $this->filesystems[$prefix] = $filesystem; - - return $this; - } - - /** - * Get the filesystem with the corresponding prefix. - * - * @param string $prefix - * - * @throws FilesystemNotFoundException - * - * @return FilesystemInterface - */ - public function getFilesystem($prefix) - { - if ( ! isset($this->filesystems[$prefix])) { - throw new FilesystemNotFoundException('No filesystem mounted with prefix ' . $prefix); - } - - return $this->filesystems[$prefix]; - } - - /** - * Retrieve the prefix from an arguments array. - * - * @param array $arguments - * - * @throws InvalidArgumentException - * - * @return array [:prefix, :arguments] - */ - public function filterPrefix(array $arguments) - { - if (empty($arguments)) { - throw new InvalidArgumentException('At least one argument needed'); - } - - $path = array_shift($arguments); - - if ( ! is_string($path)) { - throw new InvalidArgumentException('First argument should be a string'); - } - - list($prefix, $path) = $this->getPrefixAndPath($path); - array_unshift($arguments, $path); - - return [$prefix, $arguments]; - } - - /** - * @param string $directory - * @param bool $recursive - * - * @throws InvalidArgumentException - * @throws FilesystemNotFoundException - * - * @return array - */ - public function listContents($directory = '', $recursive = false) - { - list($prefix, $directory) = $this->getPrefixAndPath($directory); - $filesystem = $this->getFilesystem($prefix); - $result = $filesystem->listContents($directory, $recursive); - - foreach ($result as &$file) { - $file['filesystem'] = $prefix; - } - - return $result; - } - - /** - * Call forwarder. - * - * @param string $method - * @param array $arguments - * - * @throws InvalidArgumentException - * @throws FilesystemNotFoundException - * - * @return mixed - */ - public function __call($method, $arguments) - { - list($prefix, $arguments) = $this->filterPrefix($arguments); - - return $this->invokePluginOnFilesystem($method, $arguments, $prefix); - } - - /** - * @param string $from - * @param string $to - * @param array $config - * - * @throws InvalidArgumentException - * @throws FilesystemNotFoundException - * @throws FileExistsException - * - * @return bool - */ - public function copy($from, $to, array $config = []) - { - list($prefixFrom, $from) = $this->getPrefixAndPath($from); - - $buffer = $this->getFilesystem($prefixFrom)->readStream($from); - - if ($buffer === false) { - return false; - } - - list($prefixTo, $to) = $this->getPrefixAndPath($to); - - $result = $this->getFilesystem($prefixTo)->writeStream($to, $buffer, $config); - - if (is_resource($buffer)) { - fclose($buffer); - } - - return $result; - } - - /** - * List with plugin adapter. - * - * @param array $keys - * @param string $directory - * @param bool $recursive - * - * @throws InvalidArgumentException - * @throws FilesystemNotFoundException - * - * @return array - */ - public function listWith(array $keys = [], $directory = '', $recursive = false) - { - list($prefix, $directory) = $this->getPrefixAndPath($directory); - $arguments = [$keys, $directory, $recursive]; - - return $this->invokePluginOnFilesystem('listWith', $arguments, $prefix); - } - - /** - * Move a file. - * - * @param string $from - * @param string $to - * @param array $config - * - * @throws InvalidArgumentException - * @throws FilesystemNotFoundException - * - * @return bool - */ - public function move($from, $to, array $config = []) - { - list($prefixFrom, $pathFrom) = $this->getPrefixAndPath($from); - list($prefixTo, $pathTo) = $this->getPrefixAndPath($to); - - if ($prefixFrom === $prefixTo) { - $filesystem = $this->getFilesystem($prefixFrom); - $renamed = $filesystem->rename($pathFrom, $pathTo); - - if ($renamed && isset($config['visibility'])) { - return $filesystem->setVisibility($pathTo, $config['visibility']); - } - - return $renamed; - } - - $copied = $this->copy($from, $to, $config); - - if ($copied) { - return $this->delete($from); - } - - return false; - } - - /** - * Invoke a plugin on a filesystem mounted on a given prefix. - * - * @param string $method - * @param array $arguments - * @param string $prefix - * - * @throws FilesystemNotFoundException - * - * @return mixed - */ - public function invokePluginOnFilesystem($method, $arguments, $prefix) - { - $filesystem = $this->getFilesystem($prefix); - - try { - return $this->invokePlugin($method, $arguments, $filesystem); - } catch (PluginNotFoundException $e) { - // Let it pass, it's ok, don't panic. - } - - $callback = [$filesystem, $method]; - - return call_user_func_array($callback, $arguments); - } - - /** - * @param string $path - * - * @throws InvalidArgumentException - * - * @return string[] [:prefix, :path] - */ - protected function getPrefixAndPath($path) - { - if (strpos($path, '://') < 1) { - throw new InvalidArgumentException('No prefix detected in path: ' . $path); - } - - return explode('://', $path, 2); - } - - /** - * Check whether a file exists. - * - * @param string $path - * - * @return bool - */ - public function has($path) - { - list($prefix, $path) = $this->getPrefixAndPath($path); - - return $this->getFilesystem($prefix)->has($path); - } - - /** - * Read a file. - * - * @param string $path The path to the file. - * - * @throws FileNotFoundException - * - * @return string|false The file contents or false on failure. - */ - public function read($path) - { - list($prefix, $path) = $this->getPrefixAndPath($path); - - return $this->getFilesystem($prefix)->read($path); - } - - /** - * Retrieves a read-stream for a path. - * - * @param string $path The path to the file. - * - * @throws FileNotFoundException - * - * @return resource|false The path resource or false on failure. - */ - public function readStream($path) - { - list($prefix, $path) = $this->getPrefixAndPath($path); - - return $this->getFilesystem($prefix)->readStream($path); - } - - /** - * Get a file's metadata. - * - * @param string $path The path to the file. - * - * @throws FileNotFoundException - * - * @return array|false The file metadata or false on failure. - */ - public function getMetadata($path) - { - list($prefix, $path) = $this->getPrefixAndPath($path); - - return $this->getFilesystem($prefix)->getMetadata($path); - } - - /** - * Get a file's size. - * - * @param string $path The path to the file. - * - * @throws FileNotFoundException - * - * @return int|false The file size or false on failure. - */ - public function getSize($path) - { - list($prefix, $path) = $this->getPrefixAndPath($path); - - return $this->getFilesystem($prefix)->getSize($path); - } - - /** - * Get a file's mime-type. - * - * @param string $path The path to the file. - * - * @throws FileNotFoundException - * - * @return string|false The file mime-type or false on failure. - */ - public function getMimetype($path) - { - list($prefix, $path) = $this->getPrefixAndPath($path); - - return $this->getFilesystem($prefix)->getMimetype($path); - } - - /** - * Get a file's timestamp. - * - * @param string $path The path to the file. - * - * @throws FileNotFoundException - * - * @return string|false The timestamp or false on failure. - */ - public function getTimestamp($path) - { - list($prefix, $path) = $this->getPrefixAndPath($path); - - return $this->getFilesystem($prefix)->getTimestamp($path); - } - - /** - * Get a file's visibility. - * - * @param string $path The path to the file. - * - * @throws FileNotFoundException - * - * @return string|false The visibility (public|private) or false on failure. - */ - public function getVisibility($path) - { - list($prefix, $path) = $this->getPrefixAndPath($path); - - return $this->getFilesystem($prefix)->getVisibility($path); - } - - /** - * Write a new file. - * - * @param string $path The path of the new file. - * @param string $contents The file contents. - * @param array $config An optional configuration array. - * - * @throws FileExistsException - * - * @return bool True on success, false on failure. - */ - public function write($path, $contents, array $config = []) - { - list($prefix, $path) = $this->getPrefixAndPath($path); - - return $this->getFilesystem($prefix)->write($path, $contents, $config); - } - - /** - * Write a new file using a stream. - * - * @param string $path The path of the new file. - * @param resource $resource The file handle. - * @param array $config An optional configuration array. - * - * @throws InvalidArgumentException If $resource is not a file handle. - * @throws FileExistsException - * - * @return bool True on success, false on failure. - */ - public function writeStream($path, $resource, array $config = []) - { - list($prefix, $path) = $this->getPrefixAndPath($path); - - return $this->getFilesystem($prefix)->writeStream($path, $resource, $config); - } - - /** - * Update an existing file. - * - * @param string $path The path of the existing file. - * @param string $contents The file contents. - * @param array $config An optional configuration array. - * - * @throws FileNotFoundException - * - * @return bool True on success, false on failure. - */ - public function update($path, $contents, array $config = []) - { - list($prefix, $path) = $this->getPrefixAndPath($path); - - return $this->getFilesystem($prefix)->update($path, $contents, $config); - } - - /** - * Update an existing file using a stream. - * - * @param string $path The path of the existing file. - * @param resource $resource The file handle. - * @param array $config An optional configuration array. - * - * @throws InvalidArgumentException If $resource is not a file handle. - * @throws FileNotFoundException - * - * @return bool True on success, false on failure. - */ - public function updateStream($path, $resource, array $config = []) - { - list($prefix, $path) = $this->getPrefixAndPath($path); - - return $this->getFilesystem($prefix)->updateStream($path, $resource, $config); - } - - /** - * Rename a file. - * - * @param string $path Path to the existing file. - * @param string $newpath The new path of the file. - * - * @throws FileExistsException Thrown if $newpath exists. - * @throws FileNotFoundException Thrown if $path does not exist. - * - * @return bool True on success, false on failure. - */ - public function rename($path, $newpath) - { - list($prefix, $path) = $this->getPrefixAndPath($path); - - return $this->getFilesystem($prefix)->rename($path, $newpath); - } - - /** - * Delete a file. - * - * @param string $path - * - * @throws FileNotFoundException - * - * @return bool True on success, false on failure. - */ - public function delete($path) - { - list($prefix, $path) = $this->getPrefixAndPath($path); - - return $this->getFilesystem($prefix)->delete($path); - } - - /** - * Delete a directory. - * - * @param string $dirname - * - * @throws RootViolationException Thrown if $dirname is empty. - * - * @return bool True on success, false on failure. - */ - public function deleteDir($dirname) - { - list($prefix, $dirname) = $this->getPrefixAndPath($dirname); - - return $this->getFilesystem($prefix)->deleteDir($dirname); - } - - /** - * Create a directory. - * - * @param string $dirname The name of the new directory. - * @param array $config An optional configuration array. - * - * @return bool True on success, false on failure. - */ - public function createDir($dirname, array $config = []) - { - list($prefix, $dirname) = $this->getPrefixAndPath($dirname); - - return $this->getFilesystem($prefix)->createDir($dirname); - } - - /** - * Set the visibility for a file. - * - * @param string $path The path to the file. - * @param string $visibility One of 'public' or 'private'. - * - * @throws FileNotFoundException - * - * @return bool True on success, false on failure. - */ - public function setVisibility($path, $visibility) - { - list($prefix, $path) = $this->getPrefixAndPath($path); - - return $this->getFilesystem($prefix)->setVisibility($path, $visibility); - } - - /** - * Create a file or update if exists. - * - * @param string $path The path to the file. - * @param string $contents The file contents. - * @param array $config An optional configuration array. - * - * @return bool True on success, false on failure. - */ - public function put($path, $contents, array $config = []) - { - list($prefix, $path) = $this->getPrefixAndPath($path); - - return $this->getFilesystem($prefix)->put($path, $contents, $config); - } - - /** - * Create a file or update if exists. - * - * @param string $path The path to the file. - * @param resource $resource The file handle. - * @param array $config An optional configuration array. - * - * @throws InvalidArgumentException Thrown if $resource is not a resource. - * - * @return bool True on success, false on failure. - */ - public function putStream($path, $resource, array $config = []) - { - list($prefix, $path) = $this->getPrefixAndPath($path); - - return $this->getFilesystem($prefix)->putStream($path, $resource, $config); - } - - /** - * Read and delete a file. - * - * @param string $path The path to the file. - * - * @throws FileNotFoundException - * - * @return string|false The file contents, or false on failure. - */ - public function readAndDelete($path) - { - list($prefix, $path) = $this->getPrefixAndPath($path); - - return $this->getFilesystem($prefix)->readAndDelete($path); - } - - /** - * Get a file/directory handler. - * - * @deprecated - * - * @param string $path The path to the file. - * @param Handler $handler An optional existing handler to populate. - * - * @return Handler Either a file or directory handler. - */ - public function get($path, Handler $handler = null) - { - list($prefix, $path) = $this->getPrefixAndPath($path); - - return $this->getFilesystem($prefix)->get($path); - } -} diff --git a/vendor/league/flysystem/src/NotSupportedException.php b/vendor/league/flysystem/src/NotSupportedException.php deleted file mode 100644 index e0a989b..0000000 --- a/vendor/league/flysystem/src/NotSupportedException.php +++ /dev/null @@ -1,37 +0,0 @@ -getPathname()); - } - - /** - * Create a new exception for a link. - * - * @param string $systemType - * - * @return static - */ - public static function forFtpSystemType($systemType) - { - $message = "The FTP system type '$systemType' is currently not supported."; - - return new static($message); - } -} diff --git a/vendor/league/flysystem/src/Plugin/AbstractPlugin.php b/vendor/league/flysystem/src/Plugin/AbstractPlugin.php deleted file mode 100644 index 0d56789..0000000 --- a/vendor/league/flysystem/src/Plugin/AbstractPlugin.php +++ /dev/null @@ -1,24 +0,0 @@ -filesystem = $filesystem; - } -} diff --git a/vendor/league/flysystem/src/Plugin/EmptyDir.php b/vendor/league/flysystem/src/Plugin/EmptyDir.php deleted file mode 100644 index b5ae7f5..0000000 --- a/vendor/league/flysystem/src/Plugin/EmptyDir.php +++ /dev/null @@ -1,34 +0,0 @@ -filesystem->listContents($dirname, false); - - foreach ($listing as $item) { - if ($item['type'] === 'dir') { - $this->filesystem->deleteDir($item['path']); - } else { - $this->filesystem->delete($item['path']); - } - } - } -} diff --git a/vendor/league/flysystem/src/Plugin/ForcedCopy.php b/vendor/league/flysystem/src/Plugin/ForcedCopy.php deleted file mode 100644 index a41e9f3..0000000 --- a/vendor/league/flysystem/src/Plugin/ForcedCopy.php +++ /dev/null @@ -1,44 +0,0 @@ -filesystem->delete($newpath); - } catch (FileNotFoundException $e) { - // The destination path does not exist. That's ok. - $deleted = true; - } - - if ($deleted) { - return $this->filesystem->copy($path, $newpath); - } - - return false; - } -} diff --git a/vendor/league/flysystem/src/Plugin/ForcedRename.php b/vendor/league/flysystem/src/Plugin/ForcedRename.php deleted file mode 100644 index 3f51cd6..0000000 --- a/vendor/league/flysystem/src/Plugin/ForcedRename.php +++ /dev/null @@ -1,44 +0,0 @@ -filesystem->delete($newpath); - } catch (FileNotFoundException $e) { - // The destination path does not exist. That's ok. - $deleted = true; - } - - if ($deleted) { - return $this->filesystem->rename($path, $newpath); - } - - return false; - } -} diff --git a/vendor/league/flysystem/src/Plugin/GetWithMetadata.php b/vendor/league/flysystem/src/Plugin/GetWithMetadata.php deleted file mode 100644 index 2f13d2f..0000000 --- a/vendor/league/flysystem/src/Plugin/GetWithMetadata.php +++ /dev/null @@ -1,51 +0,0 @@ -filesystem->getMetadata($path); - - if ( ! $object) { - return false; - } - - $keys = array_diff($metadata, array_keys($object)); - - foreach ($keys as $key) { - if ( ! method_exists($this->filesystem, $method = 'get' . ucfirst($key))) { - throw new InvalidArgumentException('Could not fetch metadata: ' . $key); - } - - $object[$key] = $this->filesystem->{$method}($path); - } - - return $object; - } -} diff --git a/vendor/league/flysystem/src/Plugin/ListFiles.php b/vendor/league/flysystem/src/Plugin/ListFiles.php deleted file mode 100644 index 9669fe7..0000000 --- a/vendor/league/flysystem/src/Plugin/ListFiles.php +++ /dev/null @@ -1,35 +0,0 @@ -filesystem->listContents($directory, $recursive); - - $filter = function ($object) { - return $object['type'] === 'file'; - }; - - return array_values(array_filter($contents, $filter)); - } -} diff --git a/vendor/league/flysystem/src/Plugin/ListPaths.php b/vendor/league/flysystem/src/Plugin/ListPaths.php deleted file mode 100644 index 0889d1f..0000000 --- a/vendor/league/flysystem/src/Plugin/ListPaths.php +++ /dev/null @@ -1,36 +0,0 @@ -filesystem->listContents($directory, $recursive); - - foreach ($contents as $object) { - $result[] = $object['path']; - } - - return $result; - } -} diff --git a/vendor/league/flysystem/src/Plugin/ListWith.php b/vendor/league/flysystem/src/Plugin/ListWith.php deleted file mode 100644 index d64debe..0000000 --- a/vendor/league/flysystem/src/Plugin/ListWith.php +++ /dev/null @@ -1,60 +0,0 @@ -filesystem->listContents($directory, $recursive); - - foreach ($contents as $index => $object) { - if ($object['type'] === 'file') { - $missingKeys = array_diff($keys, array_keys($object)); - $contents[$index] = array_reduce($missingKeys, [$this, 'getMetadataByName'], $object); - } - } - - return $contents; - } - - /** - * Get a meta-data value by key name. - * - * @param array $object - * @param string $key - * - * @return array - */ - protected function getMetadataByName(array $object, $key) - { - $method = 'get' . ucfirst($key); - - if ( ! method_exists($this->filesystem, $method)) { - throw new \InvalidArgumentException('Could not get meta-data for key: ' . $key); - } - - $object[$key] = $this->filesystem->{$method}($object['path']); - - return $object; - } -} diff --git a/vendor/league/flysystem/src/Plugin/PluggableTrait.php b/vendor/league/flysystem/src/Plugin/PluggableTrait.php deleted file mode 100644 index 922edfe..0000000 --- a/vendor/league/flysystem/src/Plugin/PluggableTrait.php +++ /dev/null @@ -1,97 +0,0 @@ -plugins[$plugin->getMethod()] = $plugin; - - return $this; - } - - /** - * Find a specific plugin. - * - * @param string $method - * - * @throws PluginNotFoundException - * - * @return PluginInterface - */ - protected function findPlugin($method) - { - if ( ! isset($this->plugins[$method])) { - throw new PluginNotFoundException('Plugin not found for method: ' . $method); - } - - return $this->plugins[$method]; - } - - /** - * Invoke a plugin by method name. - * - * @param string $method - * @param array $arguments - * @param FilesystemInterface $filesystem - * - * @throws PluginNotFoundException - * - * @return mixed - */ - protected function invokePlugin($method, array $arguments, FilesystemInterface $filesystem) - { - $plugin = $this->findPlugin($method); - $plugin->setFilesystem($filesystem); - $callback = [$plugin, 'handle']; - - return call_user_func_array($callback, $arguments); - } - - /** - * Plugins pass-through. - * - * @param string $method - * @param array $arguments - * - * @throws BadMethodCallException - * - * @return mixed - */ - public function __call($method, array $arguments) - { - try { - return $this->invokePlugin($method, $arguments, $this); - } catch (PluginNotFoundException $e) { - throw new BadMethodCallException( - 'Call to undefined method ' - . get_class($this) - . '::' . $method - ); - } - } -} diff --git a/vendor/league/flysystem/src/Plugin/PluginNotFoundException.php b/vendor/league/flysystem/src/Plugin/PluginNotFoundException.php deleted file mode 100644 index fd1d7e7..0000000 --- a/vendor/league/flysystem/src/Plugin/PluginNotFoundException.php +++ /dev/null @@ -1,10 +0,0 @@ -hash = spl_object_hash($this); - static::$safeStorage[$this->hash] = []; - } - - public function storeSafely($key, $value) - { - static::$safeStorage[$this->hash][$key] = $value; - } - - public function retrieveSafely($key) - { - if (array_key_exists($key, static::$safeStorage[$this->hash])) { - return static::$safeStorage[$this->hash][$key]; - } - } - - public function __destruct() - { - unset(static::$safeStorage[$this->hash]); - } -} diff --git a/vendor/league/flysystem/src/UnreadableFileException.php b/vendor/league/flysystem/src/UnreadableFileException.php deleted file mode 100644 index e668033..0000000 --- a/vendor/league/flysystem/src/UnreadableFileException.php +++ /dev/null @@ -1,18 +0,0 @@ -getRealPath() - ) - ); - } -} diff --git a/vendor/league/flysystem/src/Util.php b/vendor/league/flysystem/src/Util.php deleted file mode 100644 index 1a2db71..0000000 --- a/vendor/league/flysystem/src/Util.php +++ /dev/null @@ -1,354 +0,0 @@ - '']; - } - - /** - * Normalize a dirname return value. - * - * @param string $dirname - * - * @return string normalized dirname - */ - public static function normalizeDirname($dirname) - { - return $dirname === '.' ? '' : $dirname; - } - - /** - * Get a normalized dirname from a path. - * - * @param string $path - * - * @return string dirname - */ - public static function dirname($path) - { - return static::normalizeDirname(dirname($path)); - } - - /** - * Map result arrays. - * - * @param array $object - * @param array $map - * - * @return array mapped result - */ - public static function map(array $object, array $map) - { - $result = []; - - foreach ($map as $from => $to) { - if ( ! isset($object[$from])) { - continue; - } - - $result[$to] = $object[$from]; - } - - return $result; - } - - /** - * Normalize path. - * - * @param string $path - * - * @throws LogicException - * - * @return string - */ - public static function normalizePath($path) - { - return static::normalizeRelativePath($path); - } - - /** - * Normalize relative directories in a path. - * - * @param string $path - * - * @throws LogicException - * - * @return string - */ - public static function normalizeRelativePath($path) - { - $path = str_replace('\\', '/', $path); - $path = static::removeFunkyWhiteSpace($path); - $parts = []; - - foreach (explode('/', $path) as $part) { - switch ($part) { - case '': - case '.': - break; - - case '..': - if (empty($parts)) { - throw new LogicException( - 'Path is outside of the defined root, path: [' . $path . ']' - ); - } - array_pop($parts); - break; - - default: - $parts[] = $part; - break; - } - } - - $path = implode('/', $parts); - - return $path; - } - - /** - * Rejects unprintable characters and invalid unicode characters. - * - * @param string $path - * - * @return string $path - */ - protected static function removeFunkyWhiteSpace($path) - { - if (preg_match('#\p{C}+#u', $path)) { - throw CorruptedPathDetected::forPath($path); - } - - return $path; - } - - /** - * Normalize prefix. - * - * @param string $prefix - * @param string $separator - * - * @return string normalized path - */ - public static function normalizePrefix($prefix, $separator) - { - return rtrim($prefix, $separator) . $separator; - } - - /** - * Get content size. - * - * @param string $contents - * - * @return int content size - */ - public static function contentSize($contents) - { - return defined('MB_OVERLOAD_STRING') ? mb_strlen($contents, '8bit') : strlen($contents); - } - - /** - * Guess MIME Type based on the path of the file and it's content. - * - * @param string $path - * @param string|resource $content - * - * @return string|null MIME Type or NULL if no extension detected - */ - public static function guessMimeType($path, $content) - { - $mimeType = MimeType::detectByContent($content); - - if ( ! (empty($mimeType) || in_array($mimeType, ['application/x-empty', 'text/plain', 'text/x-asm']))) { - return $mimeType; - } - - return MimeType::detectByFilename($path); - } - - /** - * Emulate directories. - * - * @param array $listing - * - * @return array listing with emulated directories - */ - public static function emulateDirectories(array $listing) - { - $directories = []; - $listedDirectories = []; - - foreach ($listing as $object) { - [$directories, $listedDirectories] = static::emulateObjectDirectories($object, $directories, $listedDirectories); - } - - $directories = array_diff(array_unique($directories), array_unique($listedDirectories)); - - foreach ($directories as $directory) { - $listing[] = static::pathinfo($directory) + ['type' => 'dir']; - } - - return $listing; - } - - /** - * Ensure a Config instance. - * - * @param null|array|Config $config - * - * @return Config config instance - * - * @throw LogicException - */ - public static function ensureConfig($config) - { - if ($config === null) { - return new Config(); - } - - if ($config instanceof Config) { - return $config; - } - - if (is_array($config)) { - return new Config($config); - } - - throw new LogicException('A config should either be an array or a Flysystem\Config object.'); - } - - /** - * Rewind a stream. - * - * @param resource $resource - */ - public static function rewindStream($resource) - { - if (ftell($resource) !== 0 && static::isSeekableStream($resource)) { - rewind($resource); - } - } - - public static function isSeekableStream($resource) - { - $metadata = stream_get_meta_data($resource); - - return $metadata['seekable']; - } - - /** - * Get the size of a stream. - * - * @param resource $resource - * - * @return int|null stream size - */ - public static function getStreamSize($resource) - { - $stat = fstat($resource); - - if ( ! is_array($stat) || ! isset($stat['size'])) { - return null; - } - - return $stat['size']; - } - - /** - * Emulate the directories of a single object. - * - * @param array $object - * @param array $directories - * @param array $listedDirectories - * - * @return array - */ - protected static function emulateObjectDirectories(array $object, array $directories, array $listedDirectories) - { - if ($object['type'] === 'dir') { - $listedDirectories[] = $object['path']; - } - - if ( ! isset($object['dirname']) || trim($object['dirname']) === '') { - return [$directories, $listedDirectories]; - } - - $parent = $object['dirname']; - - while (isset($parent) && trim($parent) !== '' && ! in_array($parent, $directories)) { - $directories[] = $parent; - $parent = static::dirname($parent); - } - - if (isset($object['type']) && $object['type'] === 'dir') { - $listedDirectories[] = $object['path']; - - return [$directories, $listedDirectories]; - } - - return [$directories, $listedDirectories]; - } - - /** - * Returns the trailing name component of the path. - * - * @param string $path - * - * @return string - */ - private static function basename($path) - { - $separators = DIRECTORY_SEPARATOR === '/' ? '/' : '\/'; - - $path = rtrim($path, $separators); - - $basename = preg_replace('#.*?([^' . preg_quote($separators, '#') . ']+$)#', '$1', $path); - - if (DIRECTORY_SEPARATOR === '/') { - return $basename; - } - // @codeCoverageIgnoreStart - // Extra Windows path munging. This is tested via AppVeyor, but code - // coverage is not reported. - - // Handle relative paths with drive letters. c:file.txt. - while (preg_match('#^[a-zA-Z]{1}:[^\\\/]#', $basename)) { - $basename = substr($basename, 2); - } - - // Remove colon for standalone drive letter names. - if (preg_match('#^[a-zA-Z]{1}:$#', $basename)) { - $basename = rtrim($basename, ':'); - } - - return $basename; - // @codeCoverageIgnoreEnd - } -} diff --git a/vendor/league/flysystem/src/Util/ContentListingFormatter.php b/vendor/league/flysystem/src/Util/ContentListingFormatter.php deleted file mode 100644 index ae0d3b9..0000000 --- a/vendor/league/flysystem/src/Util/ContentListingFormatter.php +++ /dev/null @@ -1,122 +0,0 @@ -directory = rtrim($directory, '/'); - $this->recursive = $recursive; - $this->caseSensitive = $caseSensitive; - } - - /** - * Format contents listing. - * - * @param array $listing - * - * @return array - */ - public function formatListing(array $listing) - { - $listing = array_filter(array_map([$this, 'addPathInfo'], $listing), [$this, 'isEntryOutOfScope']); - - return $this->sortListing(array_values($listing)); - } - - private function addPathInfo(array $entry) - { - return $entry + Util::pathinfo($entry['path']); - } - - /** - * Determine if the entry is out of scope. - * - * @param array $entry - * - * @return bool - */ - private function isEntryOutOfScope(array $entry) - { - if (empty($entry['path']) && $entry['path'] !== '0') { - return false; - } - - if ($this->recursive) { - return $this->residesInDirectory($entry); - } - - return $this->isDirectChild($entry); - } - - /** - * Check if the entry resides within the parent directory. - * - * @param array $entry - * - * @return bool - */ - private function residesInDirectory(array $entry) - { - if ($this->directory === '') { - return true; - } - - return $this->caseSensitive - ? strpos($entry['path'], $this->directory . '/') === 0 - : stripos($entry['path'], $this->directory . '/') === 0; - } - - /** - * Check if the entry is a direct child of the directory. - * - * @param array $entry - * - * @return bool - */ - private function isDirectChild(array $entry) - { - return $this->caseSensitive - ? $entry['dirname'] === $this->directory - : strcasecmp($this->directory, $entry['dirname']) === 0; - } - - /** - * @param array $listing - * - * @return array - */ - private function sortListing(array $listing) - { - usort($listing, function ($a, $b) { - return strcasecmp($a['path'], $b['path']); - }); - - return $listing; - } -} diff --git a/vendor/league/flysystem/src/Util/MimeType.php b/vendor/league/flysystem/src/Util/MimeType.php deleted file mode 100644 index 35cba3f..0000000 --- a/vendor/league/flysystem/src/Util/MimeType.php +++ /dev/null @@ -1,80 +0,0 @@ -detectMimeTypeFromBuffer($content); - } - - return 'text/plain'; - } - - /** - * Detects MIME Type based on file extension. - * - * @param string $extension - * - * @return string MIME Type - */ - public static function detectByFileExtension($extension) - { - return static::detector()->detectMimeTypeFromPath('artificial.' . $extension) ?: 'text/plain'; - } - - /** - * @param string $filename - * - * @return string MIME Type - */ - public static function detectByFilename($filename) - { - return static::detector()->detectMimeTypeFromPath($filename) ?: 'text/plain'; - } - - /** - * @return array Map of file extension to MIME Type - */ - public static function getExtensionToMimeTypeMap() - { - return static::$extensionToMimeTypeMap; - } -} diff --git a/vendor/league/flysystem/src/Util/StreamHasher.php b/vendor/league/flysystem/src/Util/StreamHasher.php deleted file mode 100644 index 938ec5d..0000000 --- a/vendor/league/flysystem/src/Util/StreamHasher.php +++ /dev/null @@ -1,36 +0,0 @@ -algo = $algo; - } - - /** - * @param resource $resource - * - * @return string - */ - public function hash($resource) - { - rewind($resource); - $context = hash_init($this->algo); - hash_update_stream($context, $resource); - fclose($resource); - - return hash_final($context); - } -} diff --git a/vendor/league/mime-type-detection/CHANGELOG.md b/vendor/league/mime-type-detection/CHANGELOG.md deleted file mode 100644 index 2264f7a..0000000 --- a/vendor/league/mime-type-detection/CHANGELOG.md +++ /dev/null @@ -1,31 +0,0 @@ -# Changelog - -## 1.10.0 - 2022-04-11 - -### Fixed - -- Added Flysystem v1 inconclusive mime-types and made it configurable as a constructor parameter. - -## 1.9.0 - 2021-11-21 - -### Updated - -- Updated lookup - -## 1.8.0 - 2021-09-25 - -### Added - -- Added the decorator `OverridingExtensionToMimeTypeMap` which allows you to override values. - -## 1.7.0 - 2021-01-18 - -### Added - -- Added a `bufferSampleSize` parameter to the `FinfoMimeTypeDetector` class that allows you to send a reduced content sample which costs less memory. - -## 1.6.0 - 2021-01-18 - -### Changes - -- Updated generated mime-type map diff --git a/vendor/league/mime-type-detection/LICENSE b/vendor/league/mime-type-detection/LICENSE deleted file mode 100644 index 1f01652..0000000 --- a/vendor/league/mime-type-detection/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2013-2022 Frank de Jonge - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/league/mime-type-detection/composer.json b/vendor/league/mime-type-detection/composer.json deleted file mode 100644 index 80ca1af..0000000 --- a/vendor/league/mime-type-detection/composer.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "name": "league/mime-type-detection", - "description": "Mime-type detection for Flysystem", - "license": "MIT", - "authors": [ - { - "name": "Frank de Jonge", - "email": "info@frankdejonge.nl" - } - ], - "scripts": { - "test": "vendor/bin/phpunit", - "phpstan": "vendor/bin/phpstan analyse -l 6 src" - }, - "require": { - "php": "^7.2 || ^8.0", - "ext-fileinfo": "*" - }, - "require-dev": { - "phpunit/phpunit": "^8.5.8 || ^9.3", - "phpstan/phpstan": "^0.12.68", - "friendsofphp/php-cs-fixer": "^3.2" - }, - "autoload": { - "psr-4": { - "League\\MimeTypeDetection\\": "src" - } - }, - "config": { - "platform": { - "php": "7.2.0" - } - } -} diff --git a/vendor/league/mime-type-detection/src/EmptyExtensionToMimeTypeMap.php b/vendor/league/mime-type-detection/src/EmptyExtensionToMimeTypeMap.php deleted file mode 100644 index fc04241..0000000 --- a/vendor/league/mime-type-detection/src/EmptyExtensionToMimeTypeMap.php +++ /dev/null @@ -1,13 +0,0 @@ -extensions = $extensions ?: new GeneratedExtensionToMimeTypeMap(); - } - - public function detectMimeType(string $path, $contents): ?string - { - return $this->detectMimeTypeFromPath($path); - } - - public function detectMimeTypeFromPath(string $path): ?string - { - $extension = strtolower(pathinfo($path, PATHINFO_EXTENSION)); - - return $this->extensions->lookupMimeType($extension); - } - - public function detectMimeTypeFromFile(string $path): ?string - { - return $this->detectMimeTypeFromPath($path); - } - - public function detectMimeTypeFromBuffer(string $contents): ?string - { - return null; - } -} diff --git a/vendor/league/mime-type-detection/src/ExtensionToMimeTypeMap.php b/vendor/league/mime-type-detection/src/ExtensionToMimeTypeMap.php deleted file mode 100644 index 1dad7bc..0000000 --- a/vendor/league/mime-type-detection/src/ExtensionToMimeTypeMap.php +++ /dev/null @@ -1,10 +0,0 @@ - - */ - private $inconclusiveMimetypes; - - public function __construct( - string $magicFile = '', - ExtensionToMimeTypeMap $extensionMap = null, - ?int $bufferSampleSize = null, - array $inconclusiveMimetypes = self::INCONCLUSIVE_MIME_TYPES - ) { - $this->finfo = new finfo(FILEINFO_MIME_TYPE, $magicFile); - $this->extensionMap = $extensionMap ?: new GeneratedExtensionToMimeTypeMap(); - $this->bufferSampleSize = $bufferSampleSize; - $this->inconclusiveMimetypes = $inconclusiveMimetypes; - } - - public function detectMimeType(string $path, $contents): ?string - { - $mimeType = is_string($contents) - ? (@$this->finfo->buffer($this->takeSample($contents)) ?: null) - : null; - - if ($mimeType !== null && ! in_array($mimeType, $this->inconclusiveMimetypes)) { - return $mimeType; - } - - return $this->detectMimeTypeFromPath($path); - } - - public function detectMimeTypeFromPath(string $path): ?string - { - $extension = strtolower(pathinfo($path, PATHINFO_EXTENSION)); - - return $this->extensionMap->lookupMimeType($extension); - } - - public function detectMimeTypeFromFile(string $path): ?string - { - return @$this->finfo->file($path) ?: null; - } - - public function detectMimeTypeFromBuffer(string $contents): ?string - { - return @$this->finfo->buffer($this->takeSample($contents)) ?: null; - } - - private function takeSample(string $contents): string - { - if ($this->bufferSampleSize === null) { - return $contents; - } - - return (string) substr($contents, 0, $this->bufferSampleSize); - } -} diff --git a/vendor/league/mime-type-detection/src/GeneratedExtensionToMimeTypeMap.php b/vendor/league/mime-type-detection/src/GeneratedExtensionToMimeTypeMap.php deleted file mode 100644 index f092388..0000000 --- a/vendor/league/mime-type-detection/src/GeneratedExtensionToMimeTypeMap.php +++ /dev/null @@ -1,1227 +0,0 @@ - 'application/vnd.1000minds.decision-model+xml', - '3dml' => 'text/vnd.in3d.3dml', - '3ds' => 'image/x-3ds', - '3g2' => 'video/3gpp2', - '3gp' => 'video/3gp', - '3gpp' => 'video/3gpp', - '3mf' => 'model/3mf', - '7z' => 'application/x-7z-compressed', - '7zip' => 'application/x-7z-compressed', - '123' => 'application/vnd.lotus-1-2-3', - 'aab' => 'application/x-authorware-bin', - 'aac' => 'audio/x-acc', - 'aam' => 'application/x-authorware-map', - 'aas' => 'application/x-authorware-seg', - 'abw' => 'application/x-abiword', - 'ac' => 'application/vnd.nokia.n-gage.ac+xml', - 'ac3' => 'audio/ac3', - 'acc' => 'application/vnd.americandynamics.acc', - 'ace' => 'application/x-ace-compressed', - 'acu' => 'application/vnd.acucobol', - 'acutc' => 'application/vnd.acucorp', - 'adp' => 'audio/adpcm', - 'aep' => 'application/vnd.audiograph', - 'afm' => 'application/x-font-type1', - 'afp' => 'application/vnd.ibm.modcap', - 'age' => 'application/vnd.age', - 'ahead' => 'application/vnd.ahead.space', - 'ai' => 'application/pdf', - 'aif' => 'audio/x-aiff', - 'aifc' => 'audio/x-aiff', - 'aiff' => 'audio/x-aiff', - 'air' => 'application/vnd.adobe.air-application-installer-package+zip', - 'ait' => 'application/vnd.dvb.ait', - 'ami' => 'application/vnd.amiga.ami', - 'amr' => 'audio/amr', - 'apk' => 'application/vnd.android.package-archive', - 'apng' => 'image/apng', - 'appcache' => 'text/cache-manifest', - 'application' => 'application/x-ms-application', - 'apr' => 'application/vnd.lotus-approach', - 'arc' => 'application/x-freearc', - 'arj' => 'application/x-arj', - 'asc' => 'application/pgp-signature', - 'asf' => 'video/x-ms-asf', - 'asm' => 'text/x-asm', - 'aso' => 'application/vnd.accpac.simply.aso', - 'asx' => 'video/x-ms-asf', - 'atc' => 'application/vnd.acucorp', - 'atom' => 'application/atom+xml', - 'atomcat' => 'application/atomcat+xml', - 'atomdeleted' => 'application/atomdeleted+xml', - 'atomsvc' => 'application/atomsvc+xml', - 'atx' => 'application/vnd.antix.game-component', - 'au' => 'audio/x-au', - 'avci' => 'image/avci', - 'avcs' => 'image/avcs', - 'avi' => 'video/x-msvideo', - 'avif' => 'image/avif', - 'aw' => 'application/applixware', - 'azf' => 'application/vnd.airzip.filesecure.azf', - 'azs' => 'application/vnd.airzip.filesecure.azs', - 'azv' => 'image/vnd.airzip.accelerator.azv', - 'azw' => 'application/vnd.amazon.ebook', - 'b16' => 'image/vnd.pco.b16', - 'bat' => 'application/x-msdownload', - 'bcpio' => 'application/x-bcpio', - 'bdf' => 'application/x-font-bdf', - 'bdm' => 'application/vnd.syncml.dm+wbxml', - 'bdoc' => 'application/x-bdoc', - 'bed' => 'application/vnd.realvnc.bed', - 'bh2' => 'application/vnd.fujitsu.oasysprs', - 'bin' => 'application/octet-stream', - 'blb' => 'application/x-blorb', - 'blorb' => 'application/x-blorb', - 'bmi' => 'application/vnd.bmi', - 'bmml' => 'application/vnd.balsamiq.bmml+xml', - 'bmp' => 'image/bmp', - 'book' => 'application/vnd.framemaker', - 'box' => 'application/vnd.previewsystems.box', - 'boz' => 'application/x-bzip2', - 'bpk' => 'application/octet-stream', - 'bpmn' => 'application/octet-stream', - 'bsp' => 'model/vnd.valve.source.compiled-map', - 'btif' => 'image/prs.btif', - 'buffer' => 'application/octet-stream', - 'bz' => 'application/x-bzip', - 'bz2' => 'application/x-bzip2', - 'c' => 'text/x-c', - 'c4d' => 'application/vnd.clonk.c4group', - 'c4f' => 'application/vnd.clonk.c4group', - 'c4g' => 'application/vnd.clonk.c4group', - 'c4p' => 'application/vnd.clonk.c4group', - 'c4u' => 'application/vnd.clonk.c4group', - 'c11amc' => 'application/vnd.cluetrust.cartomobile-config', - 'c11amz' => 'application/vnd.cluetrust.cartomobile-config-pkg', - 'cab' => 'application/vnd.ms-cab-compressed', - 'caf' => 'audio/x-caf', - 'cap' => 'application/vnd.tcpdump.pcap', - 'car' => 'application/vnd.curl.car', - 'cat' => 'application/vnd.ms-pki.seccat', - 'cb7' => 'application/x-cbr', - 'cba' => 'application/x-cbr', - 'cbr' => 'application/x-cbr', - 'cbt' => 'application/x-cbr', - 'cbz' => 'application/x-cbr', - 'cc' => 'text/x-c', - 'cco' => 'application/x-cocoa', - 'cct' => 'application/x-director', - 'ccxml' => 'application/ccxml+xml', - 'cdbcmsg' => 'application/vnd.contact.cmsg', - 'cdf' => 'application/x-netcdf', - 'cdfx' => 'application/cdfx+xml', - 'cdkey' => 'application/vnd.mediastation.cdkey', - 'cdmia' => 'application/cdmi-capability', - 'cdmic' => 'application/cdmi-container', - 'cdmid' => 'application/cdmi-domain', - 'cdmio' => 'application/cdmi-object', - 'cdmiq' => 'application/cdmi-queue', - 'cdr' => 'application/cdr', - 'cdx' => 'chemical/x-cdx', - 'cdxml' => 'application/vnd.chemdraw+xml', - 'cdy' => 'application/vnd.cinderella', - 'cer' => 'application/pkix-cert', - 'cfs' => 'application/x-cfs-compressed', - 'cgm' => 'image/cgm', - 'chat' => 'application/x-chat', - 'chm' => 'application/vnd.ms-htmlhelp', - 'chrt' => 'application/vnd.kde.kchart', - 'cif' => 'chemical/x-cif', - 'cii' => 'application/vnd.anser-web-certificate-issue-initiation', - 'cil' => 'application/vnd.ms-artgalry', - 'cjs' => 'application/node', - 'cla' => 'application/vnd.claymore', - 'class' => 'application/octet-stream', - 'clkk' => 'application/vnd.crick.clicker.keyboard', - 'clkp' => 'application/vnd.crick.clicker.palette', - 'clkt' => 'application/vnd.crick.clicker.template', - 'clkw' => 'application/vnd.crick.clicker.wordbank', - 'clkx' => 'application/vnd.crick.clicker', - 'clp' => 'application/x-msclip', - 'cmc' => 'application/vnd.cosmocaller', - 'cmdf' => 'chemical/x-cmdf', - 'cml' => 'chemical/x-cml', - 'cmp' => 'application/vnd.yellowriver-custom-menu', - 'cmx' => 'image/x-cmx', - 'cod' => 'application/vnd.rim.cod', - 'coffee' => 'text/coffeescript', - 'com' => 'application/x-msdownload', - 'conf' => 'text/plain', - 'cpio' => 'application/x-cpio', - 'cpl' => 'application/cpl+xml', - 'cpp' => 'text/x-c', - 'cpt' => 'application/mac-compactpro', - 'crd' => 'application/x-mscardfile', - 'crl' => 'application/pkix-crl', - 'crt' => 'application/x-x509-ca-cert', - 'crx' => 'application/x-chrome-extension', - 'cryptonote' => 'application/vnd.rig.cryptonote', - 'csh' => 'application/x-csh', - 'csl' => 'application/vnd.citationstyles.style+xml', - 'csml' => 'chemical/x-csml', - 'csp' => 'application/vnd.commonspace', - 'csr' => 'application/octet-stream', - 'css' => 'text/css', - 'cst' => 'application/x-director', - 'csv' => 'text/csv', - 'cu' => 'application/cu-seeme', - 'curl' => 'text/vnd.curl', - 'cww' => 'application/prs.cww', - 'cxt' => 'application/x-director', - 'cxx' => 'text/x-c', - 'dae' => 'model/vnd.collada+xml', - 'daf' => 'application/vnd.mobius.daf', - 'dart' => 'application/vnd.dart', - 'dataless' => 'application/vnd.fdsn.seed', - 'davmount' => 'application/davmount+xml', - 'dbf' => 'application/vnd.dbf', - 'dbk' => 'application/docbook+xml', - 'dcr' => 'application/x-director', - 'dcurl' => 'text/vnd.curl.dcurl', - 'dd2' => 'application/vnd.oma.dd2+xml', - 'ddd' => 'application/vnd.fujixerox.ddd', - 'ddf' => 'application/vnd.syncml.dmddf+xml', - 'dds' => 'image/vnd.ms-dds', - 'deb' => 'application/x-debian-package', - 'def' => 'text/plain', - 'deploy' => 'application/octet-stream', - 'der' => 'application/x-x509-ca-cert', - 'dfac' => 'application/vnd.dreamfactory', - 'dgc' => 'application/x-dgc-compressed', - 'dic' => 'text/x-c', - 'dir' => 'application/x-director', - 'dis' => 'application/vnd.mobius.dis', - 'disposition-notification' => 'message/disposition-notification', - 'dist' => 'application/octet-stream', - 'distz' => 'application/octet-stream', - 'djv' => 'image/vnd.djvu', - 'djvu' => 'image/vnd.djvu', - 'dll' => 'application/octet-stream', - 'dmg' => 'application/x-apple-diskimage', - 'dmn' => 'application/octet-stream', - 'dmp' => 'application/vnd.tcpdump.pcap', - 'dms' => 'application/octet-stream', - 'dna' => 'application/vnd.dna', - 'doc' => 'application/msword', - 'docm' => 'application/vnd.ms-word.template.macroEnabled.12', - 'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', - 'dot' => 'application/msword', - 'dotm' => 'application/vnd.ms-word.template.macroEnabled.12', - 'dotx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.template', - 'dp' => 'application/vnd.osgi.dp', - 'dpg' => 'application/vnd.dpgraph', - 'dra' => 'audio/vnd.dra', - 'drle' => 'image/dicom-rle', - 'dsc' => 'text/prs.lines.tag', - 'dssc' => 'application/dssc+der', - 'dtb' => 'application/x-dtbook+xml', - 'dtd' => 'application/xml-dtd', - 'dts' => 'audio/vnd.dts', - 'dtshd' => 'audio/vnd.dts.hd', - 'dump' => 'application/octet-stream', - 'dvb' => 'video/vnd.dvb.file', - 'dvi' => 'application/x-dvi', - 'dwd' => 'application/atsc-dwd+xml', - 'dwf' => 'model/vnd.dwf', - 'dwg' => 'image/vnd.dwg', - 'dxf' => 'image/vnd.dxf', - 'dxp' => 'application/vnd.spotfire.dxp', - 'dxr' => 'application/x-director', - 'ear' => 'application/java-archive', - 'ecelp4800' => 'audio/vnd.nuera.ecelp4800', - 'ecelp7470' => 'audio/vnd.nuera.ecelp7470', - 'ecelp9600' => 'audio/vnd.nuera.ecelp9600', - 'ecma' => 'application/ecmascript', - 'edm' => 'application/vnd.novadigm.edm', - 'edx' => 'application/vnd.novadigm.edx', - 'efif' => 'application/vnd.picsel', - 'ei6' => 'application/vnd.pg.osasli', - 'elc' => 'application/octet-stream', - 'emf' => 'image/emf', - 'eml' => 'message/rfc822', - 'emma' => 'application/emma+xml', - 'emotionml' => 'application/emotionml+xml', - 'emz' => 'application/x-msmetafile', - 'eol' => 'audio/vnd.digital-winds', - 'eot' => 'application/vnd.ms-fontobject', - 'eps' => 'application/postscript', - 'epub' => 'application/epub+zip', - 'es' => 'application/ecmascript', - 'es3' => 'application/vnd.eszigno3+xml', - 'esa' => 'application/vnd.osgi.subsystem', - 'esf' => 'application/vnd.epson.esf', - 'et3' => 'application/vnd.eszigno3+xml', - 'etx' => 'text/x-setext', - 'eva' => 'application/x-eva', - 'evy' => 'application/x-envoy', - 'exe' => 'application/octet-stream', - 'exi' => 'application/exi', - 'exp' => 'application/express', - 'exr' => 'image/aces', - 'ext' => 'application/vnd.novadigm.ext', - 'ez' => 'application/andrew-inset', - 'ez2' => 'application/vnd.ezpix-album', - 'ez3' => 'application/vnd.ezpix-package', - 'f' => 'text/x-fortran', - 'f4v' => 'video/mp4', - 'f77' => 'text/x-fortran', - 'f90' => 'text/x-fortran', - 'fbs' => 'image/vnd.fastbidsheet', - 'fcdt' => 'application/vnd.adobe.formscentral.fcdt', - 'fcs' => 'application/vnd.isac.fcs', - 'fdf' => 'application/vnd.fdf', - 'fdt' => 'application/fdt+xml', - 'fe_launch' => 'application/vnd.denovo.fcselayout-link', - 'fg5' => 'application/vnd.fujitsu.oasysgp', - 'fgd' => 'application/x-director', - 'fh' => 'image/x-freehand', - 'fh4' => 'image/x-freehand', - 'fh5' => 'image/x-freehand', - 'fh7' => 'image/x-freehand', - 'fhc' => 'image/x-freehand', - 'fig' => 'application/x-xfig', - 'fits' => 'image/fits', - 'flac' => 'audio/x-flac', - 'fli' => 'video/x-fli', - 'flo' => 'application/vnd.micrografx.flo', - 'flv' => 'video/x-flv', - 'flw' => 'application/vnd.kde.kivio', - 'flx' => 'text/vnd.fmi.flexstor', - 'fly' => 'text/vnd.fly', - 'fm' => 'application/vnd.framemaker', - 'fnc' => 'application/vnd.frogans.fnc', - 'fo' => 'application/vnd.software602.filler.form+xml', - 'for' => 'text/x-fortran', - 'fpx' => 'image/vnd.fpx', - 'frame' => 'application/vnd.framemaker', - 'fsc' => 'application/vnd.fsc.weblaunch', - 'fst' => 'image/vnd.fst', - 'ftc' => 'application/vnd.fluxtime.clip', - 'fti' => 'application/vnd.anser-web-funds-transfer-initiation', - 'fvt' => 'video/vnd.fvt', - 'fxp' => 'application/vnd.adobe.fxp', - 'fxpl' => 'application/vnd.adobe.fxp', - 'fzs' => 'application/vnd.fuzzysheet', - 'g2w' => 'application/vnd.geoplan', - 'g3' => 'image/g3fax', - 'g3w' => 'application/vnd.geospace', - 'gac' => 'application/vnd.groove-account', - 'gam' => 'application/x-tads', - 'gbr' => 'application/rpki-ghostbusters', - 'gca' => 'application/x-gca-compressed', - 'gdl' => 'model/vnd.gdl', - 'gdoc' => 'application/vnd.google-apps.document', - 'ged' => 'text/vnd.familysearch.gedcom', - 'geo' => 'application/vnd.dynageo', - 'geojson' => 'application/geo+json', - 'gex' => 'application/vnd.geometry-explorer', - 'ggb' => 'application/vnd.geogebra.file', - 'ggt' => 'application/vnd.geogebra.tool', - 'ghf' => 'application/vnd.groove-help', - 'gif' => 'image/gif', - 'gim' => 'application/vnd.groove-identity-message', - 'glb' => 'model/gltf-binary', - 'gltf' => 'model/gltf+json', - 'gml' => 'application/gml+xml', - 'gmx' => 'application/vnd.gmx', - 'gnumeric' => 'application/x-gnumeric', - 'gpg' => 'application/gpg-keys', - 'gph' => 'application/vnd.flographit', - 'gpx' => 'application/gpx+xml', - 'gqf' => 'application/vnd.grafeq', - 'gqs' => 'application/vnd.grafeq', - 'gram' => 'application/srgs', - 'gramps' => 'application/x-gramps-xml', - 'gre' => 'application/vnd.geometry-explorer', - 'grv' => 'application/vnd.groove-injector', - 'grxml' => 'application/srgs+xml', - 'gsf' => 'application/x-font-ghostscript', - 'gsheet' => 'application/vnd.google-apps.spreadsheet', - 'gslides' => 'application/vnd.google-apps.presentation', - 'gtar' => 'application/x-gtar', - 'gtm' => 'application/vnd.groove-tool-message', - 'gtw' => 'model/vnd.gtw', - 'gv' => 'text/vnd.graphviz', - 'gxf' => 'application/gxf', - 'gxt' => 'application/vnd.geonext', - 'gz' => 'application/gzip', - 'gzip' => 'application/gzip', - 'h' => 'text/x-c', - 'h261' => 'video/h261', - 'h263' => 'video/h263', - 'h264' => 'video/h264', - 'hal' => 'application/vnd.hal+xml', - 'hbci' => 'application/vnd.hbci', - 'hbs' => 'text/x-handlebars-template', - 'hdd' => 'application/x-virtualbox-hdd', - 'hdf' => 'application/x-hdf', - 'heic' => 'image/heic', - 'heics' => 'image/heic-sequence', - 'heif' => 'image/heif', - 'heifs' => 'image/heif-sequence', - 'hej2' => 'image/hej2k', - 'held' => 'application/atsc-held+xml', - 'hh' => 'text/x-c', - 'hjson' => 'application/hjson', - 'hlp' => 'application/winhlp', - 'hpgl' => 'application/vnd.hp-hpgl', - 'hpid' => 'application/vnd.hp-hpid', - 'hps' => 'application/vnd.hp-hps', - 'hqx' => 'application/mac-binhex40', - 'hsj2' => 'image/hsj2', - 'htc' => 'text/x-component', - 'htke' => 'application/vnd.kenameaapp', - 'htm' => 'text/html', - 'html' => 'text/html', - 'hvd' => 'application/vnd.yamaha.hv-dic', - 'hvp' => 'application/vnd.yamaha.hv-voice', - 'hvs' => 'application/vnd.yamaha.hv-script', - 'i2g' => 'application/vnd.intergeo', - 'icc' => 'application/vnd.iccprofile', - 'ice' => 'x-conference/x-cooltalk', - 'icm' => 'application/vnd.iccprofile', - 'ico' => 'image/x-icon', - 'ics' => 'text/calendar', - 'ief' => 'image/ief', - 'ifb' => 'text/calendar', - 'ifm' => 'application/vnd.shana.informed.formdata', - 'iges' => 'model/iges', - 'igl' => 'application/vnd.igloader', - 'igm' => 'application/vnd.insors.igm', - 'igs' => 'model/iges', - 'igx' => 'application/vnd.micrografx.igx', - 'iif' => 'application/vnd.shana.informed.interchange', - 'img' => 'application/octet-stream', - 'imp' => 'application/vnd.accpac.simply.imp', - 'ims' => 'application/vnd.ms-ims', - 'in' => 'text/plain', - 'ini' => 'text/plain', - 'ink' => 'application/inkml+xml', - 'inkml' => 'application/inkml+xml', - 'install' => 'application/x-install-instructions', - 'iota' => 'application/vnd.astraea-software.iota', - 'ipfix' => 'application/ipfix', - 'ipk' => 'application/vnd.shana.informed.package', - 'irm' => 'application/vnd.ibm.rights-management', - 'irp' => 'application/vnd.irepository.package+xml', - 'iso' => 'application/x-iso9660-image', - 'itp' => 'application/vnd.shana.informed.formtemplate', - 'its' => 'application/its+xml', - 'ivp' => 'application/vnd.immervision-ivp', - 'ivu' => 'application/vnd.immervision-ivu', - 'jad' => 'text/vnd.sun.j2me.app-descriptor', - 'jade' => 'text/jade', - 'jam' => 'application/vnd.jam', - 'jar' => 'application/java-archive', - 'jardiff' => 'application/x-java-archive-diff', - 'java' => 'text/x-java-source', - 'jhc' => 'image/jphc', - 'jisp' => 'application/vnd.jisp', - 'jls' => 'image/jls', - 'jlt' => 'application/vnd.hp-jlyt', - 'jng' => 'image/x-jng', - 'jnlp' => 'application/x-java-jnlp-file', - 'joda' => 'application/vnd.joost.joda-archive', - 'jp2' => 'image/jp2', - 'jpe' => 'image/jpeg', - 'jpeg' => 'image/jpeg', - 'jpf' => 'image/jpx', - 'jpg' => 'image/jpeg', - 'jpg2' => 'image/jp2', - 'jpgm' => 'video/jpm', - 'jpgv' => 'video/jpeg', - 'jph' => 'image/jph', - 'jpm' => 'video/jpm', - 'jpx' => 'image/jpx', - 'js' => 'application/javascript', - 'json' => 'application/json', - 'json5' => 'application/json5', - 'jsonld' => 'application/ld+json', - 'jsonml' => 'application/jsonml+json', - 'jsx' => 'text/jsx', - 'jxr' => 'image/jxr', - 'jxra' => 'image/jxra', - 'jxrs' => 'image/jxrs', - 'jxs' => 'image/jxs', - 'jxsc' => 'image/jxsc', - 'jxsi' => 'image/jxsi', - 'jxss' => 'image/jxss', - 'kar' => 'audio/midi', - 'karbon' => 'application/vnd.kde.karbon', - 'kdb' => 'application/octet-stream', - 'kdbx' => 'application/x-keepass2', - 'key' => 'application/x-iwork-keynote-sffkey', - 'kfo' => 'application/vnd.kde.kformula', - 'kia' => 'application/vnd.kidspiration', - 'kml' => 'application/vnd.google-earth.kml+xml', - 'kmz' => 'application/vnd.google-earth.kmz', - 'kne' => 'application/vnd.kinar', - 'knp' => 'application/vnd.kinar', - 'kon' => 'application/vnd.kde.kontour', - 'kpr' => 'application/vnd.kde.kpresenter', - 'kpt' => 'application/vnd.kde.kpresenter', - 'kpxx' => 'application/vnd.ds-keypoint', - 'ksp' => 'application/vnd.kde.kspread', - 'ktr' => 'application/vnd.kahootz', - 'ktx' => 'image/ktx', - 'ktx2' => 'image/ktx2', - 'ktz' => 'application/vnd.kahootz', - 'kwd' => 'application/vnd.kde.kword', - 'kwt' => 'application/vnd.kde.kword', - 'lasxml' => 'application/vnd.las.las+xml', - 'latex' => 'application/x-latex', - 'lbd' => 'application/vnd.llamagraphics.life-balance.desktop', - 'lbe' => 'application/vnd.llamagraphics.life-balance.exchange+xml', - 'les' => 'application/vnd.hhe.lesson-player', - 'less' => 'text/less', - 'lgr' => 'application/lgr+xml', - 'lha' => 'application/octet-stream', - 'link66' => 'application/vnd.route66.link66+xml', - 'list' => 'text/plain', - 'list3820' => 'application/vnd.ibm.modcap', - 'listafp' => 'application/vnd.ibm.modcap', - 'litcoffee' => 'text/coffeescript', - 'lnk' => 'application/x-ms-shortcut', - 'log' => 'text/plain', - 'lostxml' => 'application/lost+xml', - 'lrf' => 'application/octet-stream', - 'lrm' => 'application/vnd.ms-lrm', - 'ltf' => 'application/vnd.frogans.ltf', - 'lua' => 'text/x-lua', - 'luac' => 'application/x-lua-bytecode', - 'lvp' => 'audio/vnd.lucent.voice', - 'lwp' => 'application/vnd.lotus-wordpro', - 'lzh' => 'application/octet-stream', - 'm1v' => 'video/mpeg', - 'm2a' => 'audio/mpeg', - 'm2v' => 'video/mpeg', - 'm3a' => 'audio/mpeg', - 'm3u' => 'text/plain', - 'm3u8' => 'application/vnd.apple.mpegurl', - 'm4a' => 'audio/x-m4a', - 'm4p' => 'application/mp4', - 'm4s' => 'video/iso.segment', - 'm4u' => 'application/vnd.mpegurl', - 'm4v' => 'video/x-m4v', - 'm13' => 'application/x-msmediaview', - 'm14' => 'application/x-msmediaview', - 'm21' => 'application/mp21', - 'ma' => 'application/mathematica', - 'mads' => 'application/mads+xml', - 'maei' => 'application/mmt-aei+xml', - 'mag' => 'application/vnd.ecowin.chart', - 'maker' => 'application/vnd.framemaker', - 'man' => 'text/troff', - 'manifest' => 'text/cache-manifest', - 'map' => 'application/json', - 'mar' => 'application/octet-stream', - 'markdown' => 'text/markdown', - 'mathml' => 'application/mathml+xml', - 'mb' => 'application/mathematica', - 'mbk' => 'application/vnd.mobius.mbk', - 'mbox' => 'application/mbox', - 'mc1' => 'application/vnd.medcalcdata', - 'mcd' => 'application/vnd.mcd', - 'mcurl' => 'text/vnd.curl.mcurl', - 'md' => 'text/markdown', - 'mdb' => 'application/x-msaccess', - 'mdi' => 'image/vnd.ms-modi', - 'mdx' => 'text/mdx', - 'me' => 'text/troff', - 'mesh' => 'model/mesh', - 'meta4' => 'application/metalink4+xml', - 'metalink' => 'application/metalink+xml', - 'mets' => 'application/mets+xml', - 'mfm' => 'application/vnd.mfmp', - 'mft' => 'application/rpki-manifest', - 'mgp' => 'application/vnd.osgeo.mapguide.package', - 'mgz' => 'application/vnd.proteus.magazine', - 'mid' => 'audio/midi', - 'midi' => 'audio/midi', - 'mie' => 'application/x-mie', - 'mif' => 'application/vnd.mif', - 'mime' => 'message/rfc822', - 'mj2' => 'video/mj2', - 'mjp2' => 'video/mj2', - 'mjs' => 'application/javascript', - 'mk3d' => 'video/x-matroska', - 'mka' => 'audio/x-matroska', - 'mkd' => 'text/x-markdown', - 'mks' => 'video/x-matroska', - 'mkv' => 'video/x-matroska', - 'mlp' => 'application/vnd.dolby.mlp', - 'mmd' => 'application/vnd.chipnuts.karaoke-mmd', - 'mmf' => 'application/vnd.smaf', - 'mml' => 'text/mathml', - 'mmr' => 'image/vnd.fujixerox.edmics-mmr', - 'mng' => 'video/x-mng', - 'mny' => 'application/x-msmoney', - 'mobi' => 'application/x-mobipocket-ebook', - 'mods' => 'application/mods+xml', - 'mov' => 'video/quicktime', - 'movie' => 'video/x-sgi-movie', - 'mp2' => 'audio/mpeg', - 'mp2a' => 'audio/mpeg', - 'mp3' => 'audio/mpeg', - 'mp4' => 'video/mp4', - 'mp4a' => 'audio/mp4', - 'mp4s' => 'application/mp4', - 'mp4v' => 'video/mp4', - 'mp21' => 'application/mp21', - 'mpc' => 'application/vnd.mophun.certificate', - 'mpd' => 'application/dash+xml', - 'mpe' => 'video/mpeg', - 'mpeg' => 'video/mpeg', - 'mpf' => 'application/media-policy-dataset+xml', - 'mpg' => 'video/mpeg', - 'mpg4' => 'video/mp4', - 'mpga' => 'audio/mpeg', - 'mpkg' => 'application/vnd.apple.installer+xml', - 'mpm' => 'application/vnd.blueice.multipass', - 'mpn' => 'application/vnd.mophun.application', - 'mpp' => 'application/vnd.ms-project', - 'mpt' => 'application/vnd.ms-project', - 'mpy' => 'application/vnd.ibm.minipay', - 'mqy' => 'application/vnd.mobius.mqy', - 'mrc' => 'application/marc', - 'mrcx' => 'application/marcxml+xml', - 'ms' => 'text/troff', - 'mscml' => 'application/mediaservercontrol+xml', - 'mseed' => 'application/vnd.fdsn.mseed', - 'mseq' => 'application/vnd.mseq', - 'msf' => 'application/vnd.epson.msf', - 'msg' => 'application/vnd.ms-outlook', - 'msh' => 'model/mesh', - 'msi' => 'application/x-msdownload', - 'msl' => 'application/vnd.mobius.msl', - 'msm' => 'application/octet-stream', - 'msp' => 'application/octet-stream', - 'msty' => 'application/vnd.muvee.style', - 'mtl' => 'model/mtl', - 'mts' => 'model/vnd.mts', - 'mus' => 'application/vnd.musician', - 'musd' => 'application/mmt-usd+xml', - 'musicxml' => 'application/vnd.recordare.musicxml+xml', - 'mvb' => 'application/x-msmediaview', - 'mvt' => 'application/vnd.mapbox-vector-tile', - 'mwf' => 'application/vnd.mfer', - 'mxf' => 'application/mxf', - 'mxl' => 'application/vnd.recordare.musicxml', - 'mxmf' => 'audio/mobile-xmf', - 'mxml' => 'application/xv+xml', - 'mxs' => 'application/vnd.triscape.mxs', - 'mxu' => 'video/vnd.mpegurl', - 'n-gage' => 'application/vnd.nokia.n-gage.symbian.install', - 'n3' => 'text/n3', - 'nb' => 'application/mathematica', - 'nbp' => 'application/vnd.wolfram.player', - 'nc' => 'application/x-netcdf', - 'ncx' => 'application/x-dtbncx+xml', - 'nfo' => 'text/x-nfo', - 'ngdat' => 'application/vnd.nokia.n-gage.data', - 'nitf' => 'application/vnd.nitf', - 'nlu' => 'application/vnd.neurolanguage.nlu', - 'nml' => 'application/vnd.enliven', - 'nnd' => 'application/vnd.noblenet-directory', - 'nns' => 'application/vnd.noblenet-sealer', - 'nnw' => 'application/vnd.noblenet-web', - 'npx' => 'image/vnd.net-fpx', - 'nq' => 'application/n-quads', - 'nsc' => 'application/x-conference', - 'nsf' => 'application/vnd.lotus-notes', - 'nt' => 'application/n-triples', - 'ntf' => 'application/vnd.nitf', - 'numbers' => 'application/x-iwork-numbers-sffnumbers', - 'nzb' => 'application/x-nzb', - 'oa2' => 'application/vnd.fujitsu.oasys2', - 'oa3' => 'application/vnd.fujitsu.oasys3', - 'oas' => 'application/vnd.fujitsu.oasys', - 'obd' => 'application/x-msbinder', - 'obgx' => 'application/vnd.openblox.game+xml', - 'obj' => 'model/obj', - 'oda' => 'application/oda', - 'odb' => 'application/vnd.oasis.opendocument.database', - 'odc' => 'application/vnd.oasis.opendocument.chart', - 'odf' => 'application/vnd.oasis.opendocument.formula', - 'odft' => 'application/vnd.oasis.opendocument.formula-template', - 'odg' => 'application/vnd.oasis.opendocument.graphics', - 'odi' => 'application/vnd.oasis.opendocument.image', - 'odm' => 'application/vnd.oasis.opendocument.text-master', - 'odp' => 'application/vnd.oasis.opendocument.presentation', - 'ods' => 'application/vnd.oasis.opendocument.spreadsheet', - 'odt' => 'application/vnd.oasis.opendocument.text', - 'oga' => 'audio/ogg', - 'ogex' => 'model/vnd.opengex', - 'ogg' => 'audio/ogg', - 'ogv' => 'video/ogg', - 'ogx' => 'application/ogg', - 'omdoc' => 'application/omdoc+xml', - 'onepkg' => 'application/onenote', - 'onetmp' => 'application/onenote', - 'onetoc' => 'application/onenote', - 'onetoc2' => 'application/onenote', - 'opf' => 'application/oebps-package+xml', - 'opml' => 'text/x-opml', - 'oprc' => 'application/vnd.palm', - 'opus' => 'audio/ogg', - 'org' => 'text/x-org', - 'osf' => 'application/vnd.yamaha.openscoreformat', - 'osfpvg' => 'application/vnd.yamaha.openscoreformat.osfpvg+xml', - 'osm' => 'application/vnd.openstreetmap.data+xml', - 'otc' => 'application/vnd.oasis.opendocument.chart-template', - 'otf' => 'font/otf', - 'otg' => 'application/vnd.oasis.opendocument.graphics-template', - 'oth' => 'application/vnd.oasis.opendocument.text-web', - 'oti' => 'application/vnd.oasis.opendocument.image-template', - 'otp' => 'application/vnd.oasis.opendocument.presentation-template', - 'ots' => 'application/vnd.oasis.opendocument.spreadsheet-template', - 'ott' => 'application/vnd.oasis.opendocument.text-template', - 'ova' => 'application/x-virtualbox-ova', - 'ovf' => 'application/x-virtualbox-ovf', - 'owl' => 'application/rdf+xml', - 'oxps' => 'application/oxps', - 'oxt' => 'application/vnd.openofficeorg.extension', - 'p' => 'text/x-pascal', - 'p7a' => 'application/x-pkcs7-signature', - 'p7b' => 'application/x-pkcs7-certificates', - 'p7c' => 'application/pkcs7-mime', - 'p7m' => 'application/pkcs7-mime', - 'p7r' => 'application/x-pkcs7-certreqresp', - 'p7s' => 'application/pkcs7-signature', - 'p8' => 'application/pkcs8', - 'p10' => 'application/x-pkcs10', - 'p12' => 'application/x-pkcs12', - 'pac' => 'application/x-ns-proxy-autoconfig', - 'pages' => 'application/x-iwork-pages-sffpages', - 'pas' => 'text/x-pascal', - 'paw' => 'application/vnd.pawaafile', - 'pbd' => 'application/vnd.powerbuilder6', - 'pbm' => 'image/x-portable-bitmap', - 'pcap' => 'application/vnd.tcpdump.pcap', - 'pcf' => 'application/x-font-pcf', - 'pcl' => 'application/vnd.hp-pcl', - 'pclxl' => 'application/vnd.hp-pclxl', - 'pct' => 'image/x-pict', - 'pcurl' => 'application/vnd.curl.pcurl', - 'pcx' => 'image/x-pcx', - 'pdb' => 'application/x-pilot', - 'pde' => 'text/x-processing', - 'pdf' => 'application/pdf', - 'pem' => 'application/x-x509-user-cert', - 'pfa' => 'application/x-font-type1', - 'pfb' => 'application/x-font-type1', - 'pfm' => 'application/x-font-type1', - 'pfr' => 'application/font-tdpfr', - 'pfx' => 'application/x-pkcs12', - 'pgm' => 'image/x-portable-graymap', - 'pgn' => 'application/x-chess-pgn', - 'pgp' => 'application/pgp', - 'phar' => 'application/octet-stream', - 'php' => 'application/x-httpd-php', - 'php3' => 'application/x-httpd-php', - 'php4' => 'application/x-httpd-php', - 'phps' => 'application/x-httpd-php-source', - 'phtml' => 'application/x-httpd-php', - 'pic' => 'image/x-pict', - 'pkg' => 'application/octet-stream', - 'pki' => 'application/pkixcmp', - 'pkipath' => 'application/pkix-pkipath', - 'pkpass' => 'application/vnd.apple.pkpass', - 'pl' => 'application/x-perl', - 'plb' => 'application/vnd.3gpp.pic-bw-large', - 'plc' => 'application/vnd.mobius.plc', - 'plf' => 'application/vnd.pocketlearn', - 'pls' => 'application/pls+xml', - 'pm' => 'application/x-perl', - 'pml' => 'application/vnd.ctc-posml', - 'png' => 'image/png', - 'pnm' => 'image/x-portable-anymap', - 'portpkg' => 'application/vnd.macports.portpkg', - 'pot' => 'application/vnd.ms-powerpoint', - 'potm' => 'application/vnd.ms-powerpoint.presentation.macroEnabled.12', - 'potx' => 'application/vnd.openxmlformats-officedocument.presentationml.template', - 'ppa' => 'application/vnd.ms-powerpoint', - 'ppam' => 'application/vnd.ms-powerpoint.addin.macroEnabled.12', - 'ppd' => 'application/vnd.cups-ppd', - 'ppm' => 'image/x-portable-pixmap', - 'pps' => 'application/vnd.ms-powerpoint', - 'ppsm' => 'application/vnd.ms-powerpoint.slideshow.macroEnabled.12', - 'ppsx' => 'application/vnd.openxmlformats-officedocument.presentationml.slideshow', - 'ppt' => 'application/powerpoint', - 'pptm' => 'application/vnd.ms-powerpoint.presentation.macroEnabled.12', - 'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation', - 'pqa' => 'application/vnd.palm', - 'prc' => 'model/prc', - 'pre' => 'application/vnd.lotus-freelance', - 'prf' => 'application/pics-rules', - 'provx' => 'application/provenance+xml', - 'ps' => 'application/postscript', - 'psb' => 'application/vnd.3gpp.pic-bw-small', - 'psd' => 'application/x-photoshop', - 'psf' => 'application/x-font-linux-psf', - 'pskcxml' => 'application/pskc+xml', - 'pti' => 'image/prs.pti', - 'ptid' => 'application/vnd.pvi.ptid1', - 'pub' => 'application/x-mspublisher', - 'pvb' => 'application/vnd.3gpp.pic-bw-var', - 'pwn' => 'application/vnd.3m.post-it-notes', - 'pya' => 'audio/vnd.ms-playready.media.pya', - 'pyv' => 'video/vnd.ms-playready.media.pyv', - 'qam' => 'application/vnd.epson.quickanime', - 'qbo' => 'application/vnd.intu.qbo', - 'qfx' => 'application/vnd.intu.qfx', - 'qps' => 'application/vnd.publishare-delta-tree', - 'qt' => 'video/quicktime', - 'qwd' => 'application/vnd.quark.quarkxpress', - 'qwt' => 'application/vnd.quark.quarkxpress', - 'qxb' => 'application/vnd.quark.quarkxpress', - 'qxd' => 'application/vnd.quark.quarkxpress', - 'qxl' => 'application/vnd.quark.quarkxpress', - 'qxt' => 'application/vnd.quark.quarkxpress', - 'ra' => 'audio/x-realaudio', - 'ram' => 'audio/x-pn-realaudio', - 'raml' => 'application/raml+yaml', - 'rapd' => 'application/route-apd+xml', - 'rar' => 'application/x-rar', - 'ras' => 'image/x-cmu-raster', - 'rcprofile' => 'application/vnd.ipunplugged.rcprofile', - 'rdf' => 'application/rdf+xml', - 'rdz' => 'application/vnd.data-vision.rdz', - 'relo' => 'application/p2p-overlay+xml', - 'rep' => 'application/vnd.businessobjects', - 'res' => 'application/x-dtbresource+xml', - 'rgb' => 'image/x-rgb', - 'rif' => 'application/reginfo+xml', - 'rip' => 'audio/vnd.rip', - 'ris' => 'application/x-research-info-systems', - 'rl' => 'application/resource-lists+xml', - 'rlc' => 'image/vnd.fujixerox.edmics-rlc', - 'rld' => 'application/resource-lists-diff+xml', - 'rm' => 'audio/x-pn-realaudio', - 'rmi' => 'audio/midi', - 'rmp' => 'audio/x-pn-realaudio-plugin', - 'rms' => 'application/vnd.jcp.javame.midlet-rms', - 'rmvb' => 'application/vnd.rn-realmedia-vbr', - 'rnc' => 'application/relax-ng-compact-syntax', - 'rng' => 'application/xml', - 'roa' => 'application/rpki-roa', - 'roff' => 'text/troff', - 'rp9' => 'application/vnd.cloanto.rp9', - 'rpm' => 'audio/x-pn-realaudio-plugin', - 'rpss' => 'application/vnd.nokia.radio-presets', - 'rpst' => 'application/vnd.nokia.radio-preset', - 'rq' => 'application/sparql-query', - 'rs' => 'application/rls-services+xml', - 'rsa' => 'application/x-pkcs7', - 'rsat' => 'application/atsc-rsat+xml', - 'rsd' => 'application/rsd+xml', - 'rsheet' => 'application/urc-ressheet+xml', - 'rss' => 'application/rss+xml', - 'rtf' => 'text/rtf', - 'rtx' => 'text/richtext', - 'run' => 'application/x-makeself', - 'rusd' => 'application/route-usd+xml', - 'rv' => 'video/vnd.rn-realvideo', - 's' => 'text/x-asm', - 's3m' => 'audio/s3m', - 'saf' => 'application/vnd.yamaha.smaf-audio', - 'sass' => 'text/x-sass', - 'sbml' => 'application/sbml+xml', - 'sc' => 'application/vnd.ibm.secure-container', - 'scd' => 'application/x-msschedule', - 'scm' => 'application/vnd.lotus-screencam', - 'scq' => 'application/scvp-cv-request', - 'scs' => 'application/scvp-cv-response', - 'scss' => 'text/x-scss', - 'scurl' => 'text/vnd.curl.scurl', - 'sda' => 'application/vnd.stardivision.draw', - 'sdc' => 'application/vnd.stardivision.calc', - 'sdd' => 'application/vnd.stardivision.impress', - 'sdkd' => 'application/vnd.solent.sdkm+xml', - 'sdkm' => 'application/vnd.solent.sdkm+xml', - 'sdp' => 'application/sdp', - 'sdw' => 'application/vnd.stardivision.writer', - 'sea' => 'application/octet-stream', - 'see' => 'application/vnd.seemail', - 'seed' => 'application/vnd.fdsn.seed', - 'sema' => 'application/vnd.sema', - 'semd' => 'application/vnd.semd', - 'semf' => 'application/vnd.semf', - 'senmlx' => 'application/senml+xml', - 'sensmlx' => 'application/sensml+xml', - 'ser' => 'application/java-serialized-object', - 'setpay' => 'application/set-payment-initiation', - 'setreg' => 'application/set-registration-initiation', - 'sfd-hdstx' => 'application/vnd.hydrostatix.sof-data', - 'sfs' => 'application/vnd.spotfire.sfs', - 'sfv' => 'text/x-sfv', - 'sgi' => 'image/sgi', - 'sgl' => 'application/vnd.stardivision.writer-global', - 'sgm' => 'text/sgml', - 'sgml' => 'text/sgml', - 'sh' => 'application/x-sh', - 'shar' => 'application/x-shar', - 'shex' => 'text/shex', - 'shf' => 'application/shf+xml', - 'shtml' => 'text/html', - 'sid' => 'image/x-mrsid-image', - 'sieve' => 'application/sieve', - 'sig' => 'application/pgp-signature', - 'sil' => 'audio/silk', - 'silo' => 'model/mesh', - 'sis' => 'application/vnd.symbian.install', - 'sisx' => 'application/vnd.symbian.install', - 'sit' => 'application/x-stuffit', - 'sitx' => 'application/x-stuffitx', - 'siv' => 'application/sieve', - 'skd' => 'application/vnd.koan', - 'skm' => 'application/vnd.koan', - 'skp' => 'application/vnd.koan', - 'skt' => 'application/vnd.koan', - 'sldm' => 'application/vnd.ms-powerpoint.slide.macroenabled.12', - 'sldx' => 'application/vnd.openxmlformats-officedocument.presentationml.slide', - 'slim' => 'text/slim', - 'slm' => 'text/slim', - 'sls' => 'application/route-s-tsid+xml', - 'slt' => 'application/vnd.epson.salt', - 'sm' => 'application/vnd.stepmania.stepchart', - 'smf' => 'application/vnd.stardivision.math', - 'smi' => 'application/smil', - 'smil' => 'application/smil', - 'smv' => 'video/x-smv', - 'smzip' => 'application/vnd.stepmania.package', - 'snd' => 'audio/basic', - 'snf' => 'application/x-font-snf', - 'so' => 'application/octet-stream', - 'spc' => 'application/x-pkcs7-certificates', - 'spdx' => 'text/spdx', - 'spf' => 'application/vnd.yamaha.smaf-phrase', - 'spl' => 'application/x-futuresplash', - 'spot' => 'text/vnd.in3d.spot', - 'spp' => 'application/scvp-vp-response', - 'spq' => 'application/scvp-vp-request', - 'spx' => 'audio/ogg', - 'sql' => 'application/x-sql', - 'src' => 'application/x-wais-source', - 'srt' => 'application/x-subrip', - 'sru' => 'application/sru+xml', - 'srx' => 'application/sparql-results+xml', - 'ssdl' => 'application/ssdl+xml', - 'sse' => 'application/vnd.kodak-descriptor', - 'ssf' => 'application/vnd.epson.ssf', - 'ssml' => 'application/ssml+xml', - 'sst' => 'application/octet-stream', - 'st' => 'application/vnd.sailingtracker.track', - 'stc' => 'application/vnd.sun.xml.calc.template', - 'std' => 'application/vnd.sun.xml.draw.template', - 'stf' => 'application/vnd.wt.stf', - 'sti' => 'application/vnd.sun.xml.impress.template', - 'stk' => 'application/hyperstudio', - 'stl' => 'model/stl', - 'stpx' => 'model/step+xml', - 'stpxz' => 'model/step-xml+zip', - 'stpz' => 'model/step+zip', - 'str' => 'application/vnd.pg.format', - 'stw' => 'application/vnd.sun.xml.writer.template', - 'styl' => 'text/stylus', - 'stylus' => 'text/stylus', - 'sub' => 'text/vnd.dvb.subtitle', - 'sus' => 'application/vnd.sus-calendar', - 'susp' => 'application/vnd.sus-calendar', - 'sv4cpio' => 'application/x-sv4cpio', - 'sv4crc' => 'application/x-sv4crc', - 'svc' => 'application/vnd.dvb.service', - 'svd' => 'application/vnd.svd', - 'svg' => 'image/svg+xml', - 'svgz' => 'image/svg+xml', - 'swa' => 'application/x-director', - 'swf' => 'application/x-shockwave-flash', - 'swi' => 'application/vnd.aristanetworks.swi', - 'swidtag' => 'application/swid+xml', - 'sxc' => 'application/vnd.sun.xml.calc', - 'sxd' => 'application/vnd.sun.xml.draw', - 'sxg' => 'application/vnd.sun.xml.writer.global', - 'sxi' => 'application/vnd.sun.xml.impress', - 'sxm' => 'application/vnd.sun.xml.math', - 'sxw' => 'application/vnd.sun.xml.writer', - 't' => 'text/troff', - 't3' => 'application/x-t3vm-image', - 't38' => 'image/t38', - 'taglet' => 'application/vnd.mynfc', - 'tao' => 'application/vnd.tao.intent-module-archive', - 'tap' => 'image/vnd.tencent.tap', - 'tar' => 'application/x-tar', - 'tcap' => 'application/vnd.3gpp2.tcap', - 'tcl' => 'application/x-tcl', - 'td' => 'application/urc-targetdesc+xml', - 'teacher' => 'application/vnd.smart.teacher', - 'tei' => 'application/tei+xml', - 'teicorpus' => 'application/tei+xml', - 'tex' => 'application/x-tex', - 'texi' => 'application/x-texinfo', - 'texinfo' => 'application/x-texinfo', - 'text' => 'text/plain', - 'tfi' => 'application/thraud+xml', - 'tfm' => 'application/x-tex-tfm', - 'tfx' => 'image/tiff-fx', - 'tga' => 'image/x-tga', - 'tgz' => 'application/x-tar', - 'thmx' => 'application/vnd.ms-officetheme', - 'tif' => 'image/tiff', - 'tiff' => 'image/tiff', - 'tk' => 'application/x-tcl', - 'tmo' => 'application/vnd.tmobile-livetv', - 'toml' => 'application/toml', - 'torrent' => 'application/x-bittorrent', - 'tpl' => 'application/vnd.groove-tool-template', - 'tpt' => 'application/vnd.trid.tpt', - 'tr' => 'text/troff', - 'tra' => 'application/vnd.trueapp', - 'trig' => 'application/trig', - 'trm' => 'application/x-msterminal', - 'ts' => 'video/mp2t', - 'tsd' => 'application/timestamped-data', - 'tsv' => 'text/tab-separated-values', - 'ttc' => 'font/collection', - 'ttf' => 'font/ttf', - 'ttl' => 'text/turtle', - 'ttml' => 'application/ttml+xml', - 'twd' => 'application/vnd.simtech-mindmapper', - 'twds' => 'application/vnd.simtech-mindmapper', - 'txd' => 'application/vnd.genomatix.tuxedo', - 'txf' => 'application/vnd.mobius.txf', - 'txt' => 'text/plain', - 'u3d' => 'model/u3d', - 'u8dsn' => 'message/global-delivery-status', - 'u8hdr' => 'message/global-headers', - 'u8mdn' => 'message/global-disposition-notification', - 'u8msg' => 'message/global', - 'u32' => 'application/x-authorware-bin', - 'ubj' => 'application/ubjson', - 'udeb' => 'application/x-debian-package', - 'ufd' => 'application/vnd.ufdl', - 'ufdl' => 'application/vnd.ufdl', - 'ulx' => 'application/x-glulx', - 'umj' => 'application/vnd.umajin', - 'unityweb' => 'application/vnd.unity', - 'uoml' => 'application/vnd.uoml+xml', - 'uri' => 'text/uri-list', - 'uris' => 'text/uri-list', - 'urls' => 'text/uri-list', - 'usdz' => 'model/vnd.usdz+zip', - 'ustar' => 'application/x-ustar', - 'utz' => 'application/vnd.uiq.theme', - 'uu' => 'text/x-uuencode', - 'uva' => 'audio/vnd.dece.audio', - 'uvd' => 'application/vnd.dece.data', - 'uvf' => 'application/vnd.dece.data', - 'uvg' => 'image/vnd.dece.graphic', - 'uvh' => 'video/vnd.dece.hd', - 'uvi' => 'image/vnd.dece.graphic', - 'uvm' => 'video/vnd.dece.mobile', - 'uvp' => 'video/vnd.dece.pd', - 'uvs' => 'video/vnd.dece.sd', - 'uvt' => 'application/vnd.dece.ttml+xml', - 'uvu' => 'video/vnd.uvvu.mp4', - 'uvv' => 'video/vnd.dece.video', - 'uvva' => 'audio/vnd.dece.audio', - 'uvvd' => 'application/vnd.dece.data', - 'uvvf' => 'application/vnd.dece.data', - 'uvvg' => 'image/vnd.dece.graphic', - 'uvvh' => 'video/vnd.dece.hd', - 'uvvi' => 'image/vnd.dece.graphic', - 'uvvm' => 'video/vnd.dece.mobile', - 'uvvp' => 'video/vnd.dece.pd', - 'uvvs' => 'video/vnd.dece.sd', - 'uvvt' => 'application/vnd.dece.ttml+xml', - 'uvvu' => 'video/vnd.uvvu.mp4', - 'uvvv' => 'video/vnd.dece.video', - 'uvvx' => 'application/vnd.dece.unspecified', - 'uvvz' => 'application/vnd.dece.zip', - 'uvx' => 'application/vnd.dece.unspecified', - 'uvz' => 'application/vnd.dece.zip', - 'vbox' => 'application/x-virtualbox-vbox', - 'vbox-extpack' => 'application/x-virtualbox-vbox-extpack', - 'vcard' => 'text/vcard', - 'vcd' => 'application/x-cdlink', - 'vcf' => 'text/x-vcard', - 'vcg' => 'application/vnd.groove-vcard', - 'vcs' => 'text/x-vcalendar', - 'vcx' => 'application/vnd.vcx', - 'vdi' => 'application/x-virtualbox-vdi', - 'vds' => 'model/vnd.sap.vds', - 'vhd' => 'application/x-virtualbox-vhd', - 'vis' => 'application/vnd.visionary', - 'viv' => 'video/vnd.vivo', - 'vlc' => 'application/videolan', - 'vmdk' => 'application/x-virtualbox-vmdk', - 'vob' => 'video/x-ms-vob', - 'vor' => 'application/vnd.stardivision.writer', - 'vox' => 'application/x-authorware-bin', - 'vrml' => 'model/vrml', - 'vsd' => 'application/vnd.visio', - 'vsf' => 'application/vnd.vsf', - 'vss' => 'application/vnd.visio', - 'vst' => 'application/vnd.visio', - 'vsw' => 'application/vnd.visio', - 'vtf' => 'image/vnd.valve.source.texture', - 'vtt' => 'text/vtt', - 'vtu' => 'model/vnd.vtu', - 'vxml' => 'application/voicexml+xml', - 'w3d' => 'application/x-director', - 'wad' => 'application/x-doom', - 'wadl' => 'application/vnd.sun.wadl+xml', - 'war' => 'application/java-archive', - 'wasm' => 'application/wasm', - 'wav' => 'audio/x-wav', - 'wax' => 'audio/x-ms-wax', - 'wbmp' => 'image/vnd.wap.wbmp', - 'wbs' => 'application/vnd.criticaltools.wbs+xml', - 'wbxml' => 'application/wbxml', - 'wcm' => 'application/vnd.ms-works', - 'wdb' => 'application/vnd.ms-works', - 'wdp' => 'image/vnd.ms-photo', - 'weba' => 'audio/webm', - 'webapp' => 'application/x-web-app-manifest+json', - 'webm' => 'video/webm', - 'webmanifest' => 'application/manifest+json', - 'webp' => 'image/webp', - 'wg' => 'application/vnd.pmi.widget', - 'wgt' => 'application/widget', - 'wif' => 'application/watcherinfo+xml', - 'wks' => 'application/vnd.ms-works', - 'wm' => 'video/x-ms-wm', - 'wma' => 'audio/x-ms-wma', - 'wmd' => 'application/x-ms-wmd', - 'wmf' => 'image/wmf', - 'wml' => 'text/vnd.wap.wml', - 'wmlc' => 'application/wmlc', - 'wmls' => 'text/vnd.wap.wmlscript', - 'wmlsc' => 'application/vnd.wap.wmlscriptc', - 'wmv' => 'video/x-ms-wmv', - 'wmx' => 'video/x-ms-wmx', - 'wmz' => 'application/x-msmetafile', - 'woff' => 'font/woff', - 'woff2' => 'font/woff2', - 'word' => 'application/msword', - 'wpd' => 'application/vnd.wordperfect', - 'wpl' => 'application/vnd.ms-wpl', - 'wps' => 'application/vnd.ms-works', - 'wqd' => 'application/vnd.wqd', - 'wri' => 'application/x-mswrite', - 'wrl' => 'model/vrml', - 'wsc' => 'message/vnd.wfa.wsc', - 'wsdl' => 'application/wsdl+xml', - 'wspolicy' => 'application/wspolicy+xml', - 'wtb' => 'application/vnd.webturbo', - 'wvx' => 'video/x-ms-wvx', - 'x3d' => 'model/x3d+xml', - 'x3db' => 'model/x3d+fastinfoset', - 'x3dbz' => 'model/x3d+binary', - 'x3dv' => 'model/x3d-vrml', - 'x3dvz' => 'model/x3d+vrml', - 'x3dz' => 'model/x3d+xml', - 'x32' => 'application/x-authorware-bin', - 'x_b' => 'model/vnd.parasolid.transmit.binary', - 'x_t' => 'model/vnd.parasolid.transmit.text', - 'xaml' => 'application/xaml+xml', - 'xap' => 'application/x-silverlight-app', - 'xar' => 'application/vnd.xara', - 'xav' => 'application/xcap-att+xml', - 'xbap' => 'application/x-ms-xbap', - 'xbd' => 'application/vnd.fujixerox.docuworks.binder', - 'xbm' => 'image/x-xbitmap', - 'xca' => 'application/xcap-caps+xml', - 'xcs' => 'application/calendar+xml', - 'xdf' => 'application/xcap-diff+xml', - 'xdm' => 'application/vnd.syncml.dm+xml', - 'xdp' => 'application/vnd.adobe.xdp+xml', - 'xdssc' => 'application/dssc+xml', - 'xdw' => 'application/vnd.fujixerox.docuworks', - 'xel' => 'application/xcap-el+xml', - 'xenc' => 'application/xenc+xml', - 'xer' => 'application/patch-ops-error+xml', - 'xfdf' => 'application/vnd.adobe.xfdf', - 'xfdl' => 'application/vnd.xfdl', - 'xht' => 'application/xhtml+xml', - 'xhtml' => 'application/xhtml+xml', - 'xhvml' => 'application/xv+xml', - 'xif' => 'image/vnd.xiff', - 'xl' => 'application/excel', - 'xla' => 'application/vnd.ms-excel', - 'xlam' => 'application/vnd.ms-excel.addin.macroEnabled.12', - 'xlc' => 'application/vnd.ms-excel', - 'xlf' => 'application/xliff+xml', - 'xlm' => 'application/vnd.ms-excel', - 'xls' => 'application/vnd.ms-excel', - 'xlsb' => 'application/vnd.ms-excel.sheet.binary.macroEnabled.12', - 'xlsm' => 'application/vnd.ms-excel.sheet.macroEnabled.12', - 'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', - 'xlt' => 'application/vnd.ms-excel', - 'xltm' => 'application/vnd.ms-excel.template.macroEnabled.12', - 'xltx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.template', - 'xlw' => 'application/vnd.ms-excel', - 'xm' => 'audio/xm', - 'xml' => 'application/xml', - 'xns' => 'application/xcap-ns+xml', - 'xo' => 'application/vnd.olpc-sugar', - 'xop' => 'application/xop+xml', - 'xpi' => 'application/x-xpinstall', - 'xpl' => 'application/xproc+xml', - 'xpm' => 'image/x-xpixmap', - 'xpr' => 'application/vnd.is-xpr', - 'xps' => 'application/vnd.ms-xpsdocument', - 'xpw' => 'application/vnd.intercon.formnet', - 'xpx' => 'application/vnd.intercon.formnet', - 'xsd' => 'application/xml', - 'xsl' => 'application/xml', - 'xslt' => 'application/xslt+xml', - 'xsm' => 'application/vnd.syncml+xml', - 'xspf' => 'application/xspf+xml', - 'xul' => 'application/vnd.mozilla.xul+xml', - 'xvm' => 'application/xv+xml', - 'xvml' => 'application/xv+xml', - 'xwd' => 'image/x-xwindowdump', - 'xyz' => 'chemical/x-xyz', - 'xz' => 'application/x-xz', - 'yaml' => 'text/yaml', - 'yang' => 'application/yang', - 'yin' => 'application/yin+xml', - 'yml' => 'text/yaml', - 'ymp' => 'text/x-suse-ymp', - 'z' => 'application/x-compress', - 'z1' => 'application/x-zmachine', - 'z2' => 'application/x-zmachine', - 'z3' => 'application/x-zmachine', - 'z4' => 'application/x-zmachine', - 'z5' => 'application/x-zmachine', - 'z6' => 'application/x-zmachine', - 'z7' => 'application/x-zmachine', - 'z8' => 'application/x-zmachine', - 'zaz' => 'application/vnd.zzazz.deck+xml', - 'zip' => 'application/zip', - 'zir' => 'application/vnd.zul', - 'zirz' => 'application/vnd.zul', - 'zmm' => 'application/vnd.handheld-entertainment+xml', - 'zsh' => 'text/x-scriptzsh', - ]; - - public function lookupMimeType(string $extension): ?string - { - return self::MIME_TYPES_FOR_EXTENSIONS[$extension] ?? null; - } -} diff --git a/vendor/league/mime-type-detection/src/MimeTypeDetector.php b/vendor/league/mime-type-detection/src/MimeTypeDetector.php deleted file mode 100644 index 5d799d2..0000000 --- a/vendor/league/mime-type-detection/src/MimeTypeDetector.php +++ /dev/null @@ -1,19 +0,0 @@ - $overrides - */ - public function __construct(ExtensionToMimeTypeMap $innerMap, array $overrides) - { - $this->innerMap = $innerMap; - $this->overrides = $overrides; - } - - public function lookupMimeType(string $extension): ?string - { - return $this->overrides[$extension] ?? $this->innerMap->lookupMimeType($extension); - } -} diff --git a/vendor/phpmailer/phpmailer/README.md b/vendor/phpmailer/phpmailer/README.md index 3a1a05b..56f971a 100644 --- a/vendor/phpmailer/phpmailer/README.md +++ b/vendor/phpmailer/phpmailer/README.md @@ -10,6 +10,7 @@ [![Total Downloads](https://poser.pugx.org/phpmailer/phpmailer/downloads)](https://packagist.org/packages/phpmailer/phpmailer) [![License](https://poser.pugx.org/phpmailer/phpmailer/license.svg)](https://packagist.org/packages/phpmailer/phpmailer) [![API Docs](https://github.com/phpmailer/phpmailer/workflows/Docs/badge.svg)](https://phpmailer.github.io/PHPMailer/) +[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/PHPMailer/PHPMailer/badge)](https://api.securityscorecards.dev/projects/github.com/PHPMailer/PHPMailer) ## Features - Probably the world's most popular code for sending email from PHP! diff --git a/vendor/phpmailer/phpmailer/VERSION b/vendor/phpmailer/phpmailer/VERSION index a45cc0a..a08b5f1 100644 --- a/vendor/phpmailer/phpmailer/VERSION +++ b/vendor/phpmailer/phpmailer/VERSION @@ -1 +1 @@ -6.6.3 \ No newline at end of file +6.6.4 \ No newline at end of file diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-el.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-el.php index b3d5ca9..339ee57 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-el.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-el.php @@ -5,22 +5,29 @@ * @package PHPMailer */ -$PHPMAILER_LANG['authenticate'] = 'SMTP Σφάλμα: Αδυναμία πιστοποίησης (authentication).'; -$PHPMAILER_LANG['connect_host'] = 'SMTP Σφάλμα: Αδυναμία σύνδεσης στον SMTP-Host.'; -$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Σφάλμα: Τα δεδομένα δεν έγιναν αποδεκτά.'; -$PHPMAILER_LANG['empty_message'] = 'Το E-Mail δεν έχει περιεχόμενο .'; -$PHPMAILER_LANG['encoding'] = 'Αγνωστο Encoding-Format: '; -$PHPMAILER_LANG['execute'] = 'Αδυναμία εκτέλεσης ακόλουθης εντολής: '; -$PHPMAILER_LANG['file_access'] = 'Αδυναμία προσπέλασης του αρχείου: '; -$PHPMAILER_LANG['file_open'] = 'Σφάλμα Αρχείου: Δεν είναι δυνατό το άνοιγμα του ακόλουθου αρχείου: '; -$PHPMAILER_LANG['from_failed'] = 'Η παρακάτω διεύθυνση αποστολέα δεν είναι σωστή: '; -$PHPMAILER_LANG['instantiate'] = 'Αδυναμία εκκίνησης Mail function.'; -$PHPMAILER_LANG['invalid_address'] = 'Το μήνυμα δεν εστάλη, η διεύθυνση δεν είναι έγκυρη: '; +$PHPMAILER_LANG['authenticate'] = 'Σφάλμα SMTP: Αδυναμία πιστοποίησης.'; +$PHPMAILER_LANG['buggy_php'] = 'Η έκδοση PHP που χρησιμοποιείτε παρουσιάζει σφάλμα που μπορεί να έχει ως αποτέλεσμα κατεστραμένα μηνύματα. Για να το διορθώσετε, αλλάξτε τον τρόπο αποστολής σε SMTP, απενεργοποιήστε την επιλογή mail.add_x_header στο αρχείο php.ini, αλλάξτε λειτουργικό σε MacOS ή Linux ή αναβαθμίστε την PHP σε έκδοση 7.0.17+ ή 7.1.3+.'; +$PHPMAILER_LANG['connect_host'] = 'Σφάλμα SMTP: Αδυναμία σύνδεσης με τον φιλοξενητή SMTP.'; +$PHPMAILER_LANG['data_not_accepted'] = 'Σφάλμα SMTP: Μη αποδεκτά δεδομένα.'; +$PHPMAILER_LANG['empty_message'] = 'Η ηλεκτρονική επιστολή δεν έχει περιεχόμενο.'; +$PHPMAILER_LANG['encoding'] = 'Άγνωστη μορφή κωδικοποίησης: '; +$PHPMAILER_LANG['execute'] = 'Αδυναμία εκτέλεσης: '; +$PHPMAILER_LANG['extension_missing'] = 'Απουσία επέκτασης: '; +$PHPMAILER_LANG['file_access'] = 'Αδυναμία πρόσβασης στο αρχείο: '; +$PHPMAILER_LANG['file_open'] = 'Σφάλμα Αρχείου: Αδυναμία ανοίγματος αρχείου: '; +$PHPMAILER_LANG['from_failed'] = 'Η ακόλουθη διεύθυνση αποστολέα δεν είναι σωστή: '; +$PHPMAILER_LANG['instantiate'] = 'Αδυναμία εκκίνησης συνάρτησης Mail.'; +$PHPMAILER_LANG['invalid_address'] = 'Μη έγκυρη διεύθυνση: '; +$PHPMAILER_LANG['invalid_header'] = 'Μη έγκυρο όνομα κεφαλίδας ή τιμή'; +$PHPMAILER_LANG['invalid_hostentry'] = 'Μη έγκυρη εισαγωγή φιλοξενητή: '; +$PHPMAILER_LANG['invalid_host'] = 'Μη έγκυρος φιλοξενητής: '; $PHPMAILER_LANG['mailer_not_supported'] = ' mailer δεν υποστηρίζεται.'; -$PHPMAILER_LANG['provide_address'] = 'Παρακαλούμε δώστε τουλάχιστον μια e-mail διεύθυνση παραλήπτη.'; -$PHPMAILER_LANG['recipients_failed'] = 'SMTP Σφάλμα: Οι παρακάτω διευθύνσεις παραλήπτη δεν είναι έγκυρες: '; +$PHPMAILER_LANG['provide_address'] = 'Δώστε τουλάχιστον μια ηλεκτρονική διεύθυνση παραλήπτη.'; +$PHPMAILER_LANG['recipients_failed'] = 'Σφάλμα SMTP: Οι παρακάτω διευθύνσεις παραλήπτη δεν είναι έγκυρες: '; $PHPMAILER_LANG['signing'] = 'Σφάλμα υπογραφής: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'Αποτυχία σύνδεσης στον SMTP Server.'; -$PHPMAILER_LANG['smtp_error'] = 'Σφάλμα από τον SMTP Server: '; -$PHPMAILER_LANG['variable_set'] = 'Αδυναμία ορισμού ή αρχικοποίησης μεταβλητής: '; -//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: '; +$PHPMAILER_LANG['smtp_code'] = 'Κώδικάς SMTP: '; +$PHPMAILER_LANG['smtp_code_ex'] = 'Πρόσθετες πληροφορίες SMTP: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'Αποτυχία σύνδεσης SMTP.'; +$PHPMAILER_LANG['smtp_detail'] = 'Λεπτομέρεια: '; +$PHPMAILER_LANG['smtp_error'] = 'Σφάλμα με τον διακομιστή SMTP: '; +$PHPMAILER_LANG['variable_set'] = 'Αδυναμία ορισμού ή επαναφοράς μεταβλητής: '; diff --git a/vendor/phpmailer/phpmailer/src/PHPMailer.php b/vendor/phpmailer/phpmailer/src/PHPMailer.php index 6590a0e..6242454 100644 --- a/vendor/phpmailer/phpmailer/src/PHPMailer.php +++ b/vendor/phpmailer/phpmailer/src/PHPMailer.php @@ -350,8 +350,8 @@ class PHPMailer public $Password = ''; /** - * SMTP auth type. - * Options are CRAM-MD5, LOGIN, PLAIN, XOAUTH2, attempted in that order if not specified. + * SMTP authentication type. Options are CRAM-MD5, LOGIN, PLAIN, XOAUTH2. + * If not specified, the first one from that list that the server supports will be selected. * * @var string */ @@ -750,7 +750,7 @@ class PHPMailer * * @var string */ - const VERSION = '6.6.3'; + const VERSION = '6.6.4'; /** * Error severity: message only, continue processing. @@ -1096,7 +1096,7 @@ class PHPMailer return false; } - if ($name !== null) { + if ($name !== null && is_string($name)) { $name = trim(preg_replace('/[\r\n]+/', '', $name)); //Strip breaks and trim } else { $name = ''; @@ -1288,7 +1288,7 @@ class PHPMailer */ public function setFrom($address, $name = '', $auto = true) { - $address = trim($address); + $address = trim((string)$address); $name = trim(preg_replace('/[\r\n]+/', '', $name)); //Strip breaks and trim //Don't validate now addresses with IDN. Will be done in send(). $pos = strrpos($address, '@'); @@ -1891,7 +1891,14 @@ class PHPMailer foreach ($this->to as $toaddr) { $toArr[] = $this->addrFormat($toaddr); } - $to = implode(', ', $toArr); + $to = trim(implode(', ', $toArr)); + + //If there are no To-addresses (e.g. when sending only to BCC-addresses) + //the following should be added to get a correct DKIM-signature. + //Compare with $this->preSend() + if ($to === '') { + $to = 'undisclosed-recipients:;'; + } $params = null; //This sets the SMTP envelope sender which gets turned into a return-path header by the receiver @@ -4470,6 +4477,7 @@ class PHPMailer 'ics' => 'text/calendar', 'xml' => 'text/xml', 'xsl' => 'text/xml', + 'csv' => 'text/csv', 'wmv' => 'video/x-ms-wmv', 'mpeg' => 'video/mpeg', 'mpe' => 'video/mpeg', diff --git a/vendor/phpmailer/phpmailer/src/POP3.php b/vendor/phpmailer/phpmailer/src/POP3.php index a7cc391..78e91e4 100644 --- a/vendor/phpmailer/phpmailer/src/POP3.php +++ b/vendor/phpmailer/phpmailer/src/POP3.php @@ -46,7 +46,7 @@ class POP3 * * @var string */ - const VERSION = '6.6.3'; + const VERSION = '6.6.4'; /** * Default POP3 port number. diff --git a/vendor/phpmailer/phpmailer/src/SMTP.php b/vendor/phpmailer/phpmailer/src/SMTP.php index c439a88..cc1711d 100644 --- a/vendor/phpmailer/phpmailer/src/SMTP.php +++ b/vendor/phpmailer/phpmailer/src/SMTP.php @@ -35,7 +35,7 @@ class SMTP * * @var string */ - const VERSION = '6.6.3'; + const VERSION = '6.6.4'; /** * SMTP line break constant. diff --git a/vendor/services.php b/vendor/services.php index 3b59f21..707cb51 100644 --- a/vendor/services.php +++ b/vendor/services.php @@ -1,5 +1,5 @@ 'think\\captcha\\CaptchaService', diff --git a/vendor/symfony/http-foundation/BinaryFileResponse.php b/vendor/symfony/http-foundation/BinaryFileResponse.php index beb0eda..6d7b80a 100644 --- a/vendor/symfony/http-foundation/BinaryFileResponse.php +++ b/vendor/symfony/http-foundation/BinaryFileResponse.php @@ -206,15 +206,19 @@ class BinaryFileResponse extends Response */ public function prepare(Request $request) { + if ($this->isInformational() || $this->isEmpty()) { + parent::prepare($request); + + $this->maxlen = 0; + + return $this; + } + if (!$this->headers->has('Content-Type')) { $this->headers->set('Content-Type', $this->file->getMimeType() ?: 'application/octet-stream'); } - if ('HTTP/1.0' !== $request->server->get('SERVER_PROTOCOL')) { - $this->setProtocolVersion('1.1'); - } - - $this->ensureIEOverSSLCompatibility($request); + parent::prepare($request); $this->offset = 0; $this->maxlen = -1; @@ -222,6 +226,7 @@ class BinaryFileResponse extends Response if (false === $fileSize = $this->file->getSize()) { return $this; } + $this->headers->remove('Transfer-Encoding'); $this->headers->set('Content-Length', $fileSize); if (!$this->headers->has('Accept-Ranges')) { @@ -291,6 +296,10 @@ class BinaryFileResponse extends Response } } + if ($request->isMethod('HEAD')) { + $this->maxlen = 0; + } + return $this; } @@ -312,40 +321,42 @@ class BinaryFileResponse extends Response */ public function sendContent() { - if (!$this->isSuccessful()) { - return parent::sendContent(); - } - - if (0 === $this->maxlen) { - return $this; - } - - $out = fopen('php://output', 'w'); - $file = fopen($this->file->getPathname(), 'r'); - - ignore_user_abort(true); - - if (0 !== $this->offset) { - fseek($file, $this->offset); - } - - $length = $this->maxlen; - while ($length && !feof($file)) { - $read = ($length > $this->chunkSize) ? $this->chunkSize : $length; - $length -= $read; - - stream_copy_to_stream($file, $out, $read); - - if (connection_aborted()) { - break; + try { + if (!$this->isSuccessful()) { + return parent::sendContent(); } - } - fclose($out); - fclose($file); + if (0 === $this->maxlen) { + return $this; + } - if ($this->deleteFileAfterSend && is_file($this->file->getPathname())) { - unlink($this->file->getPathname()); + $out = fopen('php://output', 'w'); + $file = fopen($this->file->getPathname(), 'r'); + + ignore_user_abort(true); + + if (0 !== $this->offset) { + fseek($file, $this->offset); + } + + $length = $this->maxlen; + while ($length && !feof($file)) { + $read = ($length > $this->chunkSize) ? $this->chunkSize : $length; + $length -= $read; + + stream_copy_to_stream($file, $out, $read); + + if (connection_aborted()) { + break; + } + } + + fclose($out); + fclose($file); + } finally { + if ($this->deleteFileAfterSend && is_file($this->file->getPathname())) { + unlink($this->file->getPathname()); + } } return $this; diff --git a/vendor/symfony/http-foundation/Request.php b/vendor/symfony/http-foundation/Request.php index 65f30a1..2bf52ce 100644 --- a/vendor/symfony/http-foundation/Request.php +++ b/vendor/symfony/http-foundation/Request.php @@ -1689,7 +1689,8 @@ class Request $languages = AcceptHeader::fromString($this->headers->get('Accept-Language'))->all(); $this->languages = []; - foreach ($languages as $lang => $acceptHeaderItem) { + foreach ($languages as $acceptHeaderItem) { + $lang = $acceptHeaderItem->getValue(); if (str_contains($lang, '-')) { $codes = explode('-', $lang); if ('i' === $codes[0]) { @@ -1727,7 +1728,7 @@ class Request return $this->charsets; } - return $this->charsets = array_keys(AcceptHeader::fromString($this->headers->get('Accept-Charset'))->all()); + return $this->charsets = array_map('strval', array_keys(AcceptHeader::fromString($this->headers->get('Accept-Charset'))->all())); } /** @@ -1741,7 +1742,7 @@ class Request return $this->encodings; } - return $this->encodings = array_keys(AcceptHeader::fromString($this->headers->get('Accept-Encoding'))->all()); + return $this->encodings = array_map('strval', array_keys(AcceptHeader::fromString($this->headers->get('Accept-Encoding'))->all())); } /** @@ -1755,7 +1756,7 @@ class Request return $this->acceptableContentTypes; } - return $this->acceptableContentTypes = array_keys(AcceptHeader::fromString($this->headers->get('Accept'))->all()); + return $this->acceptableContentTypes = array_map('strval', array_keys(AcceptHeader::fromString($this->headers->get('Accept'))->all())); } /** diff --git a/vendor/symfony/http-foundation/Response.php b/vendor/symfony/http-foundation/Response.php index 88635bb..d5c8cb4 100644 --- a/vendor/symfony/http-foundation/Response.php +++ b/vendor/symfony/http-foundation/Response.php @@ -399,6 +399,7 @@ class Response litespeed_finish_request(); } elseif (!\in_array(\PHP_SAPI, ['cli', 'phpdbg'], true)) { static::closeOutputBuffers(0, true); + flush(); } return $this; @@ -1245,7 +1246,6 @@ class Response while ($level-- > $targetLevel && ($s = $status[$level]) && (!isset($s['del']) ? !isset($s['flags']) || ($s['flags'] & $flags) === $flags : $s['del'])) { if ($flush) { ob_end_flush(); - flush(); } else { ob_end_clean(); } diff --git a/vendor/topthink/framework/README.md b/vendor/topthink/framework/README.md index aa16486..08893cd 100644 --- a/vendor/topthink/framework/README.md +++ b/vendor/topthink/framework/README.md @@ -1,6 +1,6 @@ ![](https://box.kancloud.cn/5a0aaa69a5ff42657b5c4715f3d49221) -ThinkPHP 6.0 +ThinkPHP 6.1 =============== [![Build Status](https://travis-ci.org/top-think/framework.svg?branch=6.0)](https://travis-ci.org/top-think/framework) @@ -11,9 +11,8 @@ ThinkPHP 6.0 [![PHP Version](https://img.shields.io/badge/php-%3E%3D7.1-8892BF.svg)](http://www.php.net/) [![License](https://poser.pugx.org/topthink/framework/license)](https://packagist.org/packages/topthink/framework) -ThinkPHP6.0底层架构采用PHP7.1改写和进一步优化。 -[官方应用服务市场](https://market.topthink.com) | [`ThinkAPI`——官方统一API服务](https://docs.topthink.com/think-api/) +[官方服务](https://www.topthink.com) | [`ThinkAPI`——官方统一API](https://doc.topthink.com/think-api) ## 主要新特性 @@ -35,7 +34,7 @@ ThinkPHP6.0底层架构采用PHP7.1改写和进一步优化。 * 统一和精简大量用法 -> ThinkPHP6.0的运行环境要求PHP7.2+,兼容PHP8.1 +> ThinkPHP6.1的运行环境要求PHP7.2.5+,兼容PHP8.1 ## 安装 diff --git a/vendor/topthink/framework/composer.json b/vendor/topthink/framework/composer.json index 90793d3..b5cd915 100644 --- a/vendor/topthink/framework/composer.json +++ b/vendor/topthink/framework/composer.json @@ -22,8 +22,6 @@ "php": ">=7.2.5", "ext-json": "*", "ext-mbstring": "*", - "league/flysystem": "^1.1.4", - "league/flysystem-cached-adapter": "^1.0", "psr/log": "~1.0", "psr/container": "~1.0", "psr/simple-cache": "^1.0", diff --git a/vendor/topthink/framework/src/think/App.php b/vendor/topthink/framework/src/think/App.php index b189cd9..c7453b6 100644 --- a/vendor/topthink/framework/src/think/App.php +++ b/vendor/topthink/framework/src/think/App.php @@ -39,7 +39,7 @@ use think\initializer\RegisterService; */ class App extends Container { - const VERSION = '6.0.13LTS'; + const VERSION = '6.1.0'; /** * 应用调试模式 @@ -152,7 +152,6 @@ class App extends Container 'session' => Session::class, 'validate' => Validate::class, 'view' => View::class, - 'filesystem' => Filesystem::class, 'think\DbManager' => Db::class, 'think\LogManager' => Log::class, 'think\CacheManager' => Cache::class, diff --git a/vendor/topthink/framework/src/think/Console.php b/vendor/topthink/framework/src/think/Console.php index 389d104..27f12ba 100644 --- a/vendor/topthink/framework/src/think/Console.php +++ b/vendor/topthink/framework/src/think/Console.php @@ -117,9 +117,9 @@ class Console */ protected function makeRequest() { - $uri = $this->app->config->get('app.url', 'http://localhost'); + $url = $this->app->config->get('app.url', 'http://localhost'); - $components = parse_url($uri); + $components = parse_url($url); $server = $_SERVER; @@ -127,6 +127,7 @@ class Console $server = array_merge($server, [ 'SCRIPT_FILENAME' => $components['path'], 'SCRIPT_NAME' => $components['path'], + 'REQUEST_URI' => $components['path'], ]); } @@ -150,8 +151,6 @@ class Console $server['HTTP_HOST'] .= ':' . $components['port']; } - $server['REQUEST_URI'] = $uri; - /** @var Request $request */ $request = $this->app->make('request'); diff --git a/vendor/topthink/framework/src/think/Filesystem.php b/vendor/topthink/framework/src/think/Filesystem.php deleted file mode 100644 index 0aee929..0000000 --- a/vendor/topthink/framework/src/think/Filesystem.php +++ /dev/null @@ -1,89 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think; - -use InvalidArgumentException; -use think\filesystem\Driver; -use think\filesystem\driver\Local; -use think\helper\Arr; - -/** - * Class Filesystem - * @package think - * @mixin Driver - * @mixin Local - */ -class Filesystem extends Manager -{ - protected $namespace = '\\think\\filesystem\\driver\\'; - - /** - * @param null|string $name - * @return Driver - */ - public function disk(string $name = null): Driver - { - return $this->driver($name); - } - - protected function resolveType(string $name) - { - return $this->getDiskConfig($name, 'type', 'local'); - } - - protected function resolveConfig(string $name) - { - return $this->getDiskConfig($name); - } - - /** - * 获取缓存配置 - * @access public - * @param null|string $name 名称 - * @param mixed $default 默认值 - * @return mixed - */ - public function getConfig(string $name = null, $default = null) - { - if (!is_null($name)) { - return $this->app->config->get('filesystem.' . $name, $default); - } - - return $this->app->config->get('filesystem'); - } - - /** - * 获取磁盘配置 - * @param string $disk - * @param null $name - * @param null $default - * @return array - */ - public function getDiskConfig($disk, $name = null, $default = null) - { - if ($config = $this->getConfig("disks.{$disk}")) { - return Arr::get($config, $name, $default); - } - - throw new InvalidArgumentException("Disk [$disk] not found."); - } - - /** - * 默认驱动 - * @return string|null - */ - public function getDefaultDriver() - { - return $this->getConfig('default'); - } -} diff --git a/vendor/topthink/framework/src/think/Lang.php b/vendor/topthink/framework/src/think/Lang.php index 5f16c46..b891084 100644 --- a/vendor/topthink/framework/src/think/Lang.php +++ b/vendor/topthink/framework/src/think/Lang.php @@ -287,58 +287,4 @@ class Lang return $value; } - /** - * 自动侦测设置获取语言选择 - * @deprecated - * @access public - * @param Request $request - * @return string - */ - public function detect(Request $request): string - { - // 自动侦测设置获取语言选择 - $langSet = ''; - - if ($request->get($this->config['detect_var'])) { - // url中设置了语言变量 - $langSet = strtolower($request->get($this->config['detect_var'])); - } elseif ($request->header($this->config['header_var'])) { - // Header中设置了语言变量 - $langSet = strtolower($request->header($this->config['header_var'])); - } elseif ($request->cookie($this->config['cookie_var'])) { - // Cookie中设置了语言变量 - $langSet = strtolower($request->cookie($this->config['cookie_var'])); - } elseif ($request->server('HTTP_ACCEPT_LANGUAGE')) { - // 自动侦测浏览器语言 - $match = preg_match('/^([a-z\d\-]+)/i', $request->server('HTTP_ACCEPT_LANGUAGE'), $matches); - if ($match) { - $langSet = strtolower($matches[1]); - if (isset($this->config['accept_language'][$langSet])) { - $langSet = $this->config['accept_language'][$langSet]; - } - } - } - - if (empty($this->config['allow_lang_list']) || in_array($langSet, $this->config['allow_lang_list'])) { - // 合法的语言 - $this->range = $langSet; - } - - return $this->range; - } - - /** - * 保存当前语言到Cookie - * @deprecated - * @access public - * @param Cookie $cookie Cookie对象 - * @return void - */ - public function saveToCookie(Cookie $cookie) - { - if ($this->config['use_cookie']) { - $cookie->set($this->config['cookie_var'], $this->range); - } - } - } diff --git a/vendor/topthink/framework/src/think/facade/Filesystem.php b/vendor/topthink/framework/src/think/facade/Filesystem.php deleted file mode 100644 index 53706a8..0000000 --- a/vendor/topthink/framework/src/think/facade/Filesystem.php +++ /dev/null @@ -1,33 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\facade; - -use think\Facade; -use think\filesystem\Driver; - -/** - * Class Filesystem - * @package think\facade - * @mixin \think\Filesystem - * @method static Driver disk(string $name = null) ,null|string - * @method static mixed getConfig(null|string $name = null, mixed $default = null) 获取缓存配置 - * @method static array getDiskConfig(string $disk, null $name = null, null $default = null) 获取磁盘配置 - * @method static string|null getDefaultDriver() 默认驱动 - */ -class Filesystem extends Facade -{ - protected static function getFacadeClass() - { - return 'filesystem'; - } -} diff --git a/vendor/topthink/framework/src/think/filesystem/CacheStore.php b/vendor/topthink/framework/src/think/filesystem/CacheStore.php deleted file mode 100644 index 0a62399..0000000 --- a/vendor/topthink/framework/src/think/filesystem/CacheStore.php +++ /dev/null @@ -1,54 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\filesystem; - -use League\Flysystem\Cached\Storage\AbstractCache; -use Psr\SimpleCache\CacheInterface; - -class CacheStore extends AbstractCache -{ - protected $store; - - protected $key; - - protected $expire; - - public function __construct(CacheInterface $store, $key = 'flysystem', $expire = null) - { - $this->key = $key; - $this->store = $store; - $this->expire = $expire; - } - - /** - * Store the cache. - */ - public function save() - { - $contents = $this->getForStorage(); - - $this->store->set($this->key, $contents, $this->expire); - } - - /** - * Load the cache. - */ - public function load() - { - $contents = $this->store->get($this->key); - - if (!is_null($contents)) { - $this->setFromStorage($contents); - } - } -} diff --git a/vendor/topthink/framework/src/think/filesystem/Driver.php b/vendor/topthink/framework/src/think/filesystem/Driver.php deleted file mode 100644 index 0e61cf4..0000000 --- a/vendor/topthink/framework/src/think/filesystem/Driver.php +++ /dev/null @@ -1,144 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\filesystem; - -use League\Flysystem\AdapterInterface; -use League\Flysystem\Adapter\AbstractAdapter; -use League\Flysystem\Cached\CachedAdapter; -use League\Flysystem\Cached\Storage\Memory as MemoryStore; -use League\Flysystem\Filesystem; -use RuntimeException; -use think\Cache; -use think\File; - -/** - * Class Driver - * @package think\filesystem - * @mixin Filesystem - */ -abstract class Driver -{ - - /** @var Cache */ - protected $cache; - - /** @var Filesystem */ - protected $filesystem; - - /** - * 配置参数 - * @var array - */ - protected $config = []; - - public function __construct(Cache $cache, array $config) - { - $this->cache = $cache; - $this->config = array_merge($this->config, $config); - - $adapter = $this->createAdapter(); - $this->filesystem = $this->createFilesystem($adapter); - } - - protected function createCacheStore($config) - { - if (true === $config) { - return new MemoryStore; - } - - return new CacheStore( - $this->cache->store($config['store']), - $config['prefix'] ?? 'flysystem', - $config['expire'] ?? null - ); - } - - abstract protected function createAdapter(): AdapterInterface; - - protected function createFilesystem(AdapterInterface $adapter): Filesystem - { - if (!empty($this->config['cache'])) { - $adapter = new CachedAdapter($adapter, $this->createCacheStore($this->config['cache'])); - } - - $config = array_intersect_key($this->config, array_flip(['visibility', 'disable_asserts', 'url'])); - - return new Filesystem($adapter, count($config) > 0 ? $config : null); - } - - /** - * 获取文件完整路径 - * @param string $path - * @return string - */ - public function path(string $path): string - { - $adapter = $this->filesystem->getAdapter(); - - if ($adapter instanceof AbstractAdapter) { - return $adapter->applyPathPrefix($path); - } - - return $path; - } - - protected function concatPathToUrl($url, $path) - { - return rtrim($url, '/') . '/' . ltrim($path, '/'); - } - - public function url(string $path): string - { - throw new RuntimeException('This driver does not support retrieving URLs.'); - } - - /** - * 保存文件 - * @param string $path 路径 - * @param File $file 文件 - * @param null|string|\Closure $rule 文件名规则 - * @param array $options 参数 - * @return bool|string - */ - public function putFile(string $path, File $file, $rule = null, array $options = []) - { - return $this->putFileAs($path, $file, $file->hashName($rule), $options); - } - - /** - * 指定文件名保存文件 - * @param string $path 路径 - * @param File $file 文件 - * @param string $name 文件名 - * @param array $options 参数 - * @return bool|string - */ - public function putFileAs(string $path, File $file, string $name, array $options = []) - { - $stream = fopen($file->getRealPath(), 'r'); - $path = trim($path . '/' . $name, '/'); - - $result = $this->putStream($path, $stream, $options); - - if (is_resource($stream)) { - fclose($stream); - } - - return $result ? $path : false; - } - - public function __call($method, $parameters) - { - return $this->filesystem->$method(...$parameters); - } -} diff --git a/vendor/topthink/framework/src/think/filesystem/driver/Local.php b/vendor/topthink/framework/src/think/filesystem/driver/Local.php deleted file mode 100644 index 5749335..0000000 --- a/vendor/topthink/framework/src/think/filesystem/driver/Local.php +++ /dev/null @@ -1,59 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types = 1); - -namespace think\filesystem\driver; - -use League\Flysystem\AdapterInterface; -use League\Flysystem\Adapter\Local as LocalAdapter; -use think\filesystem\Driver; - -class Local extends Driver -{ - /** - * 配置参数 - * @var array - */ - protected $config = [ - 'root' => '', - ]; - - protected function createAdapter(): AdapterInterface - { - $permissions = $this->config['permissions'] ?? []; - - $links = ($this->config['links'] ?? null) === 'skip' - ? LocalAdapter::SKIP_LINKS - : LocalAdapter::DISALLOW_LINKS; - - return new LocalAdapter( - $this->config['root'], - LOCK_EX, - $links, - $permissions - ); - } - - /** - * 获取文件访问地址 - * @param string $path 文件路径 - * @return string - */ - public function url(string $path): string - { - $path = str_replace('\\', '/', $path); - - if (isset($this->config['url'])) { - return $this->concatPathToUrl($this->config['url'], $path); - } - return parent::url($path); - } -} diff --git a/vendor/topthink/framework/src/think/middleware/LoadLangPack.php b/vendor/topthink/framework/src/think/middleware/LoadLangPack.php index d6bf6a4..af0324b 100644 --- a/vendor/topthink/framework/src/think/middleware/LoadLangPack.php +++ b/vendor/topthink/framework/src/think/middleware/LoadLangPack.php @@ -70,33 +70,35 @@ class LoadLangPack if ($request->get($this->config['detect_var'])) { // url中设置了语言变量 - $langSet = strtolower($request->get($this->config['detect_var'])); + $langSet = $request->get($this->config['detect_var']); } elseif ($request->header($this->config['header_var'])) { // Header中设置了语言变量 - $langSet = strtolower($request->header($this->config['header_var'])); + $langSet = $request->header($this->config['header_var']); } elseif ($request->cookie($this->config['cookie_var'])) { // Cookie中设置了语言变量 - $langSet = strtolower($request->cookie($this->config['cookie_var'])); + $langSet = $request->cookie($this->config['cookie_var']); } elseif ($request->server('HTTP_ACCEPT_LANGUAGE')) { // 自动侦测浏览器语言 - $match = preg_match('/^([a-z\d\-]+)/i', $request->server('HTTP_ACCEPT_LANGUAGE'), $matches); - if ($match) { - $langSet = strtolower($matches[1]); - if (isset($this->config['accept_language'][$langSet])) { - $langSet = $this->config['accept_language'][$langSet]; - } + $langSet = $request->server('HTTP_ACCEPT_LANGUAGE'); + } + + if (preg_match('/^([a-z\d\-]+)/i', $langSet, $matches)) { + $langSet = strtolower($matches[1]); + if (isset($this->config['accept_language'][$langSet])) { + $langSet = $this->config['accept_language'][$langSet]; } + } else { + $langSet = $this->lang->getLangSet(); } if (empty($this->config['allow_lang_list']) || in_array($langSet, $this->config['allow_lang_list'])) { // 合法的语言 - $range = $langSet; - $this->lang->setLangSet($range); + $this->lang->setLangSet($langSet); } else { - $range = $this->lang->getLangSet(); + $langSet = $this->lang->getLangSet(); } - return $range; + return $langSet; } /** diff --git a/vendor/topthink/framework/tests/FilesystemTest.php b/vendor/topthink/framework/tests/FilesystemTest.php deleted file mode 100644 index df5ffe2..0000000 --- a/vendor/topthink/framework/tests/FilesystemTest.php +++ /dev/null @@ -1,131 +0,0 @@ -app = m::mock(App::class)->makePartial(); - Container::setInstance($this->app); - $this->app->shouldReceive('make')->with(App::class)->andReturn($this->app); - $this->config = m::mock(Config::class); - $this->config->shouldReceive('get')->with('filesystem.default', null)->andReturn('local'); - $this->app->shouldReceive('get')->with('config')->andReturn($this->config); - $this->filesystem = new Filesystem($this->app); - - $this->root = vfsStream::setup('rootDir'); - } - - protected function tearDown(): void - { - m::close(); - } - - public function testDisk() - { - $this->config->shouldReceive('get')->with('filesystem.disks.local', null)->andReturn([ - 'type' => 'local', - 'root' => $this->root->url(), - ]); - - $this->config->shouldReceive('get')->with('filesystem.disks.foo', null)->andReturn([ - 'type' => 'local', - 'root' => $this->root->url(), - ]); - - $this->assertInstanceOf(Local::class, $this->filesystem->disk()); - - $this->assertInstanceOf(Local::class, $this->filesystem->disk('foo')); - } - - public function testCache() - { - $this->config->shouldReceive('get')->with('filesystem.disks.local', null)->andReturn([ - 'type' => 'local', - 'root' => $this->root->url(), - 'cache' => true, - ]); - - $this->assertInstanceOf(Local::class, $this->filesystem->disk()); - - $this->config->shouldReceive('get')->with('filesystem.disks.cache', null)->andReturn([ - 'type' => NullDriver::class, - 'root' => $this->root->url(), - 'cache' => [ - 'store' => 'flysystem', - ], - ]); - - $cache = m::mock(Cache::class); - - $cacheDriver = m::mock(File::class); - - $cache->shouldReceive('store')->once()->with('flysystem')->andReturn($cacheDriver); - - $this->app->shouldReceive('make')->with(Cache::class)->andReturn($cache); - - $cacheDriver->shouldReceive('get')->with('flysystem')->once()->andReturn(null); - - $cacheDriver->shouldReceive('set')->withAnyArgs(); - - $this->filesystem->disk('cache')->put('test.txt', 'aa'); - } - - public function testPutFile() - { - $root = vfsStream::setup('rootDir', null, [ - 'foo.jpg' => 'hello', - ]); - - $this->config->shouldReceive('get')->with('filesystem.disks.local', null)->andReturn([ - 'type' => NullDriver::class, - 'root' => $root->url(), - 'cache' => true, - ]); - - $file = m::mock(\think\File::class); - - $file->shouldReceive('hashName')->with(null)->once()->andReturn('foo.jpg'); - - $file->shouldReceive('getRealPath')->once()->andReturn($root->getChild('foo.jpg')->url()); - - $this->filesystem->putFile('test', $file); - } -} - -class NullDriver extends Driver -{ - protected function createAdapter(): AdapterInterface - { - return new NullAdapter(); - } -} diff --git a/vendor/topthink/think-captcha/composer.json b/vendor/topthink/think-captcha/composer.json index e598819..b34e19f 100644 --- a/vendor/topthink/think-captcha/composer.json +++ b/vendor/topthink/think-captcha/composer.json @@ -9,7 +9,7 @@ ], "license": "Apache-2.0", "require": { - "topthink/framework": "^6.0.0" + "topthink/framework": "^6.0" }, "autoload": { "psr-4": { diff --git a/vendor/topthink/think-captcha/src/Captcha.php b/vendor/topthink/think-captcha/src/Captcha.php index e3fa5ef..ba6f11c 100644 --- a/vendor/topthink/think-captcha/src/Captcha.php +++ b/vendor/topthink/think-captcha/src/Captcha.php @@ -177,6 +177,10 @@ class Captcha $this->imageW || $this->imageW = $this->length * $this->fontSize * 1.5 + $this->length * $this->fontSize / 2; // 图片高(px) $this->imageH || $this->imageH = $this->fontSize * 2.5; + + $this->imageW = intval($this->imageW); + $this->imageH = intval($this->imageH); + // 建立一幅 $this->imageW x $this->imageH 的图像 $this->im = imagecreate((int) $this->imageW, (int) $this->imageH); // 设置背景 @@ -224,7 +228,7 @@ class Captcha $y = $this->fontSize + mt_rand(10, 20); $angle = $this->math ? 0 : mt_rand(-40, 40); - imagettftext($this->im, $this->fontSize, $angle, (int) $x, (int) $y, $this->color, $fontttf, $char); + imagettftext($this->im, intval($this->fontSize), intval($this->fontSize), intval($x), intval($y), $this->color, $fontttf, $char); } ob_start(); @@ -254,8 +258,8 @@ class Captcha // 曲线前部分 $A = mt_rand(1, $this->imageH / 2); // 振幅 - $b = mt_rand(-$this->imageH / 4, $this->imageH / 4); // Y轴方向偏移量 - $f = mt_rand(-$this->imageH / 4, $this->imageH / 4); // X轴方向偏移量 + $b = mt_rand(intval(-$this->imageH / 4), intval($this->imageH / 4)); // Y轴方向偏移量 + $f = mt_rand(intval(-$this->imageH / 4), intval($this->imageH / 4)); // X轴方向偏移量 $T = mt_rand($this->imageH, $this->imageW * 2); // 周期 $w = (2 * M_PI) / $T; @@ -267,7 +271,7 @@ class Captcha $py = $A * sin($w * $px + $f) + $b + $this->imageH / 2; // y = Asin(ωx+φ) + b $i = (int) ($this->fontSize / 5); while ($i > 0) { - imagesetpixel($this->im, $px + $i, $py + $i, $this->color); // 这里(while)循环画像素点比imagettftext和imagestring用字体大小一次画出(不用这while循环)性能要好很多 + imagesetpixel($this->im, intval($px + $i), intval($py + $i), $this->color); // 这里(while)循环画像素点比imagettftext和imagestring用字体大小一次画出(不用这while循环)性能要好很多 $i--; } } @@ -275,7 +279,7 @@ class Captcha // 曲线后部分 $A = mt_rand(1, $this->imageH / 2); // 振幅 - $f = mt_rand(-$this->imageH / 4, $this->imageH / 4); // X轴方向偏移量 + $f = mt_rand(intval(-$this->imageH / 4), intval($this->imageH / 4)); // X轴方向偏移量 $T = mt_rand($this->imageH, $this->imageW * 2); // 周期 $w = (2 * M_PI) / $T; $b = $py - $A * sin($w * $px + $f) - $this->imageH / 2; @@ -287,7 +291,7 @@ class Captcha $py = $A * sin($w * $px + $f) + $b + $this->imageH / 2; // y = Asin(ωx+φ) + b $i = (int) ($this->fontSize / 5); while ($i > 0) { - imagesetpixel($this->im, $px + $i, $py + $i, $this->color); + imagesetpixel($this->im, intval($px + $i), intval($py + $i), $this->color); $i--; } } @@ -336,5 +340,4 @@ class Captcha @imagecopyresampled($this->im, $bgImage, 0, 0, 0, 0, $this->imageW, $this->imageH, $width, $height); @imagedestroy($bgImage); } - } diff --git a/vendor/topthink/think-multi-app/composer.json b/vendor/topthink/think-multi-app/composer.json index 92d620e..82606c1 100644 --- a/vendor/topthink/think-multi-app/composer.json +++ b/vendor/topthink/think-multi-app/composer.json @@ -10,7 +10,7 @@ ], "require": { "php": ">=7.1.0", - "topthink/framework": "^6.0.0" + "topthink/framework": "^6.0" }, "autoload": { "psr-4": { diff --git a/vendor/topthink/think-multi-app/src/Url.php b/vendor/topthink/think-multi-app/src/Url.php index 7bd6057..df415ad 100644 --- a/vendor/topthink/think-multi-app/src/Url.php +++ b/vendor/topthink/think-multi-app/src/Url.php @@ -42,15 +42,17 @@ class Url extends UrlBuild // 解析到控制器 $url = substr($url, 1); } elseif ('' === $url) { - $url = $this->getAppName() . '/' . $request->controller() . '/' . $request->action(); + $url = $request->controller() . '/' . $request->action(); + if (!$this->app->http->isBind()) { + $url = $this->getAppName() . '/' . $url; + } } else { // 解析到 应用/控制器/操作 $controller = $request->controller(); - $app = $this->getAppName(); $path = explode('/', $url); $action = array_pop($path); $controller = empty($path) ? $controller : array_pop($path); - $app = empty($path) ? $app : array_pop($path); + $app = empty($path) ? $this->getAppName() : array_pop($path); $url = $controller . '/' . $action; $bind = $this->app->config->get('app.domain_bind', []); @@ -58,7 +60,7 @@ class Url extends UrlBuild isset($bind[$_SERVER['SERVER_NAME']]) && $domain = $_SERVER['SERVER_NAME']; $domain = is_bool($domain) ? $key : $domain; - } else { + } elseif (!$this->app->http->isBind()) { $url = $app . '/' . $url; } }