PHPackages                             kitpages/file-system-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. kitpages/file-system-bundle

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

kitpages/file-system-bundle
===========================

Symfony Kitpages FileSystem Bundle. Abstraction layer for files (local, S3)

v4.0.0(7y ago)1245.4k↓100%4[1 issues](https://github.com/kitpages/KitpagesFileSystemBundle/issues)2BSDPHPPHP &gt;=5.6|&gt;=7.0

Since Oct 1Pushed 7y ago7 watchersCompare

[ Source](https://github.com/kitpages/KitpagesFileSystemBundle)[ Packagist](https://packagist.org/packages/kitpages/file-system-bundle)[ Docs](https://github.com/kitpages/KitpagesFileSystemBundle)[ RSS](/packages/kitpages-file-system-bundle/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (4)Versions (18)Used By (2)

KitpagesFileSystemBundle
========================

[](#kitpagesfilesystembundle)

This is a Symfony2 bundle that provides a filesystem abstraction layer. Basicaly this does the same as the gaufrette library from KnpLabs, but it manages much more efficiently big files. We can manage a 2GB file with a memory limit of 128Mo for the PHP process. We never transfert the entire content in a $content variable.

With this bundle you can save your files on different filesystems (S3, Local filesystem, FTP,...)

Some elements of the configuration system are based on the code of the KnpGaufretteBundle.

Versions
========

[](#versions)

2019-01-23 : v4.0.0

- \[new\] upgrade to Symfony 2.8, 3.x, 4.x
- \[doc\] best doc for tests

2018-05-16 : v3.2.1

- \[fix\] url of the file in the flysystem system for swift
- \[fix\] fix pb when the file doesn't exist in flysystem adapter
- \[fix\] fix mime type problem in flysystem adapter

2018-05-15 : v3.2.0

- \[new\] integration with flysystem

Lot of doc is missing here...

2012-05-24 : v1.0.0

- first stable release

Actual state
============

[](#actual-state)

This bundle is stable. The adapters are :

- Local adapter : file system of the server
- S3 adapter : for Amazon Web Service AWS S3
- FTP adapter : for FTP access
- FlySystem adapater : for a link to flysystem

Installation
============

[](#installation)

You need to add the following lines in your deps :

Using [Composer](http://getcomposer.org/), just `$ composer require kitpages/file-system-bundle` package or:

```
{
  "require": {
    "kitpages/file-system-bundle": "dev-master"
  }
}
```

Only if you use AmazonS3

```
{
  "require": {
    amazonwebservices/aws-sdk-for-php: ~1.5
  }
}
```

Only if you use Flysystem

```
{
  "require": {
    "league/flysystem": "^1.0",
    "oneup/flysystem-bundle": "^1.14",
  }
}
```

AppKernel.php

```
$bundles = array(
    ...
    new Kitpages\FileSystemBundle\KitpagesFileSystemBundle(),
);
```

// AWS SDK needs a special autoloader

```
require_once __DIR__.'/../vendor/aws-sdk/sdk.class.php';
```

Configuration example
=====================

[](#configuration-example)

The following configuration defines 3 filesystems :

- kitpagesFile : a local filesystem
- kitpagesAmazon : a filesystem on Amazon S3
- kitpagesFlysystem : another filesystem abstraction

Let's see the configuration in config.yml

```
kitpages_file_system:
    file_system_list:
        kitpagesFile:
            local:
                directory_public: %kernel.root_dir%/../web
                directory_private: %kernel.root_dir%
                base_url: %base_url%
        kitpagesAmazon:
            amazon_s3:
                bucket_name: %kitpagesFile_amazons3_bucketname%
                key: %kitpagesFile_amazons3_key%
                secret_key: %kitpagesFile_amazons3_secretkey%
        kitpagesFlysystem:
            flysystem:
                flysystem_adapter: oneup_flysystem.your_filesystem
                file_uri_prefix: https://your.custom.url/4687311687643/FRA/
```

Usage example
=============

[](#usage-example)

```
// use AdapterFile at the beginning of the file
use Kitpages\FileSystemBundle\Model\AdapterFile;

// get the adapter
$localAdapter = $this->get("kitpages_file_system.file_system.kitpagesFile");
$s3Adapter = $this->get("kitpages_file_system.file_system.kitpagesAmazon");

// private files (without direct public URL)
$adapter->copyTempToAdapter("/my_physical_dir/foo.txt", new AdapterFile("bar/foo.txt") );
$adapter->copyAdapterToTemp(new AdapterFile("bar/foo.txt"), "/my_physical_dir/foo.txt" );

// public files (with a direct URL given by the adapter)
$adapter->copyTempToAdapter("/my_physical_dir/foo.txt", new AdapterFile("bar/foo.txt", true) );
$url = $adapter->getFileLocation(new AdapterFile("bar/foo.txt", true));

// some functions of the adapter :
$adapterFile = new AdapterFile("bar/foo.txt");
$adapter->copyTempToAdapter("/my_physical_dir/foo.txt", $adapterFile );
$content = $adapter->getFileContent($adapterFile);
$adapter->sendFileToBrowser($adapterFile);
if ($adapter->isFile($adapterFile) ) {
    // if file exists in the adapter
}
```

Run the tests
-------------

[](#run-the-tests)

```
cd Tests/app/web
php -S localhost:8888
```

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity35

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 95.8% 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 ~144 days

Recently: every ~489 days

Total

17

Last Release

2669d ago

Major Versions

2.1.x-dev → v3.0.02013-06-04

v3.2.1 → v4.0.02019-01-23

PHP version history (2 changes)2.0.x-devPHP &gt;=5.3.2

v4.0.0PHP &gt;=5.6|&gt;=7.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/95c1423b83010cc8afd1fc966d26cc6fc5d7fb5d000e5d7582adcd8392bd239c?d=identicon)[kitpages](/maintainers/kitpages)

---

Top Contributors

[![philippe-levan](https://avatars.githubusercontent.com/u/393066?v=4)](https://github.com/philippe-levan "philippe-levan (23 commits)")[![FabienPapet](https://avatars.githubusercontent.com/u/1446265?v=4)](https://github.com/FabienPapet "FabienPapet (1 commits)")

---

Tags

filesystemgaufretteFile abstraction layer

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/kitpages-file-system-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/kitpages-file-system-bundle/health.svg)](https://phpackages.com/packages/kitpages-file-system-bundle)
```

###  Alternatives

[league/flysystem

File storage abstraction for PHP

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

AWS S3 filesystem adapter for Flysystem.

1.6k263.6M790](/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)[league/flysystem-bundle

Symfony bundle integrating Flysystem into Symfony applications

40029.5M87](/packages/league-flysystem-bundle)

PHPackages © 2026

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