From e3aa99257a57dfe2f189d5a4f0e1802b862ee214 Mon Sep 17 00:00:00 2001 From: Default Date: Tue, 29 Apr 2025 23:51:08 +0800 Subject: [PATCH] 123 --- code/composer.json | 23 +- code/composer.lock | 370 +++++++++++++--------------- code/extend/storage/StorageCore.php | 15 +- 3 files changed, 193 insertions(+), 215 deletions(-) diff --git a/code/composer.json b/code/composer.json index aefec70..48dbae7 100644 --- a/code/composer.json +++ b/code/composer.json @@ -20,27 +20,26 @@ } ], "require": { - "php": ">=8.0.0", - "topthink/framework": "^8.0", - "topthink/think-orm": "^3.0|^4.0", - "topthink/think-filesystem": "^2.0", + "php": ">=8.3.0", + "topthink/framework": "^8.1", + "topthink/think-orm": "^4.0", + "topthink/think-filesystem": "^3.0", "topthink/think-multi-app": "^1.1", "topthink/think-view": "^2.0", - "guzzlehttp/guzzle": "^7.8", + "guzzlehttp/guzzle": "^7.9", "jaeger/querylist": "^4.2", "topthink/think-migration": "^3.1", "topthink/think-helper": "^3.1", "fakerphp/faker": "^1.23", - "aws/aws-sdk-php": "^3.337", - "league/flysystem": "^1.1", - "league/flysystem-aws-s3-v3": "^1.0", + "league/flysystem": "^3.0", + "league/flysystem-aws-s3-v3": "^3.0", "topthink/think-throttle": "^2.0", - "phpoffice/phpspreadsheet": "^4.1" + "phpoffice/phpspreadsheet": "^4.1", + "mongodb/mongodb": "^2.0" }, "require-dev": { "topthink/think-dumper": "^1.0", - "topthink/think-trace": "^1.0", - "mongodb/mongodb": "^1.21" + "topthink/think-trace": "^1.0" }, "autoload": { "psr-4": { @@ -60,4 +59,4 @@ "@php think vendor:publish" ] } -} +} \ No newline at end of file diff --git a/code/composer.lock b/code/composer.lock index a74c1ab..a2902ce 100644 --- a/code/composer.lock +++ b/code/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "b478b1d55a2646f40e59782fcccfd100", + "content-hash": "4d215153ace75d936fec5b0a4d3689df", "packages": [ { "name": "aws/aws-crt-php", @@ -782,54 +782,55 @@ }, { "name": "league/flysystem", - "version": "1.1.10", + "version": "3.29.1", "source": { "type": "git", "url": "https://github.com/thephpleague/flysystem.git", - "reference": "3239285c825c152bcc315fe0e87d6b55f5972ed1" + "reference": "edc1bb7c86fab0776c3287dbd19b5fa278347319" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/3239285c825c152bcc315fe0e87d6b55f5972ed1", - "reference": "3239285c825c152bcc315fe0e87d6b55f5972ed1", + "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/edc1bb7c86fab0776c3287dbd19b5fa278347319", + "reference": "edc1bb7c86fab0776c3287dbd19b5fa278347319", "shasum": "" }, "require": { - "ext-fileinfo": "*", - "league/mime-type-detection": "^1.3", - "php": "^7.2.5 || ^8.0" + "league/flysystem-local": "^3.0.0", + "league/mime-type-detection": "^1.0.0", + "php": "^8.0.2" }, "conflict": { - "league/flysystem-sftp": "<1.0.6" + "async-aws/core": "<1.19.0", + "async-aws/s3": "<1.14.0", + "aws/aws-sdk-php": "3.209.31 || 3.210.0", + "guzzlehttp/guzzle": "<7.0", + "guzzlehttp/ringphp": "<1.1.1", + "phpseclib/phpseclib": "3.0.15", + "symfony/http-client": "<5.2" }, "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" + "async-aws/s3": "^1.5 || ^2.0", + "async-aws/simple-s3": "^1.1 || ^2.0", + "aws/aws-sdk-php": "^3.295.10", + "composer/semver": "^3.0", + "ext-fileinfo": "*", + "ext-ftp": "*", + "ext-mongodb": "^1.3", + "ext-zip": "*", + "friendsofphp/php-cs-fixer": "^3.5", + "google/cloud-storage": "^1.23", + "guzzlehttp/psr7": "^2.6", + "microsoft/azure-storage-blob": "^1.1", + "mongodb/mongodb": "^1.2", + "phpseclib/phpseclib": "^3.0.36", + "phpstan/phpstan": "^1.10", + "phpunit/phpunit": "^9.5.11|^10.0", + "sabre/dav": "^4.6.0" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1-dev" - } - }, "autoload": { "psr-4": { - "League\\Flysystem\\": "src/" + "League\\Flysystem\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -839,73 +840,57 @@ "authors": [ { "name": "Frank de Jonge", - "email": "info@frenky.net" + "email": "info@frankdejonge.nl" } ], - "description": "Filesystem abstraction: Many filesystems, one API.", + "description": "File storage abstraction for PHP", "keywords": [ - "Cloud Files", "WebDAV", - "abstraction", "aws", "cloud", - "copy.com", - "dropbox", - "file systems", + "file", "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.10" + "source": "https://github.com/thephpleague/flysystem/tree/3.29.1" }, - "funding": [ - { - "url": "https://offset.earth/frankdejonge", - "type": "other" - } - ], - "time": "2022-10-04T09:16:37+00:00" + "time": "2024-10-08T08:58:34+00:00" }, { "name": "league/flysystem-aws-s3-v3", - "version": "1.0.30", + "version": "3.29.0", "source": { "type": "git", "url": "https://github.com/thephpleague/flysystem-aws-s3-v3.git", - "reference": "af286f291ebab6877bac0c359c6c2cb017eb061d" + "reference": "c6ff6d4606e48249b63f269eba7fabdb584e76a9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem-aws-s3-v3/zipball/af286f291ebab6877bac0c359c6c2cb017eb061d", - "reference": "af286f291ebab6877bac0c359c6c2cb017eb061d", + "url": "https://api.github.com/repos/thephpleague/flysystem-aws-s3-v3/zipball/c6ff6d4606e48249b63f269eba7fabdb584e76a9", + "reference": "c6ff6d4606e48249b63f269eba7fabdb584e76a9", "shasum": "" }, "require": { - "aws/aws-sdk-php": "^3.20.0", - "league/flysystem": "^1.0.40", - "php": ">=5.5.0" + "aws/aws-sdk-php": "^3.295.10", + "league/flysystem": "^3.10.0", + "league/mime-type-detection": "^1.0.0", + "php": "^8.0.2" }, - "require-dev": { - "henrikbjorn/phpspec-code-coverage": "~1.0.1", - "phpspec/phpspec": "^2.0.0" + "conflict": { + "guzzlehttp/guzzle": "<7.0", + "guzzlehttp/ringphp": "<1.1.1" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, "autoload": { "psr-4": { - "League\\Flysystem\\AwsS3v3\\": "src/" + "League\\Flysystem\\AwsS3V3\\": "" } }, "notification-url": "https://packagist.org/downloads/", @@ -915,62 +900,48 @@ "authors": [ { "name": "Frank de Jonge", - "email": "info@frenky.net" + "email": "info@frankdejonge.nl" } ], - "description": "Flysystem adapter for the AWS S3 SDK v3.x", + "description": "AWS S3 filesystem adapter for Flysystem.", + "keywords": [ + "Flysystem", + "aws", + "file", + "files", + "filesystem", + "s3", + "storage" + ], "support": { - "issues": "https://github.com/thephpleague/flysystem-aws-s3-v3/issues", - "source": "https://github.com/thephpleague/flysystem-aws-s3-v3/tree/1.0.30" + "source": "https://github.com/thephpleague/flysystem-aws-s3-v3/tree/3.29.0" }, - "funding": [ - { - "url": "https://offset.earth/frankdejonge", - "type": "custom" - }, - { - "url": "https://github.com/frankdejonge", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/league/flysystem", - "type": "tidelift" - } - ], - "time": "2022-07-02T13:51:38+00:00" + "time": "2024-08-17T13:10:48+00:00" }, { - "name": "league/flysystem-cached-adapter", - "version": "1.0.2", + "name": "league/flysystem-local", + "version": "3.29.0", "source": { "type": "git", - "url": "https://github.com/thephpleague/flysystem-cached-adapter.git", - "reference": "7bb5cd9d996904cf43d7da8ba45a724ff8c7ef14" + "url": "https://github.com/thephpleague/flysystem-local.git", + "reference": "e0e8d52ce4b2ed154148453d321e97c8e931bd27" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem-cached-adapter/zipball/7bb5cd9d996904cf43d7da8ba45a724ff8c7ef14", - "reference": "7bb5cd9d996904cf43d7da8ba45a724ff8c7ef14", + "url": "https://api.github.com/repos/thephpleague/flysystem-local/zipball/e0e8d52ce4b2ed154148453d321e97c8e931bd27", + "reference": "e0e8d52ce4b2ed154148453d321e97c8e931bd27", "shasum": "" }, "require": { - "league/flysystem": "~1.0" - }, - "require-dev": { - "henrikbjorn/phpspec-code-coverage": "~1.0@dev", - "mockery/mockery": "~0.9", - "phpspec/phpspec": "~2.1", - "phpunit/phpunit": "~4.1", - "predis/predis": "~1.0", - "tedivm/stash": "~0.12" - }, - "suggest": { - "ext-phpredis": "Pure C implemented extension for PHP" + "ext-fileinfo": "*", + "league/flysystem": "^3.0.0", + "league/mime-type-detection": "^1.0.0", + "php": "^8.0.2" }, "type": "library", "autoload": { "psr-4": { - "League\\Flysystem\\Cached\\": "src/" + "League\\Flysystem\\Local\\": "" } }, "notification-url": "https://packagist.org/downloads/", @@ -979,16 +950,22 @@ ], "authors": [ { - "name": "frankdejonge", - "email": "info@frenky.net" + "name": "Frank de Jonge", + "email": "info@frankdejonge.nl" } ], - "description": "An adapter decorator to enable meta-data caching.", + "description": "Local filesystem adapter for Flysystem.", + "keywords": [ + "Flysystem", + "file", + "files", + "filesystem", + "local" + ], "support": { - "issues": "https://github.com/thephpleague/flysystem-cached-adapter/issues", - "source": "https://github.com/thephpleague/flysystem-cached-adapter/tree/master" + "source": "https://github.com/thephpleague/flysystem-local/tree/3.29.0" }, - "time": "2015-07-09T21:00:39+00:00" + "time": "2024-08-09T21:24:39+00:00" }, { "name": "league/mime-type-detection", @@ -1231,6 +1208,82 @@ }, "time": "2022-12-02T22:17:43+00:00" }, + { + "name": "mongodb/mongodb", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/mongodb/mongo-php-library.git", + "reference": "04cd7edc6a28950e3fab6eccb2869d72a0541232" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/mongodb/mongo-php-library/zipball/04cd7edc6a28950e3fab6eccb2869d72a0541232", + "reference": "04cd7edc6a28950e3fab6eccb2869d72a0541232", + "shasum": "" + }, + "require": { + "composer-runtime-api": "^2.0", + "ext-mongodb": "^2.0", + "php": "^8.1", + "psr/log": "^1.1.4|^2|^3" + }, + "replace": { + "mongodb/builder": "*" + }, + "require-dev": { + "doctrine/coding-standard": "^12.0", + "phpunit/phpunit": "^10.5.35", + "rector/rector": "^1.2", + "squizlabs/php_codesniffer": "^3.7", + "vimeo/psalm": "6.5.*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "files": [ + "src/functions.php" + ], + "psr-4": { + "MongoDB\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Andreas Braun", + "email": "andreas.braun@mongodb.com" + }, + { + "name": "Jeremy Mikola", + "email": "jmikola@gmail.com" + }, + { + "name": "Jérôme Tamarelle", + "email": "jerome.tamarelle@mongodb.com" + } + ], + "description": "MongoDB driver library", + "homepage": "https://jira.mongodb.org/browse/PHPLIB", + "keywords": [ + "database", + "driver", + "mongodb", + "persistence" + ], + "support": { + "issues": "https://github.com/mongodb/mongo-php-library/issues", + "source": "https://github.com/mongodb/mongo-php-library/tree/2.0.0" + }, + "time": "2025-04-10T08:34:11+00:00" + }, { "name": "mtdowling/jmespath.php", "version": "2.8.0", @@ -2488,28 +2541,27 @@ }, { "name": "topthink/think-filesystem", - "version": "v2.0.3", + "version": "v3.0.0", "source": { "type": "git", "url": "https://github.com/top-think/think-filesystem.git", - "reference": "e8e51adb9f3a3f3aac2aa3ef73b7b439100f777d" + "reference": "7a1231a65bca278de9b7f9236767eef9741dfe5c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/top-think/think-filesystem/zipball/e8e51adb9f3a3f3aac2aa3ef73b7b439100f777d", - "reference": "e8e51adb9f3a3f3aac2aa3ef73b7b439100f777d", + "url": "https://api.github.com/repos/top-think/think-filesystem/zipball/7a1231a65bca278de9b7f9236767eef9741dfe5c", + "reference": "7a1231a65bca278de9b7f9236767eef9741dfe5c", "shasum": "" }, "require": { - "league/flysystem": "^1.1.4", - "league/flysystem-cached-adapter": "^1.0", - "php": ">=7.2.5", - "topthink/framework": "^6.1|^8.0" + "league/flysystem": "^3.0", + "php": "^8.2", + "topthink/framework": "^8.0" }, "require-dev": { "mikey179/vfsstream": "^1.6", "mockery/mockery": "^1.2", - "phpunit/phpunit": "^8.0" + "phpunit/phpunit": "^11.5" }, "type": "library", "autoload": { @@ -2530,9 +2582,9 @@ "description": "The ThinkPHP6.1 Filesystem Package", "support": { "issues": "https://github.com/top-think/think-filesystem/issues", - "source": "https://github.com/top-think/think-filesystem/tree/v2.0.3" + "source": "https://github.com/top-think/think-filesystem/tree/v3.0.0" }, - "time": "2024-10-16T03:37:24+00:00" + "time": "2024-12-10T06:23:28+00:00" }, { "name": "topthink/think-helper", @@ -2925,82 +2977,6 @@ } ], "packages-dev": [ - { - "name": "mongodb/mongodb", - "version": "1.21.1", - "source": { - "type": "git", - "url": "https://github.com/mongodb/mongo-php-library.git", - "reference": "37bc8df3a67ddf8380704a5ba5dbd00e92ec1f6a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/mongodb/mongo-php-library/zipball/37bc8df3a67ddf8380704a5ba5dbd00e92ec1f6a", - "reference": "37bc8df3a67ddf8380704a5ba5dbd00e92ec1f6a", - "shasum": "" - }, - "require": { - "composer-runtime-api": "^2.0", - "ext-mongodb": "^1.21.0", - "php": "^8.1", - "psr/log": "^1.1.4|^2|^3" - }, - "replace": { - "mongodb/builder": "*" - }, - "require-dev": { - "doctrine/coding-standard": "^12.0", - "phpunit/phpunit": "^10.5.35", - "rector/rector": "^1.2", - "squizlabs/php_codesniffer": "^3.7", - "vimeo/psalm": "6.5.*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "autoload": { - "files": [ - "src/functions.php" - ], - "psr-4": { - "MongoDB\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "Apache-2.0" - ], - "authors": [ - { - "name": "Andreas Braun", - "email": "andreas.braun@mongodb.com" - }, - { - "name": "Jeremy Mikola", - "email": "jmikola@gmail.com" - }, - { - "name": "Jérôme Tamarelle", - "email": "jerome.tamarelle@mongodb.com" - } - ], - "description": "MongoDB driver library", - "homepage": "https://jira.mongodb.org/browse/PHPLIB", - "keywords": [ - "database", - "driver", - "mongodb", - "persistence" - ], - "support": { - "issues": "https://github.com/mongodb/mongo-php-library/issues", - "source": "https://github.com/mongodb/mongo-php-library/tree/1.21.1" - }, - "time": "2025-02-28T17:24:20+00:00" - }, { "name": "topthink/think-dumper", "version": "v1.0.5", @@ -3107,7 +3083,7 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": ">=8.0.0" + "php": ">=8.3.0" }, "platform-dev": {}, "plugin-api-version": "2.6.0" diff --git a/code/extend/storage/StorageCore.php b/code/extend/storage/StorageCore.php index fa7b777..9c77695 100644 --- a/code/extend/storage/StorageCore.php +++ b/code/extend/storage/StorageCore.php @@ -6,6 +6,7 @@ use League\Flysystem\Filesystem; use League\Flysystem\AwsS3v3\AwsS3Adapter; use Aws\S3\S3Client; use League\Flysystem\Adapter\Local; +use League\Flysystem\Local\LocalFilesystemAdapter; class StorageCore { @@ -22,7 +23,7 @@ class StorageCore /** * Undocumented variable * - * @var Local + * @var LocalFilesystemAdapter */ private $Adapter; @@ -30,9 +31,11 @@ class StorageCore { $arrConfig = config('storage'); - $this->Adapter = new Local( - $arrConfig['local']['dir'] - ); + // $this->Adapter = new Local( + // $arrConfig['local']['dir'] + // ); + + $this->Adapter = new LocalFilesystemAdapter($arrConfig['local']['dir']); $this->Filesystem = new Filesystem($this->Adapter); } @@ -64,7 +67,7 @@ class StorageCore public function put($strKey, $strContent, array $arrConfig = []) { $strContent = zstd_compress($strContent); - return $this->Filesystem->put($strKey, $strContent, $arrConfig); + return $this->Filesystem->write($strKey, $strContent, $arrConfig); } public function write($strKey, $strContent, array $arrConfig = []) @@ -76,7 +79,7 @@ class StorageCore public function update($strKey, $strContent, array $arrConfig = []) { $strContent = zstd_compress($strContent); - return $this->Filesystem->update($strKey, $strContent, $arrConfig); + return $this->Filesystem->write($strKey, $strContent, $arrConfig); } public function read($strKey)