2017 © Pedro PelĂĄez
 

symfony-bundle knp-gaufrette-bundle

Allows to easily use the Gaufrette library in a Symfony project

image

knplabs/knp-gaufrette-bundle

Allows to easily use the Gaufrette library in a Symfony project

  • Thursday, July 26, 2018
  • by Knplabs
  • Repository
  • 32 Watchers
  • 415 Stars
  • 4,773,220 Installations
  • PHP
  • 94 Dependents
  • 18 Suggesters
  • 123 Forks
  • 21 Open issues
  • 14 Versions
  • 7 % Grown

The README.md

Gaufrette Bundle

Build Status, (*1)

Provides a Gaufrette integration for your Symfony projects., (*2)

SWUbanner, (*3)

About Gaufrette

Gaufrette is a PHP library providing a filesystem abstraction layer. This abstraction layer allows you to develop applications without needing to know where all their media files will be stored or how., (*4)

Documentation is available the official page of Gaufrette., (*5)

Installation

Prerequisites

As this bundle is an integration for Symfony of the Gaufrette library, it requires you to first install Gaufrette in your project., (*6)

Note that, you need to install separately the adapters you want to use. You can find more details about these packages here, and the full list adapters on packagist., (*7)

With composer

composer require knplabs/knp-gaufrette-bundle

Register the bundle

You must register the bundle in your kernel:, (*8)

``` php <?php, (*9)

return [ // ... Knp\Bundle\GaufretteBundle\KnpGaufretteBundle::class => ['all' => true], ];, (*10)


Configuration ============= The Gaufrette bundle allows you to declare your filesystems as services without having to reach into the famous "Service Container". Indeed, you can do it with the configuration! The configuration of the Gaufrette bundle is divided into two parts: the `adapters` and the `filesystems`. ## Configuring the Adapters ``` yaml # config/packages/knp_gaufrette.yaml knp_gaufrette: adapters: foo: local: directory: /path/to/my/filesystem

The defined adapters are then used to create the filesystems., (*11)

You can use on of these adapters: * Local Adapter * Safe Local Adapter * Service * In Memory * Azure Blob Storage * GridFS * MogileFS * Ftp * Sftp * Phpseclib Sftp * Apc * AsyncAws S3 * AWS S3 * Open Cloud * GoogleCloudStorage * Cache * Stream Wrapper * Doctrine DBAL * Dropbox, (*12)

Configuring the Filesystems

``` yaml, (*13)

config/packages/knp_gaufrette.yaml

knp_gaufrette: adapters: # ... filesystems: bar: adapter: foo alias: foo_filesystem, (*14)


Each defined filesystem must have an `adapter` with its value set to an adapter's key. The filesystem defined above will result in a service with id `gaufrette.bar_filesystem`. The `alias` parameter allows us to define an alias for it (`foo_filesystem` in this case). The filesystem map ================== You can access all declared filesystems through the map service. In the previous exemple, we declared a `bar` filesystem: ``` php $container->get('knp_gaufrette.filesystem_map')->get('bar');

Returns the bar instance of Gaufrette\Filesystem., (*15)

Use cases

Check out basic examples of the library., (*16)

Maintainers

KNPLabs is looking for maintainers (see why)., (*17)

If you are interested, feel free to open a PR to ask to be added as a maintainer., (*18)

We’ll be glad to hear from you :), (*19)

The Versions

16/03 2017

v0.4.0

0.4.0.0 http://knplabs.com

Allows to easily use the Gaufrette library in a Symfony project

  Sources   Download

MIT

The Requires

 

The Development Requires

file filesystem media abstraction

16/01 2016

0.3.0

0.3.0.0 http://knplabs.com

Allows to easily use the Gaufrette library in a Symfony project

  Sources   Download

MIT

The Requires

 

The Development Requires

file filesystem media abstraction

18/09 2015

0.2.0

0.2.0.0 http://knplabs.com

Allows to easily use the Gaufrette library in a Symfony project

  Sources   Download

MIT

The Requires

 

The Development Requires

file filesystem media abstraction

24/03 2014

v0.1.7

0.1.7.0 http://knplabs.com

Allows to easily use the Gaufrette library in a Symfony project

  Sources   Download

MIT

The Requires

 

The Development Requires

file filesystem media abstraction

30/01 2013

v0.1.4

0.1.4.0 http://knplabs.com

Allows to easily use the Gaufrette library in a Symfony project

  Sources   Download

MIT

The Requires

 

The Development Requires

file filesystem media abstraction

14/11 2012

v0.1.3

0.1.3.0 http://knplabs.com

Allows to easily use the Gaufrette library in a Symfony project

  Sources   Download

MIT

The Requires

 

The Development Requires

file filesystem media abstraction