PHPackages                             petrknap/php-splitfilesystem - 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. petrknap/php-splitfilesystem

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

petrknap/php-splitfilesystem
============================

Split Filesystem for PHP

v1.0.0-rc1(7y ago)0390MITPHPPHP &gt;=5.6

Since Apr 14Pushed 6y ago1 watchersCompare

[ Source](https://github.com/petrknap/php-splitfilesystem)[ Packagist](https://packagist.org/packages/petrknap/php-splitfilesystem)[ Docs](https://petrknap.github.io/docs/php-splitfilesystem.html)[ RSS](/packages/petrknap-php-splitfilesystem/feed)WikiDiscussions master Synced 2d ago

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

Split Filesystem for PHP
========================

[](#split-filesystem-for-php)

- [About resolved issue](#about-resolved-issue)
    - [Advantages](#advantages)
    - [Disadvantages](#disadvantages)
- [Usage of php-splitfilesystem](#usage-of-php-splitfilesystem)
    - [Standard usage](#standard-usage)
- [How to install](#how-to-install)

About resolved issue
--------------------

[](#about-resolved-issue)

> I need to use something where around 60,000 files with average size of 30kb are stored in a single directory (this is a requirement so can't simply break into sub-directories with smaller number of files).
>
> The files will be accessed randomly, but once created there will be no writes to the same filesystem. I'm currently using Ext3 but finding it very slow. Any suggestions?
>
> \-- [Filesystem large number of files in a single directory - bugmenot77, voretaq7](http://serverfault.com/q/43133)

This file storage solves this issue simply - it **creates virtual layer between file system and application**. Every path is converted into path which is composed from many directories which contains only small amount of sub-directories.

If you wish to store 1 000 000 files in single directory, this file storage converts paths and stores them in tree-structure. Every directory contains only small amount of directories and files (depends on configuration).

### Advantages

[](#advantages)

- Can store a huge amount of files in single directory
- Naturally protects files outside the storage
- Every user can has separated and isolated file storage
- Fully compatible and based on [League\\Flysystem](https://github.com/thephpleague/flysystem)

### Disadvantages

[](#disadvantages)

- Real file structure is not user-friendly

Usage of php-splitfilesystem
----------------------------

[](#usage-of-php-splitfilesystem)

### Standard usage

[](#standard-usage)

```
