Skip to content
This repository has been archived by the owner on Sep 6, 2022. It is now read-only.

robotusers/gaufrette-extras

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gaufrette Extras Build Status

Gaufrette Extras is a PHP library providing extra features to the awesome Gaufrette.

Status

The original project at K-Phoen/gaufrette-extras has been deprecated.

This fork intends to keep it alive for some time.

Installation

The recommended way to install this library is through composer.

Just create a composer.json file for your project:

{
    "require": {
        "kphoen/gaufrette-extras": "~1.1"
    },
    "repositories": [
        {
            "type": "vcs",
            "url": "https://github.com/robotusers/gaufrette-extras"
        }
    ],
}

And run these two commands to install it:

$ wget http://getcomposer.org/composer.phar
$ php composer.phar install

Now you can add the autoloader, and you will have access to the library:

require 'vendor/autoload.php';

Features

URL resolvers

Resolvers provide a quick and easy way to resolve filesystem entries to a URL.

$resolver = new PrefixResolver('http://www.my-website.com/uploads');
$adapter = new ResolvableAdapter(new LocalAdapter('/tmp'), $resolver);
$filesystem = new ResolvableFilesystem($adapter);

$filesystem->write('myFile.txt', 'Hello I am the new content');

var_dump($filesystem->resolve('myFile.txt')); // 'http://www.my-website.com/uploads/myFile.txt'

Tests

To run unit tests, you'll need cURL and a set of dependencies you can install using Composer:

php composer.phar install

Once installed, just launch the following command:

./vendor/bin/phpunit

License

This library is released under the MIT license. See the bundled LICENSE file for details.

About

PHP library providing extra features to the awesome Gaufrette

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%