PHP Classes

Dframe File Storage: Store and retrieve files in a database

Recommend this page to a friend!
     
  Info   Example   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 95 All time: 9,876 This week: 59Up
Version License PHP version Categories
filestorage 0.3.1Custom (specified...7Databases, Files and Folders, PHP 7
Description 

Author

This package can store and retrieve files in a storage container.

It abstracts the storage of binary files and provides an implementation that can store and retrieve the file data in the configured storage container.

The package provides a driver class that can store and retrieve the file data in a database.

Picture of Slawomir Kaleta
  Performance   Level  
Innovation award
Innovation award
Nominee: 3x

Winner: 1x

 

Example

<?php

use League\Flysystem\Adapter\Local;
use
League\Flysystem\Cached\CachedAdapter;
use
League\Flysystem\Cached\Storage\Memory as CacheStore;
use
League\Flysystem\Filesystem;

$localAdapter = new Local(
   
dirname(__DIR__) . '/../app/View/uploads',
   
LOCK_EX,
   
Local::DISALLOW_LINKS,
    [
       
'file' => [
           
'public' => 0744,
           
'private' => 0700,
        ],
       
'dir' => [
           
'public' => 0755,
           
'private' => 0700,
        ]
    ]
);

$webAdapter = new Local(
   
dirname(__DIR__) . '/../web',
   
LOCK_EX,
   
Local::DISALLOW_LINKS,
    [
       
'file' => [
           
'public' => 0744,
           
'private' => 0700,
        ],
       
'dir' => [
           
'public' => 0755,
           
'private' => 0700,
        ]
    ]
);

$cacheAdapter = new Local(
   
dirname(__DIR__) . '/../app/View/cache',
   
LOCK_EX,
   
Local::DISALLOW_LINKS,
    [
       
'file' => [
           
'public' => 0744,
           
'private' => 0700,
        ],
       
'dir' => [
           
'public' => 0755,
           
'private' => 0700,
        ]
    ]
);

// Create the cache store
$cacheStore = new CacheStore();
// Decorate the adapter
$adapter = new CachedAdapter($cacheAdapter, $cacheStore);
// And use that to create the file system
$cacheFilesystem = new Filesystem($adapter);


$local = new Filesystem($localAdapter);
$web = new Filesystem($webAdapter);

return [
   
'pluginsDir' => dirname(__DIR__) . '/',
   
'adapters' => [
       
'local' => $local,
       
'cache' => $cacheFilesystem,
       
'web' => $web
   
],
   
'cache' => [
       
'life' => 600 // in seconds
   
],
   
'publicUrls' => [
       
'local' => ''
   
]
];


Details

Dframe/FileStorage

Build Status Latest Stable Version Total Downloads Latest Unstable Version License

Flysystem wrapper which allow you to storage file and styling images

Preview

License

Installation

composer require dframe/filestorage

Simple usage

    $Storage->put('local', $_FILES['file']['tmp_name'], 'upload/picture1.jpg');
    $Storage->image('picture1.jpg')->stylist('Square')->size('250')->get();
    $Storage->image('picture1.jpg')->stylist('Rect')->size('250x550')->get();
    $Storage->image('fileNotExist.jpg', 'noImage.png')->stylist('Rect')->size('50x50')->get();
    $Storage->drop('local', 'upload/picture1.jpg');

Documentation available at https://dframeframework.com/en/docs/fileStorage/master/configuration

What's included?

* Image stylist * Storage files and information * Cache generator

Feature

* Text on images

Examples

For DframeFramework Example #1

Stalone Image Stylist Code PHP Example #2


  Files folder image Files (34)  
File Role Description
Files folder imageexamples (2 directories)
Files folder imagesrc (3 files, 2 directories)
Files folder imagetests (5 files)
Accessible without login Plain text file .travis.yml Data Auxiliary data
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file phpunit.xml Data Auxiliary data
Accessible without login Image file preview.jpg Data Auxiliary data
Accessible without login Plain text file README.md Doc. Documentation

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 100%
Total:95
This week:0
All time:9,876
This week:59Up