PHPackages                             josbeir/cakephp-filesystem - 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. josbeir/cakephp-filesystem

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

josbeir/cakephp-filesystem
==========================

Filesystem plugin for CakePHP 4.0+

3.0.2(3y ago)2012.4k10[3 issues](https://github.com/josbeir/cakephp-filesystem/issues)[1 PRs](https://github.com/josbeir/cakephp-filesystem/pulls)MITPHPPHP ^8.0.2

Since Jun 6Pushed 2y ago5 watchersCompare

[ Source](https://github.com/josbeir/cakephp-filesystem)[ Packagist](https://packagist.org/packages/josbeir/cakephp-filesystem)[ RSS](/packages/josbeir-cakephp-filesystem/feed)WikiDiscussions 3.0 Synced 1mo ago

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

[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.txt)[![Build Status](https://camo.githubusercontent.com/907d84e913db798a43044441f6e8b6b1cf6c3078741b87590b09cd687f5d626a/68747470733a2f2f7472617669732d63692e6f72672f6a6f73626569722f63616b657068702d66696c6573797374656d2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/josbeir/cakephp-filesystem)[![codecov](https://camo.githubusercontent.com/d9d71dcf2789517463581b030893e49d9e6182dbdb26248f40dbafba96b38eb2/68747470733a2f2f636f6465636f762e696f2f67682f6a6f73626569722f63616b657068702d66696c6573797374656d2f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/josbeir/cakephp-filesystem)[![Latest Stable Version](https://camo.githubusercontent.com/df0a0abc18be08640e7958cd86e1061fadea3840e83b4b08f391860c1f476750/68747470733a2f2f706f7365722e707567782e6f72672f6a6f73626569722f63616b657068702d66696c6573797374656d2f762f737461626c65)](https://packagist.org/packages/josbeir/cakephp-filesystem)[![Total Downloads](https://camo.githubusercontent.com/afabb17326e87c04798a135cb57ee4aef7882d8336cde3741f45048c3f3b9bbc/68747470733a2f2f706f7365722e707567782e6f72672f6a6f73626569722f63616b657068702d66696c6573797374656d2f646f776e6c6f616473)](https://packagist.org/packages/josbeir/cakephp-filesystem)

Filesystem plugin for CakePHP
=============================

[](#filesystem-plugin-for-cakephp)

CakePHP filesystem plugin using [Flysystem](http://flysystem.thephpleague.com/docs/) as it's backend.

- [Filesystem plugin for CakePHP](#filesystem-plugin-for-cakephp)
    - [Why](#why)
    - [Requirements](#requirements)
    - [Installation](#installation)
    - [Configuration](#configuration)
    - [Simple upload example](#simple-upload-example)
        - [Result](#result)
    - [Entity properties](#entity-properties)
    - [Recreating entities](#recreating-entities)
    - [Using your own entities](#using-your-own-entities)
        - [Example on using Cake ORM entities instead of the built entity class](#example-on-using-cake-orm-entities-instead-of-the-built-entity-class)
    - [Formatters](#formatters)
        - [Setting up formatters](#setting-up-formatters)
        - [Creating a custom formatter class](#creating-a-custom-formatter-class)
            - [Example custom formatter](#example-custom-formatter)
            - [Using the custom formatter class in your application](#using-the-custom-formatter-class-in-your-application)
    - [Methods](#methods)
    - [Events](#events)
    - [Extras](#extras)
        - [Changing the hashing algorithm used in entities](#changing-the-hashing-algorithm-used-in-entities)
        - [Accessing the Flysytem object](#accessing-the-flysytem-object)
    - [Contribute](#contribute)

Why
---

[](#why)

- Easy access to Flysystem filesystems in your application
- Upload normalization, accepts $\_FILES, Zend\\Diactoros\\UploadedFile or just a path on the local FS
- Files are represented by customisable and json serialisable entities, Multiple files are returned in a custom [Collection](https://book.cakephp.org/3.0/en/core-libraries/collections.html) instance.
- A trait is available, use it everywhere in your app
- Customizable path/filename formatting during upload, custom formatters are possible, ships with a Default and EntityFormatter.

Requirements
------------

[](#requirements)

- CakePHP 4.x
- PHP 7.2

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

[](#installation)

You can install this plugin into your CakePHP application using [composer](http://getcomposer.org).

The recommended way to install composer packages is:

```
composer require josbeir/cakephp-filesystem

```

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

[](#configuration)

A filesystem configuration array should be available in your Configure instance. You can create a config/filesystems.php file with following content Make sure to load the file in your bootstrap.php using `Configure::load('filesystems', 'default');`.

The configuration options defined for each 'filestem' are passed directly to the Filesystem.php class. A `default` configuration must be set when using FilesystemAwareTrait / FilesystemRegistry classes

```
