Ratings | | Unique User Downloads | | Download Rankings |
Not yet rated by the users | | Total: 95 | | All time: 9,868 This week: 59 |
|
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. | |
|
|
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
Flysystem wrapper which allow you to storage file and styling images
Preview
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
|
Applications that use this package |
|
No pages of applications that use this class were specified.
If you know an application of this package, send a message to the author to add a link here.