Download the PHP package tsslabs/knp-gaufrette-bundle without Composer

On this page you can find all versions of the php package tsslabs/knp-gaufrette-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package knp-gaufrette-bundle

Gaufrette Bundle

Provides a Gaufrette integration for your Symfony projects.

About Gaufrette

Gaufrette is a PHP 5.3+ 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.

Documentation is available the official page of Gaufrette.

Installation

Prerequisites

As this bundle is an integration for Symfony of the Gaufrette library, it requires you to first install Gaufrette in a Symfony project.

Download the bundle

You can download an archive of the bundle and unpack it in the vendor/bundles/Knp/Bundle/GaufretteBundle directory of your application.

Standard Edition Style

If you are using the deps file to manage your project's dependencies, you must add the following lines to it:

[gaufrette]
    git=http://github.com/KnpLabs/Gaufrette.git

[KnpGaufretteBundle]
    git=http://github.com/KnpLabs/KnpGaufretteBundle.git
    target=/bundles/Knp/Bundle/GaufretteBundle

Composer Style

This bundle can be installed using composer by adding the following in the require section of your composer.json file:

Git Submodule Style

If you are versioning your project with git and making changes to this bundle you can embed it as a submodule:

$ git submodule add https://github.com/KnpLabs/KnpGaufretteBundle.git vendor/bundles/Knp/Bundle/GaufretteBundle

Add the namespace in the autoloader

You must register both Gaufrette and the KnpGaufretteBundle in your autoloader: (You do not have to do this if you are using the composer autoload system.)

Register the bundle

You must register the bundle in your kernel:

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

The defined adapters are then used to create the filesystems.

Configuring the Filesystems

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:

Returns the bar instance of Gaufrette\Filesystem.

Adapters Reference

Local Adapter (local)

A simple local filesystem based adapter.

Parameters

Example

Safe Local Adapter (safe_local)

Almost as simple as the local adapter, but it encodes key to avoid having to deal with the directories structure.

Parameters

Example

Service (service)

Allows you to use a user defined adapter service.

Parameters

Example

In Memory (in_memory)

Adapter for test purposes, it stores files in an internal array.

Parameters

The files is an array of files where each file is a sub-array having the content, checksum and mtime optional keys.

Example

Azure Blob Storage (azure_blob_storage)

Adapter for Microsoft Azure Blob Storage service. To use this adapter you need to install the Azure SDK for php into your project.

Further more you need a valid connection string and you must define a Blob Proxy factory service with it. You can use the default \Gaufrette\Adapter\AzureBlobStorage\BlobProxyFactory this way:

You must set the parameter azure_blob_storage_connection_string to contain your windows azure blob storage connection string. You can retrieve your connection string in your Windows Azure management console.

Parameters

Example

GridFS (gridfs)

Adapter that allows you to use a MongoDB GridFS for storing files.

Parameters

Example

In your AcmeTestBundle, add following service definitions:

Note that it is possible to prepare MongoGridFS service any way you like. This is just one way to do it.

MogileFS (mogilefs)

Adapter that allows you to use MogileFS for storing files.

Parameters

Example

Ftp (ftp)

Adapter for FTP.

Parameters

Example

Sftp (sftp)

Adapter for SFTP (SSH-FTP).

Parameters

Example

In your AcmeTestBundle, add following service definitions:

Apc (apc)

Adapter for APC.

A non-persistent adapter, use it in the dev environment, in demo sites, ...

Parameters

Example

Amazon S3 (amazon_s3)

Adapter to connect to Amazon S3 instances.

This adapter requires the use of amazonwebservices/aws-sdk-for-php which can be installed by adding the following line to your composer.json:

Parameters

Defining services

To use the Amazon S3 adapter you need to provide a valid AmazonS3 instance (as defined in the Amazon SDK). This can easily be set up as using Symfony's service configuration:

Example

Once the service is set up use its key as the amazon_s3_id in the gaufrette configuration:

Note that the SDK seems to have some issues with bucket names with dots in them, e.g. "com.mycompany.bucket" seems to have issues but "com-mycompany-bucket" works.

AwsS3

Adapter for Amazon S3 SDK v2.

Parameters

Example

Open Cloud (opencloud)

Adapter for OpenCloud (Rackspace)

Parameters

Defining services

To use the OpenCloud adapter you should provide a valid ObjectStore instance. You can retrieve an instance through the OpenCloud\OpenStack or OpenCloud\Rackspace instances. We can provide a comprehensive configuration through the Symfony DIC configuration.

Define OpenStack/Rackspace service

Generic OpenStack:

HPCloud:

The username and password are your login credentials, not the api key. Your tenantName is your Project Name on the api keys page.

Rackspace:

Define ObjectStore service

HPCloud:

Rackspace:

Example

Finally you can define your adapter in configuration:

Cache (cache)

Adapter which allows you to cache other adapters

Parameters

Example

Stream Wrapper

The stream_wrapper settings allow you to register filesystems with a specified domain and then use as a stream wrapper anywhere in your code like: gaufrette://domain/file.txt

Parameters

Example 1

Using default settings, the protocol is "gaufrette" and all filesystems will be served

Example 2

We define the protocol as "data", all filesystem will still be served (by default)

Example 3

We define the protocol as data and define which filesystem(s) will be available

Example 4

We define the protocol as data and define which filesystems will be available using array keys to set domain aliases

Doctrine DBAL (doctrine_dbal)

Adapter that allows you to store data into a database.

Parameters

Example


All versions of knp-gaufrette-bundle with dependencies

PHP Build Version
Package Version
Requires symfony/framework-bundle Version 2.*
knplabs/gaufrette Version 0.1.4
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package tsslabs/knp-gaufrette-bundle contains the following files

Loading the files please wait ....