knplabs / gaufrette
PHP library that provides a filesystem abstraction layer
Installs: 32 605 491
Dependents: 139
Suggesters: 18
Security: 0
Stars: 2 471
Watchers: 74
Forks: 355
Open Issues: 87
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-11-27 11:27:36 UTC
README
Gaufrette provides a filesystem abstraction layer.
Why use Gaufrette?
Imagine you have to manage a lot of media in a PHP project. Let's see how to take this situation to your advantage using Gaufrette.
The filesystem abstraction layer permits you to develop your application without the need to know where all those media will be stored and how.
Another advantage of this is the possibility to update the location of the files without any impact on the code apart from the definition of your filesystem. In example, if your project grows up very fast and if your server reaches its limits, you can easily move your medias in an Amazon S3 server or any other solution.
Documentation
Read the official Gaufrette documentation.
Metapackages for adapters
Every maintained adapter now has a dedicated metapackage. You can find the list on packagist. We highly recommend you to use them as they contain their own requirements: you don't need to worry about third-party dependencies to install before using Gaufrette anymore.
Symfony integration
Symfony integration is available through KnpLabs/KnpGaufretteBundle.
Maintainers
Here is the list of the dedicated maintainer(s) for every adapter not deprecated. If you don't receive any response to your issue or pull request in a timely manner, ping us:
For InMemory
, Local
, and Zip
adapters everyone in this list is considered as a maintainer.
Development
Requires :
- docker-ce
- docker-compose
- Create
.env
file :
$ make docker.dev
and configure it as you want.
- Build the PHP docker image :
$ make docker.build
- Install dependencies :
$ make docker.all-deps
- Run tests :
$ make docker.tests
You can also use a different php version, simply set the PHP_VERSION
env var
to any of these values when calling a make target :
7.1
7.2
(default)7.3
(The docker setup for PHP 7.3 is available. However, the ssh2 extension is not installed as it is not available for PHP 7.3 yet)
See the docker-compose.yml
file for more details.
You'll need to clear the previously installed dependencies when switching from one version to an other. To do so, run :
$ make clear-deps $ PHP_VERSION=<the_version_you_want_to_use> make build install-deps
- Apply Coding Standards
You should check for CS violations by using
$ make php-cs-compare
and fix them with
$ make php-cs-fix
Note
This project does not have any stable release yet but we do not want to break BC now.