wieni/wmcontroller_flysystem

A Flysystem cache storage for wieni/wmcontroller

1.0.1 2022-06-28 12:17 UTC

This package is auto-updated.

Last update: 2024-04-29 03:54:16 UTC


README

Latest Stable Version Total Downloads License

A Flysystem cache storage for wieni/wmcontroller

Installation

This package requires PHP 8.0 and Drupal 9 or higher. It can be installed using Composer:

 composer require wieni/wmcontroller_flysystem

To enable this cache storage, change the following container parameters:

parameters:
    wmcontroller.cache.storage: wmcontroller.cache.storage.flysystem

    # Backend storage responsible for keeping track of tags and cache entries
    wmcontroller.cache.flysystem.backend.storage: wmcontroller.cache.storage.mysql

    wmcontroller.cache.flysystem.scheme: wmcontrollerscheme
    wmcontroller.cache.flysystem.directory: wmcontroller

Make sure to also set the flysystem scheme in settings.php.

// settings.php

$settings['flysystem'] = [
    'wmcontrollerscheme' => [
        'driver' => 'local',
        'config' => [
            'root' => 'sites/default/cache',
            'public' => false,
        ],
        'serve_js' => true,
        'serve_css' => true,
    ],
];

// Or if you want to store your cache on S3
// This requires the drupal/flysystem_s3 module
$settings['flysystem'] = [
    'wmcontrollerscheme' => [
        'driver' => 's3',
        'config' => [
            'key' => $_ENV['S3_KEY'],
            'secret' => $_ENV['S3_SECRET'],
            'region' => $_ENV['S3_REGION'],
            'bucket' => $_ENV['S3_BUCKET'],
            'prefix' => $_ENV['S3_PREFIX'] ?? '',
            'cname' => $_ENV['S3_CNAME'] ?? '',
            'options' => [
                'ACL' => 'private',
            ],
            'protocol' => 'https',
            'public' => false,
        ],
        'cache' => false,
        'serve_js' => false,
        'serve_css' => false,
    ],
];

Changelog

All notable changes to this project will be documented in the CHANGELOG file.

Security

If you discover any security-related issues, please email security@wieni.be instead of using the issue tracker.

License

Distributed under the MIT License. See the LICENSE file for more information.