2017 © Pedro Peláez
 

library filesystem

Filesystem abstraction layer

image

innmind/filesystem

Filesystem abstraction layer

  • Saturday, April 14, 2018
  • by Baptouuuu
  • Repository
  • 1 Watchers
  • 2 Stars
  • 2,304 Installations
  • PHP
  • 13 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 19 Versions
  • 7 % Grown

The README.md

Filesystem

Build Status codecov Type Coverage, (*1)

Filesystem abstraction layer, the goal is to provide a model where you design how you put your files into directories without worrying where it will be persisted., (*2)

Documentation, (*3)

Installation

composer install innmind/filesystem

Usage

The whole model is structured around files, directories, contents and adapters. File, Directory and Content are immutable objects., (*4)

Example:, (*5)

use Innmind\Filesystem\{
    File,
    File\Content,
    Directory,
    Adapter\Filesystem,
};
use Innmind\Url\Path;

$directory = Directory::named('uploads')->add(
    File::named(
        $_FILES['my_upload']['name'],
        Content::ofString(\file_get_contents($_FILES['my_upload']['tmp_name'])),
    ),
);
$adapter = Filesystem::mount(Path::of('/var/www/web/'));
$adapter->add($directory);

This example show you how you can create a new directory uploads in the folder /var/www/web/ of your filesystem and create the uploaded file into it., (*6)

Note: For performance reasons the filesystem adapter only persist to disk the files that have changed (achievable via the immutable nature of file objects)., (*7)

All adapters implements Adapter, so you can easily replace them; especially for unit tests, that's why the library comes with an InMemory adapter that only keeps the files into memory so you won't mess up your file system., (*8)

The Versions

18/06 2016
29/05 2016

1.1.2

1.1.2.0 http://github.com/Innmind/filesystem

Filesystem abstraction layer

  Sources   Download

MIT

The Requires

 

filesystem

04/05 2016

1.1.1

1.1.1.0 http://github.com/Innmind/filesystem

Filesystem abstraction layer

  Sources   Download

MIT

The Requires

 

filesystem

19/04 2016

1.1.0

1.1.0.0 http://github.com/Innmind/filesystem

Filesystem abstraction layer

  Sources   Download

MIT

The Requires

 

filesystem

01/04 2016

1.0.0

1.0.0.0 http://github.com/Innmind/filesystem

Filesystem abstraction layer

  Sources   Download

MIT

The Requires

 

filesystem