From 601471be9e22470c1179de36a8febe488cd3e7d3 Mon Sep 17 00:00:00 2001 From: Taylor Dondich Date: Thu, 27 Jul 2017 14:13:04 -0700 Subject: [PATCH] Add support for caching to filesystem. Set phpunit default cache driver to array. --- bootstrap/app.php | 3 ++ config/app.php | 1 + config/filesystems.php | 68 ++++++++++++++++++++++++++++++++++++++++++ phpunit.xml | 2 +- 4 files changed, 73 insertions(+), 1 deletion(-) create mode 100644 config/filesystems.php diff --git a/bootstrap/app.php b/bootstrap/app.php index 8cbca3487..7833d2fa6 100644 --- a/bootstrap/app.php +++ b/bootstrap/app.php @@ -15,6 +15,9 @@ $app = new Illuminate\Foundation\Application( realpath(__DIR__.'/../') ); +// Change storage path +$app->useStoragePath(realpath(__DIR__.'/../shared/')); + /* |-------------------------------------------------------------------------- | Bind Important Interfaces diff --git a/config/app.php b/config/app.php index e8a47d79e..4c4ffe79c 100644 --- a/config/app.php +++ b/config/app.php @@ -8,6 +8,7 @@ return [ 'log_level' => env('APP_LOG_LEVEL', 'debug'), 'providers' => [ + Illuminate\Filesystem\FilesystemServiceProvider::class, Illuminate\Cache\CacheServiceProvider::class, Illuminate\View\ViewServiceProvider::class, ], diff --git a/config/filesystems.php b/config/filesystems.php new file mode 100644 index 000000000..d215e5abd --- /dev/null +++ b/config/filesystems.php @@ -0,0 +1,68 @@ + env('FILESYSTEM_DRIVER', 'local'), + + /* + |-------------------------------------------------------------------------- + | Default Cloud Filesystem Disk + |-------------------------------------------------------------------------- + | + | Many applications store files both locally and in the cloud. For this + | reason, you may specify a default "cloud" driver here. This driver + | will be bound as the Cloud disk implementation in the container. + | + */ + + 'cloud' => env('FILESYSTEM_CLOUD', 's3'), + + /* + |-------------------------------------------------------------------------- + | Filesystem Disks + |-------------------------------------------------------------------------- + | + | Here you may configure as many filesystem "disks" as you wish, and you + | may even configure multiple disks of the same driver. Defaults have + | been setup for each driver as an example of the required options. + | + | Supported Drivers: "local", "ftp", "s3", "rackspace" + | + */ + + 'disks' => [ + + 'local' => [ + 'driver' => 'local', + 'root' => storage_path('app'), + ], + + 'public' => [ + 'driver' => 'local', + 'root' => storage_path('app/public'), + 'url' => env('APP_URL').'/storage', + 'visibility' => 'public', + ], + + 's3' => [ + 'driver' => 's3', + 'key' => env('AWS_KEY'), + 'secret' => env('AWS_SECRET'), + 'region' => env('AWS_REGION'), + 'bucket' => env('AWS_BUCKET'), + ], + + ], + +]; \ No newline at end of file diff --git a/phpunit.xml b/phpunit.xml index cef50b8d2..9c17751f9 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -24,6 +24,6 @@ - +