File: examples/example2/Config/fileStorage.php

Recommend this page to a friend!
  Classes of Slawomir Kaleta  >  Dframe File Storage  >  examples/example2/Config/fileStorage.php  >  Download  
File: examples/example2/Config/fileStorage.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Dframe File Storage
Store and retrieve files in a database
Author: By
Last change:
Date: 1 year ago
Size: 1,241 bytes
 

Contents

Class file image Download
<?php
use League\Flysystem\Filesystem;
use
League\Flysystem\Adapter\Local;

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

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

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


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

return [
   
'pluginsDir' => dirname(__DIR__) . '/',
   
'adapters' => [
       
'local' => $local,
       
'cache' => $cache,
       
'web' => $web
   
]
];


For more information send a message to info at phpclasses dot org.