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

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

partnermarketing/file-system-bundle
===================================

A file system component supporting different file storage adapters.

3.0.3(9y ago)19.0k6[6 issues](https://github.com/partnermarketing/FileSystemBundle/issues)Apache-2.0PHPPHP &gt;=5.4.0

Since Nov 30Pushed 4y ago15 watchersCompare

[ Source](https://github.com/partnermarketing/FileSystemBundle)[ Packagist](https://packagist.org/packages/partnermarketing/file-system-bundle)[ Docs](https://github.com/partnermarketing/PartnermarketingFileSystemBundle)[ RSS](/packages/partnermarketing-file-system-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (6)Dependencies (5)Versions (15)Used By (0)

FileSystemBundle
================

[](#filesystembundle)

[![Build Status](https://camo.githubusercontent.com/5b0fdf1f747994ab65361cc0eb3fb09cd796a434c0ec721d596ae3aa3f6bf678/68747470733a2f2f7472617669732d63692e6f72672f706172746e65726d61726b6574696e672f506172746e65726d61726b6574696e6746696c6553797374656d42756e646c652e737667)](https://travis-ci.org/partnermarketing/PartnermarketingFileSystemBundle)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/8aa4a6f76da5fd3cf8356b31d20a7a6a0097aa2587a8bf81ffb531d72bc1870b/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f706172746e65726d61726b6574696e672f506172746e65726d61726b6574696e6746696c6553797374656d42756e646c652f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/partnermarketing/PartnermarketingFileSystemBundle/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/bc4d266d188179b1376053b780546a147ae160b8eecb1032660623e7a7fd8a43/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f706172746e65726d61726b6574696e672f506172746e65726d61726b6574696e6746696c6553797374656d42756e646c652f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/partnermarketing/PartnermarketingFileSystemBundle/?branch=master)[![HHVM Status](https://camo.githubusercontent.com/75236494911df56f091d84111bcbf902ea4bf2647475fd2ae59bbecdcdeef941/687474703a2f2f6868766d2e683463632e64652f62616467652f706172746e65726d61726b6574696e672f66696c652d73797374656d2d62756e646c652e737667)](http://hhvm.h4cc.de/package/partnermarketing/file-system-bundle)

FileSystemBundle is a file system component supporting different file storage adapters.

Adapters:
---------

[](#adapters)

### Local storage

[](#local-storage)

This adapter was made to be used when you want to interact with your local file system.

Config example:

```
    partnermarketing_file_system.default_file_system: local_storage
    partnermarketing_file_system.config:
        local_storage:
            path: /path/to/test/directory
            url: 'http://your-project-url.dev/test'
```

### Amazon S3

[](#amazon-s3)

This adapter was made to be used when you want to interactive with Amazon S3 file system.

Config example:

```
    partnermarketing_file_system.default_file_system: amazon_s3
    partnermarketing_file_system.config:
        amazon_s3:
            key:    your-amazon-key
            secret: your-amazon-secret
            bucket: your-bucket-name
            region: eu-west-1
            acl:    public-read # Optional parameter.
```

How to use
----------

[](#how-to-use)

### Configuration

[](#configuration)

First step is to pass the factory into where you need to use it.

```
# In your services.yml
    YourServiceName:
        class: Your\Namespace\Path\ServiceName
        arguments:
            fileSystemFactory:  @partnermarketing_file_system.factory
```

Then in your ServiceName.php file you can use the factory as you need.

```
namespace Your\Namespace\Path;

use Partnermarketing\FileSystemBundle\Factory\FileSystemFactory;

class ServiceName
{
    private $fileSystem;

    public function __construct(FileSystemFactory $fileSystemFactory)
    {
        // This will build a fileSystem based on configs specified.
        $this->filesystem = $fileSystemFactory->build();
    }
}
```

### Read a file content

[](#read-a-file-content)

```
$this->filesystem->read($varWithFilePath);
```

### Write content from a file to other

[](#write-content-from-a-file-to-other)

```
// Writes the content of the $source into the $path returns the URL.
$url = $this->filesystem->write($path, $source);
```

### Write content into a file

[](#write-content-into-a-file)

```
// Writes the $content into the $path returns the URL:
$url = $this->filesystem->writeContent($path, $content);
```

### Delete a file

[](#delete-a-file)

```
// Deletes the file $path:
$isDeleted = $this->filesystem->delete($path);
```

### Rename a file

[](#rename-a-file)

```
$isRenamed = $this->filesystem->rename($sourcePath, $targetPath);
```

### Get files from directory

[](#get-files-from-directory)

```
// Returns an array of files under given directory.
$filesArray = $this->filesystem->getFiles($directory = '');
```

### Copy files from one directory to another

[](#copy-files-from-one-directory-to-another)

```
// Copies all files under given source directory to given target directory.
$filesArray = $this->filesystem->copyFiles($sourceDir, $targetDir);
```

### Check if a file exist

[](#check-if-a-file-exist)

```
$fileExists = $this->filesystem->exists($varWithFilePath);
```

### Check if path is a directory

[](#check-if-path-is-a-directory)

```
$isDirectory = $this->filesystem->isDirectory($varWithFilePath);
```

### Gets the Absolute URL to a file

[](#gets-the-absolute-url-to-a-file)

```
$absoluteFileUrl = $this->filesystem->getURL($path);
```

### Copy file to temporary directory

[](#copy-file-to-temporary-directory)

```
// Copy a file to the local temporary directory, and return the full path.
$temporaryFilePath = $this->filesystem->copyToLocalTemporaryFile($path);
```

How to contribute
-----------------

[](#how-to-contribute)

You can add more adapters or improve the existing ones.

Create a pull request and please add tests if you fix a bug or added new functionality.

Report founded issues here:

###  Health Score

30

—

LowBetter than 65% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community22

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~189 days

Recently: every ~371 days

Total

13

Last Release

1902d ago

Major Versions

0.2.2 → 1.0.02015-04-14

0.2.3 → 1.2.02015-11-20

1.2.1 → 2.1.02017-01-29

2.1.0 → 3.0.02017-01-29

### Community

Maintainers

![](https://www.gravatar.com/avatar/3fa98f21fa54787b348d88f229aa589adaab11bf99ca34c7c933103212d8d044?d=identicon)[partnermarketing](/maintainers/partnermarketing)

---

Top Contributors

[![BernardoSilva](https://avatars.githubusercontent.com/u/1537510?v=4)](https://github.com/BernardoSilva "BernardoSilva (29 commits)")[![amyboyd](https://avatars.githubusercontent.com/u/398210?v=4)](https://github.com/amyboyd "amyboyd (20 commits)")[![EmilyShepherd](https://avatars.githubusercontent.com/u/2132420?v=4)](https://github.com/EmilyShepherd "EmilyShepherd (16 commits)")[![zsturgess](https://avatars.githubusercontent.com/u/3624596?v=4)](https://github.com/zsturgess "zsturgess (9 commits)")[![maxim-mamonov](https://avatars.githubusercontent.com/u/1164663?v=4)](https://github.com/maxim-mamonov "maxim-mamonov (2 commits)")[![hetmansky](https://avatars.githubusercontent.com/u/8969321?v=4)](https://github.com/hetmansky "hetmansky (1 commits)")[![MatthewCane](https://avatars.githubusercontent.com/u/39704070?v=4)](https://github.com/MatthewCane "MatthewCane (1 commits)")[![waffle-iron](https://avatars.githubusercontent.com/u/6912981?v=4)](https://github.com/waffle-iron "waffle-iron (1 commits)")[![antonvas](https://avatars.githubusercontent.com/u/2622169?v=4)](https://github.com/antonvas "antonvas (1 commits)")

---

Tags

php

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[aws/aws-sdk-php

AWS SDK for PHP - Use Amazon Web Services in your PHP project

6.3k511.3M2.2k](/packages/aws-aws-sdk-php)[league/flysystem-aws-s3-v3

AWS S3 filesystem adapter for Flysystem.

1.6k263.6M788](/packages/league-flysystem-aws-s3-v3)[aws/aws-sdk-php-laravel

A simple Laravel 9/10/11/12/13 service provider for including the AWS SDK for PHP.

1.7k35.6M75](/packages/aws-aws-sdk-php-laravel)[humanmade/s3-uploads

WordPress plugin to store uploads on S3

2.1k2.4M9](/packages/humanmade-s3-uploads)[terminal42/contao-fineuploader

FineUploader bundle for Contao Open Source CMS

2052.9k4](/packages/terminal42-contao-fineuploader)[mreduar/s3m

Multipart Uploads using Laravel and AWS S3

173.6k](/packages/mreduar-s3m)

PHPackages © 2026

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