Giter VIP home page Giter VIP logo

drupal_flysystem's Introduction

Flysystem for Drupal

Flysystem is a filesystem abstraction which allows you to easily swap out a local filesystem for a remote one. Reducing technical debt and chance of vendor lock-in.

REQUIREMENTS

INSTALLATION

These are the steps you need to take in order to use this software. Order is important.

  1. Download and install flysystem's module and its dependencies.
  2. Install flysystem module.
  3. Enjoy.
cd /path/to/drupal/root
composer require drupal/flysystem
drush en flysystem

TROUBLESHOOTING

If you are having trouble with this module, check the status page at admin/reports/status. The status page runs all the Flysystem checks and provides useful error reporting.

CONFIGURATION

Stream wrappers are configured in settings.php.

The keys (local-example below) are the names of the stream wrappers.

For example: 'local-example://filename.txt'.

Stream wrapper names cannot contain underscores, they can only contain letters, numbers, + (plus sign), . (period), - (hyphen).

The 'driver' key, is the type of adapter. The available adapters are:

The 'config' is the configuration passed into the Flysystem adapter.

Example configuration:

$schemes = [
  'local-example' => [           // The name of the stream wrapper.

    'driver' => 'local',         // The plugin key.

    'config' => [
      'root' => '/path/to/dir/outsite/drupal', // This will be treated similarly
                                               // Drupal's private file system.
      // Or.

      'root' => 'sites/default/files/flysystem',
      'public' => TRUE,                          // In order for the public setting to work,
                                                 // the path must be relative to the root
                                                 // of the Drupal install.

    // Optional settings that apply to all adapters.

    'name' => 'Custom stream wrapper name', // Defaults to Flysystem: scheme.
    'description' => 'Custom description',  // Defaults to Flysystem: scheme.

    'cache' => TRUE,             // Cache filesystem metadata. Not necessary for
                                 // the local driver.

    'replicate' => 'ftpexample', // 'replicate' writes to both filesystems, but
                                 // reads from this one. Functions as a backup.

    'serve_js' => TRUE,          // Serve Javascript or CSS via this stream wrapper.
    'serve_css' => TRUE,         // This is useful for adapters that function as
                                 // CDNs like the S3 adapter.
  ],

  'ftpexample' => [
    'driver' => 'ftp',
    'config' => [
      'host' => 'ftp.example.com',
      'username' => 'username',
      'password' => 'password',

      // Optional config settings.
      'port' => 21,
      'root' => '/path/to/root',
      'passive' => true,
      'ssl' => false,
      'timeout' => 90,
      'permPrivate' => 0700,
      'permPublic' => 0700,
      'transferMode' => FTP_BINARY,
    ],
  ],
];

// Don't forget this!
$settings['flysystem'] = $schemes;

drupal_flysystem's People

Contributors

twistor avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

drupal_flysystem's Issues

Bug translated page

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.