2017 © Pedro Peláez
 

lithium-library li3_filesystem

File management (file browser) for Lithium PHP framework

image

djordje/li3_filesystem

File management (file browser) for Lithium PHP framework

  • Saturday, July 20, 2013
  • by djordje
  • Repository
  • 1 Watchers
  • 1 Stars
  • 2 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

li3_filesystem - File management for the Lithium PHP framework

Latest Stable Version Build Status, (*1)

This library enable easy file operations in the Lithium PHP framework., (*2)

This is based on extracted and better organized logic from li3_filemanager withoud controllers and views. So you can use it in your app's or library to perform file operations. You can also make file browser on top of this library, or you can use li3_filemanager that will be basic file browser implementation on top of this library. You can extend this library to support your storage system by creating new adapter that should extend li3_filesystem\storage\filesystem\Source and implement all abstract methods defined in Source., (*3)

Installation

1a. You can install it trough composer:, (*4)

{
    "require": {
        "djordje/li3_filesystem": "dev-master"
    }
}

1b. Or you can clone git repo to any of your libraries dir:, (*5)

cd libraries
git clone git://github.com/djordje/li3_filesystem.git

2. Add it to your app's bootstrap/libraries.php file:, (*6)

// backend routes with default prefix `backend`
Libraries::add('li3_filesystem');

3. Define named location, (*7)

// Example that use Filesystem adapter to access img dir in app's webroot
li3_filesystem\storage\Locations::add('webroot_img', array(
    'adapter' => 'Filesystem',
    'url' => 'http://example.com/img/',
    'location' => LITHIUM_APP_PATH . '/webroot/img'
));

Included adapters

You define adapter with 'adapter' key passed to location's option array., (*8)

Filesystem

This is adapter that enable file operations on local file system. You will proabably use this adapter most of the time., (*9)

Oprion keys that will be used by this adapter, (*10)

  • 'location' - path to root of location eg. LITHIUM_APP_PATH . '/webroot/img'
  • 'url' - optional, pass absolute link to root of location eg. 'http://example.com/img/' and all files will concatonate path to this url and enable you to get $entity->url.

Create your own adapters

You can writte your own adapters to support your storage system, or change some logic., (*11)

Your adapter must be locateable by lithium\core\Libraries::locate('adapter.storage.filesystem'); and inherits from li3_filesystem\storage\filesystem\Source. Source abstract class has defined abstarct methods that all adapters must implement ls, mkdir, upload, copy, move, remove to enable proper functionality with base model li3_filesystem\storage\FS and filesystem entity li3_filesystem\storage\filesystem\Entity., (*12)

The Versions

20/07 2013

dev-master

9999999-dev https://github.com/djordje/li3_filesystem

File management (file browser) for Lithium PHP framework

  Sources   Download

BSD-3-Clause

The Requires

 

file php browser lithium li3 file management