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,868 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  
Name: Slawomir Kaleta <contact>
Classes: 16 packages by
Country: Poland Poland
Age: ???
All time rank: 230953 in Poland Poland
Week rank: 49 Up1 in Poland Poland Up
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

  Files folder image Files (34)  /  examples  
File Role Description
Files folder imageexample1 (2 files, 1 directory)
Files folder imageexample2 (2 files, 3 directories)

  Files folder image Files (34)  /  examples  /  example1  
File Role Description
Files folder imageapp (3 directories)
  Accessible without login Plain text file README.md Doc. Read me
  Accessible without login Plain text file tables.sql Data Auxiliary data

  Files folder image Files (34)  /  examples  /  example1  /  app  
File Role Description
Files folder imageConfig (2 files)
Files folder imageLibs (1 directory)
Files folder imageModel (1 directory)

  Files folder image Files (34)  /  examples  /  example1  /  app  /  Config  
File Role Description
  Accessible without login Plain text file fileStorage.php Example Example script
  Accessible without login Plain text file router.php Aux. Auxiliary script

  Files folder image Files (34)  /  examples  /  example1  /  app  /  Libs  
File Role Description
Files folder imagePlugins (1 directory)

  Files folder image Files (34)  /  examples  /  example1  /  app  /  Libs  /  Plugins  
File Role Description
Files folder imageFileStorage (1 file, 1 directory)

  Files folder image Files (34)  /  examples  /  example1  /  app  /  Libs  /  Plugins  /  FileStorage  
File Role Description
Files folder imageStylists (4 files)
  Plain text file MetadataFile.php Class Class source

  Files folder image Files (34)  /  examples  /  example1  /  app  /  Libs  /  Plugins  /  FileStorage  /  Stylists  
File Role Description
  Plain text file OriginalStylist.php Class Class source
  Plain text file RealStylist.php Class Class source
  Plain text file RectStylist.php Class Class source
  Plain text file SquareStylist.php Class Class source

  Files folder image Files (34)  /  examples  /  example1  /  app  /  Model  
File Role Description
Files folder imageFileStorage (1 directory)

  Files folder image Files (34)  /  examples  /  example1  /  app  /  Model  /  FileStorage  
File Role Description
Files folder imageDrivers (1 file)

  Files folder image Files (34)  /  examples  /  example1  /  app  /  Model  /  FileStorage  /  Drivers  
File Role Description
  Plain text file DatabaseDriver.php Class Class source

  Files folder image Files (34)  /  examples  /  example2  
File Role Description
Files folder imageConfig (1 file)
Files folder imageStylists (3 files)
Files folder imageuploads (2 files)
  Accessible without login Plain text file README.md Data Read me
  Plain text file stylist.php Class Class source

  Files folder image Files (34)  /  examples  /  example2  /  Config  
File Role Description
  Accessible without login Plain text file fileStorage.php Example Example script

  Files folder image Files (34)  /  examples  /  example2  /  Stylists  
File Role Description
  Plain text file OriginalStylist.php Class Class source
  Plain text file RectStylist.php Class Class source
  Plain text file SquareStylist.php Class Class source

  Files folder image Files (34)  /  examples  /  example2  /  uploads  
File Role Description
  Accessible without login Image file noImage.png Data Auxiliary data
  Accessible without login Image file picture1.jpg Data Auxiliary data

  Files folder image Files (34)  /  src  
File Role Description
Files folder imageDrivers (1 file)
Files folder imageStylist (1 file)
  Plain text file Image.php Class Class source
  Plain text file Storage.php Class Class source
  Plain text file Stylist.php Class Class source

  Files folder image Files (34)  /  src  /  Drivers  
File Role Description
  Plain text file DatabaseDriverInterface.php Class Class source

  Files folder image Files (34)  /  src  /  Stylist  
File Role Description
  Plain text file SimpleStylist.php Class Class source

  Files folder image Files (34)  /  tests  
File Role Description
  Accessible without login Plain text file Bootstrap.php Example Example script
  Plain text file FakeDriver.php Class Class source
  Accessible without login Plain text file file.txt Doc. Documentation
  Plain text file FileTest.php Class Class source
  Plain text file SetupTest.php Class Class source

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,868
This week:59Up