Download the PHP package tsslabs/gaufrette without Composer

On this page you can find all versions of the php package tsslabs/gaufrette. 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 gaufrette

Gaufrette

Gaufrette is a PHP5 library that provides a filesystem abstraction layer.

This project is under intensive development but we do not want to break BC.

Build Status

Why use Gaufrette?

Imagine you have to manage a lot of medias in a PHP project. Lets see how to take this situation in your advantage using Gaufrette.

The filesystem abstraction layer permits you to develop your application without the need to know were all those medias will be stored and how.

Another advantage of this is the possibility to update the files location 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.

Try it!

Setup your filesystem

Following an example with the local filesystem adapter. To setup other adapters, look up the testcases.

Use the filesystem

Use file objects

Gaufrette also provide a File class that is a representation of files in a filesystem

Cache a slow filesystem

If you have to deal with a slow filesystem, it is out of question to use it directly. So, you need a cache! Happily, Gaufrette offers a cache system ready for use. It consist of an adapter itself composed of two adapters:

* The *source* adapter that should be cached
* The *cache* adapter that is used to cache

Here is an example of how to cache an ftp filesystem:

The third parameter of the cache adapter is the time to live of the cache.

Using Amazon S3

When using the legacy Amazon S3 adapters, you will need to specify a CA certificate to be able to talk to Amazon servers in https. You can use the one which is shipped with the SDK by defining before creating the \AmazonS3 object:

Specifying a custom CA certificate is not required when using the Gaufrette\Adapter\AmazonS3 adapter because it uses the newest version of the AWS SDK for PHP.

Using OpenCloud

To use the OpenCloud adapter you will need to create a connection using the OpenCloud SDK. You can then fetch the ObjectStore which is required for the OpenCloud adapter.

OpenCloud

Rackspace

Rackspace uses a difference connection class

Using AzureBlobStorage

Azure Blob Storage is the storage service provided by Microsoft Windows Azure cloud environment. To use this adapter you need to install the Azure SDK for php into your project.

To instantiate the AzureBlobStorage adapter you need a BlobProxyFactoryInterface instance (you can use the default BlobProxyFactory class) and a connection string. The connection string should follow this prototype:

BlobEndpoint=https://XXXXXXXXXX.blob.core.windows.net/;AccountName=XXXXXXXX;AccountKey=XXXXXXXXXXXXXXXXXXXX

You should be able to find your endpoint, account name and account key in your Windows Azure management console.

Thanks to the blob proxy factory, the adapter lazy loads the connection to the endpoint, so it will not create any connection until it's really needed (eg. when a read or write operation is issued).

Follows a simple example on how to build the adapter:

Using FTP adapters

Some FTP servers need valid configuration so Gaufrette can working with them as expected.

Pure Ftpd

To handle hidden files we need to configure it by:

Proftpd

To handle hidden files we need to change ListOptions in proftpd configuration (at debian system /etc/proftpd/proftpd.conf probably) to:

Using Gaufrette in a Symfony2 project

As you can see, Gaufrette provides an elegant way to declare your filesystems.

In your Symfony2 project, add to deps:

And then, you can simply add them as services of your dependency injection container. As an example, here is services declaration to use Amazon S3:

Streaming Files

Sometimes, you don't have the choice, you must get a streamable file URL (i.e to transform an image). Let's take a look at the following example:

Running the Tests

The tests use phpspec2 and PHPUnit.

Setup the vendor libraries

As some filesystem adapters use vendor libraries, you should install the vendors:

$ cd gaufrette
$ php composer.phar install --dev
$ sh bin/configure_test_env.sh

It will avoid skip a lot of tests.

Launch the Test Suite

In the Gaufrette root directory:

To check if classes specification pass: $ php bin/phpspec run

To check basic functionality of the adapters (adapters should be configured you will see many skipped tests): $ phpunit

Is it green?


All versions of gaufrette with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.2
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/gaufrette contains the following files

Loading the files please wait ....