knplabs / gaufrette
PHP库,提供文件系统抽象层
v0.11.1
2022-11-03 17:26 UTC
Requires
- php: ^7.4 || ^8.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.9
- mikey179/vfsstream: v1.x-dev as 1.7.0
- pedrotroller/php-cs-custom-fixer: ^2.28
- phpspec/phpspec: ^7.0
- phpunit/phpunit: ~8.0
Suggests
- ext-fileinfo: This extension is used to automatically detect the content-type of a file in the AwsS3, OpenCloud, AzureBlogStorage and GoogleCloudStorage adapters
- knplabs/knp-gaufrette-bundle: to use with Symfony
Conflicts
- microsoft/windowsazure: <0.4.3
- 1.x-dev
- v0.12.0.x-dev
- v0.11.1
- v0.11.0
- dev-master / 0.10.x-dev
- v0.10.0
- v0.9.0
- v0.8.3
- v0.8.2
- v0.8.1
- v0.8.0
- v0.7.0
- v0.6.0
- v0.5.0
- v0.4.0
- v0.3.1
- v0.3
- 0.2.1
- 0.2.0
- v0.1.9
- v0.1.8
- v0.1.7
- v0.1.6
- v0.1.5
- v0.1.4
- v0.1.3
- v0.1.2
- v0.1.1
- v0.1
- dev-fix/make-command-remove-phpspec
- dev-refactor/migrate-file-php8
- dev-refacto/add-types-on-adapter
- dev-redacto/add-type-util
- dev-refacto/add-type-stream
- dev-refacto/spec-types
- dev-refactor/add-type-to-stream-wrapper-and-filesystemmap
- dev-refacto/add-type-exceptions
- dev-feature/better-documentation
- dev-feature/exceptions
- dev-feature/file-metadata-refactoring
This package is auto-updated.
Last update: 2024-08-27 11:00:57 UTC
README
Gaufrette提供文件系统抽象层。
为什么使用Gaufrette?
想象一下,你需要在PHP项目中管理大量媒体。让我们看看如何利用Gaufrette来利用这种状况。
文件系统抽象层允许你在不知道所有媒体将存储在哪里以及如何存储的情况下开发应用程序。
此方法的另一个优点是,您可以在不影响文件系统定义之外的代码的情况下更新文件的存储位置。例如,如果您的项目发展非常快,并且服务器达到其限制,您可以轻松地将媒体移动到Amazon S3服务器或其他任何解决方案。
文档
阅读官方Gaufrette文档。
适配器的元包
每个维护的适配器现在都有一个专门的元包。您可以在Packagist上找到列表。**我们强烈建议您使用它们,因为它们包含它们自己的要求**:您不再需要担心在使用Gaufrette之前安装第三方依赖项。
Symfony集成
Symfony集成通过KnpLabs/KnpGaufretteBundle提供。
维护者
以下是每个未废弃适配器的专属维护者列表。如果您在及时收到对您的任何问题或拉取请求的响应,请提醒我们
对于InMemory
、Local
和Zip
适配器,此列表中的每个人都被视为维护者。
开发
需要
- docker-ce
- docker-compose
- 创建
.env
文件
$ make docker.dev
并按需进行配置。
- 构建PHP Docker镜像
$ make docker.build
- 安装依赖项
$ make docker.all-deps
- 运行测试
$ make docker.tests
您也可以使用不同的PHP版本,只需在调用make目标时将PHP_VERSION
环境变量设置为以下值之一即可
7.1
7.2
(默认)7.3
(PHP 7.3的Docker设置可用。但是,ssh2扩展尚未安装,因为PHP 7.3尚不可用[1])
有关详细信息,请参阅docker-compose.yml
文件。
在从一种版本切换到另一种版本时,您需要清除之前安装的依赖项。要执行此操作,请运行
$ make clear-deps $ PHP_VERSION=<the_version_you_want_to_use> make build install-deps
- 应用编码标准
您应该使用
$ make php-cs-compare
检查CS违规行为,并用
$ make php-cs-fix
进行修复
注意