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)

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., (*3)

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

Installation

Prerequisites

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

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., (*6)

With composer

composer require knplabs/knp-gaufrette-bundle

Register the bundle

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

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

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


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., (*10)

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, (*11)

Configuring the Filesystems

``` yaml, (*12)

config/packages/knp_gaufrette.yaml

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


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., (*14)

Use cases

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

Maintainers

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