PHPackages                             digitalkaoz/gaufrette-browser-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [File &amp; Storage](/categories/file-storage)
4. /
5. digitalkaoz/gaufrette-browser-bundle

ActiveSymfony-bundle[File &amp; Storage](/categories/file-storage)

digitalkaoz/gaufrette-browser-bundle
====================================

This bundle provides an integration of the KnpMenu library

0.3.0(11y ago)4269MITPHP

Since Jun 11Pushed 11y ago1 watchersCompare

[ Source](https://github.com/digitalkaoz/GaufretteBrowserBundle)[ Packagist](https://packagist.org/packages/digitalkaoz/gaufrette-browser-bundle)[ RSS](/packages/digitalkaoz-gaufrette-browser-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (3)Versions (4)Used By (0)

Gaufrette Browser
=================

[](#gaufrette-browser)

[![Build Status](https://camo.githubusercontent.com/85cef90aaf0ef5e07842be976c725ea1d20d505819a5a97723c76857124ab5ce/68747470733a2f2f7472617669732d63692e6f72672f6469676974616c6b616f7a2f47617566726574746542726f7773657242756e646c652e706e67)](https://travis-ci.org/digitalkaoz/GaufretteBrowserBundle)[![Total Downloads](https://camo.githubusercontent.com/1d5586164257eecdaf8569ff02c1997a0f6a67cd6a53910d4df38861f5708983/68747470733a2f2f706f7365722e707567782e6f72672f6469676974616c6b616f7a2f6761756672657474652d62726f777365722d62756e646c652f646f776e6c6f6164732e706e67)](https://packagist.org/packages/digitalkaoz/gaufrette-browser-bundle)[![Latest Stable Version](https://camo.githubusercontent.com/1664eb4d1860b8af146d994a69d24bba69b8dbd393b0fc03ed1722d38d13acc8/68747470733a2f2f706f7365722e707567782e6f72672f6469676974616c6b616f7a2f6761756672657474652d62726f777365722d62756e646c652f762f737461626c652e706e67)](https://packagist.org/packages/digitalkaoz/gaufrette-browser-bundle)[![Code Coverage](https://camo.githubusercontent.com/28036ec7766961950565b87ce611960c40caeba94577cad8d8bf13b89e0160ec/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6469676974616c6b616f7a2f47617566726574746542726f7773657242756e646c652f6261646765732f636f7665726167652e706e673f733d35383731653739373836326336376332656662656166306339643364396431313135643934613162)](https://scrutinizer-ci.com/g/digitalkaoz/GaufretteBrowserBundle/)[![Scrutinizer Quality Score](https://camo.githubusercontent.com/9105a3b0d97519567d17689930481492078ac594d920a4143c282baeb4098103/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6469676974616c6b616f7a2f47617566726574746542726f7773657242756e646c652f6261646765732f7175616c6974792d73636f72652e706e673f733d63323366623230386130656536346366646238343463383739343937333335326339343137313639)](https://scrutinizer-ci.com/g/digitalkaoz/GaufretteBrowserBundle/)[![SensioLabsInsight](https://camo.githubusercontent.com/05e7cf7ff2139be5205492bbe4776e407a38424d4ef192ebed3a2d95d00a5e7a/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f39643339313463322d303633362d346437632d613536302d6466656134313362616139332f6d696e692e706e67)](https://insight.sensiolabs.com/projects/9d3914c2-0636-4d7c-a560-dfea413baa93)

This Bundle allows you to browse a Gaufrette Filesystem like a Doctrine Connection. It tries to wrap Doctrine ObjectRepositories and Entities around Gaufrette Files.

Installation
------------

[](#installation)

**Install it with Composer**

```
{
    "require" : {
        "digitalkaoz/gaufrette-browser-bundle" : "dev-master@dev"
    }
}
```

**Active the Bundle in your Kernel**

```
// application/AppKernel.php
public function registerBundles()
{
  return array(
      // ...
      new rs\GaufretteBrowserBundle\rsGaufretteBrowserBundle(),
      // ...
  );
}
```

**Import the Routing**

```
rs_gaufrette_browser:
    resource: "@rsGaufretteBrowserBundle/Resources/config/routing.xml"
    prefix:   /gaufrette/browser
```

Configuration
-------------

[](#configuration)

**Create a Gaufrette Filesystem (see  for more Installation and Configuration)**

```
knp_gaufrette:
    adapters:
        default:
            local:
                directory: /your/path/
    filesystems:
        default:
            adapter:    default
            alias:      default_filesystem

    stream_wrapper: ~
```

**Connect the Browser to the Filesystem**

```
rs_gaufrette_browser:
    filesystem: default_filesystem #the gaufrette filesystem alias to use
```

**The Full Config Reference**

```
rs_gaufrette_browser:
    file_pattern:    "/\.(jpg|gif|jpeg|png)$/"    # a valid regular expression to filter for file-extensions
    filesystem:      default_filesystem           # the gaufrette filesystem alias to use
    file_class:      Your\File\Class              # should extend rs\GaufretteBrowserBundle\Entity\File
    directory_class: Your\Directory\Class         # should extend rs\GaufretteBrowserBundle\Entity\Directory
```

Usage
-----

[](#usage)

Goto  and browse the filesystem

**Querying for Directories or Files**

Using the Repository Implementations:

```
$this->get('rs_gaufrette_browser.repository.directory')->findBy(array('prefix'=>'/foo')); #only search folders that starts with /foo
$this->get('rs_gaufrette_browser.repository.file')->findBy(array('suffix'=>'/\.xls/')); #only search .xls files
$this->get('rs_gaufrette_browser.repository.file')->find('/foo/bar.png'); #find one file
$this->get('rs_gaufrette_browser.repository.file')->findOneBy(array('prefix'=>'/foo', 'suffix' => '/\.xls/')); #find one file named /foo/*.xls
```

**Using the ParamConverters**

Using ParamConverters for `Directory` and `File` is quiet simple:

```
/**
 * @ParamConverter("folder", class="rs\GaufretteBrowserBundle\Entity\Directory", options={"id" = "slug"})
 */
public function myCustomDirectoryAction(Request $request, Directory $folder){}

/**
 * @ParamConverter("file", class="rs\GaufretteBrowserBundle\Entity\File", options={"id" = "slug"})
 */
public function myCustomFileAction(Request $request, File $file){}
```

**Hooking into Events**

Everything inside the Controller-Actions is build up with Events.

**The following Events exists**

```
final class GaufretteBrowserEvents
{
    const DIRECTORY_SHOW = 'gaufrette.directory.show';
    const DIRECTORY_INDEX = 'gaufrette.directory.index';

    const FILE_SHOW = 'gaufrette.file.show';
    const FILE_INDEX = 'gaufrette.file.index';
}
```

**Hook your own Functionality into default Controllers**

implement the Subscriber

```
class MyEventSubscriber implements EventSubscriberInterface
{
    public static function getSubscribedEvents()
    {
        return array(
            GaufretteBrowserEvents::DIRECTORY_INDEX => 'myCustomAction'
        );
    }

    public function myCustomAction(DirectoryControllerEvent $event)
    {
        $event->addDirectory($myCustomDirectory);
        $event->removeDirectory($unwantedDirectory);

        $event->addTemplateData('myCustomVar', 'foobar');
    }
}
```

and TAG the Service

```

```

Tests
-----

[](#tests)

everything is well unit tested:

```
phpunit
```

view builds on Travis:

TODO
----

[](#todo)

- better Tree Initialization of Directories (maybe )
- Javascript-Tree to Browse Files more sophisticated (maybe )
- better File Detail Pages
- functional Tests
- allow more gaufrette-filesystem instances
- more powerful Repository Queries

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~79 days

Total

3

Last Release

4191d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c250d4625389526aaf66f599e8e85e684cff28788f71ea2412b2434739a3bffd?d=identicon)[digitalkaoz](/maintainers/digitalkaoz)

---

Top Contributors

[![digitalkaoz](https://avatars.githubusercontent.com/u/293591?v=4)](https://github.com/digitalkaoz "digitalkaoz (29 commits)")

---

Tags

filesystembrowsergaufrette

### Embed Badge

![Health badge](/badges/digitalkaoz-gaufrette-browser-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/digitalkaoz-gaufrette-browser-bundle/health.svg)](https://phpackages.com/packages/digitalkaoz-gaufrette-browser-bundle)
```

###  Alternatives

[league/flysystem

File storage abstraction for PHP

13.6k639.1M2.1k](/packages/league-flysystem)[league/flysystem-aws-s3-v3

AWS S3 filesystem adapter for Flysystem.

1.6k263.6M788](/packages/league-flysystem-aws-s3-v3)[knplabs/gaufrette

PHP library that provides a filesystem abstraction layer

2.5k39.8M123](/packages/knplabs-gaufrette)[knplabs/knp-gaufrette-bundle

Allows to easily use the Gaufrette library in a Symfony project

72528.6M91](/packages/knplabs-knp-gaufrette-bundle)[league/flysystem-local

Local filesystem adapter for Flysystem.

226231.8M39](/packages/league-flysystem-local)[oneup/flysystem-bundle

Integrates Flysystem filesystem abstraction library to your Symfony project.

64422.9M66](/packages/oneup-flysystem-bundle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
