2017 © Pedro Peláez
 

contao-module contao-flysystem

This integrates the flysystem filesystem abstraction into Contao

image

netzmacht/contao-flysystem

This integrates the flysystem filesystem abstraction into Contao

  • Friday, November 13, 2015
  • by netzmacht
  • Repository
  • 1 Watchers
  • 1 Stars
  • 15 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Contao Flysystem integration

Build Status Version License Downloads Contao Community Alliance coding standard, (*1)

This library integrates the flysystem filesystem abstraction into Contao., (*2)

It provides a fully configured filesystem service for TL_ROOT and an adapter for the Dbafs of Contao!, (*3)

Install

You can install this library using Composer. It requires at least PHP 5.4 and Contao 3.2., (*4)

$ php composer.phar require netzmacht/contao-flysystem:~1.0

Features

  • Filesystem abstraction for whole Contao installation
  • Dbafs adapter
  • Metadata caching

Usage

Access to the mount manager and the default file system

<?php

// First get the mount manager to get the file system.
$manager    = $GLOBALS['container']['flysystem.mount-manager'];
$fileSystem = $manager->getFilesystem('local');

// Alternatively use the FlysystemTrait
class MyContentElement
{
   use Netzmacht\Contao\Flysystem\Integration\FlysystemTrait;

   protected function compile()
   {
      $fileSystem = $this->getMountManager()->getFilesystem('local');
   }
}

Dbafs file system

For the dbafs filesystem exists an separate filesystem adapter. It allows to fetch files by path or uuid. The meta data is enriched with model details id, uuid, hash, meta, importantPart., (*5)

It keeps the dbafs in sync when performing file system actions., (*6)

<?php

$manager    = $GLOBALS['container']['flysystem.mount-manager'];
$fileSystem = $manager->getFilesystem('dbafs');

// Get file path.
$metadata = $fileSystem->getMetadata('files/path/to/file');

// Get file by binary uuid.
$metadata = $fileSystem->getMetadata($this->multiSRC);

// Get file by binary uuid.
$metadata = $fileSystem->getMetadata(\String::binToUuid($this->multiSRC));

Note: You have to prepend the file path with the upload path as this is the Contao standard. If you try to access a file out of the upload path scope you'll get an RootViolationException., (*7)

The Versions

13/11 2015

dev-develop

dev-develop

This integrates the flysystem filesystem abstraction into Contao

  Sources   Download

LGPL-3.0+

The Requires

 

The Development Requires

filesystem abstraction contao filesystems flysyste

26/09 2015

dev-master

9999999-dev

This integrates the flysystem filesystem abstraction into Contao

  Sources   Download

LGPL-3.0+

The Requires

 

The Development Requires

filesystem abstraction contao filesystems flysyste

26/09 2015

1.0.0-beta1

1.0.0.0-beta1

This integrates the flysystem filesystem abstraction into Contao

  Sources   Download

LGPL-3.0+

The Requires

 

The Development Requires

filesystem abstraction contao filesystems flysyste