You are here

README.txt in Flysystem 7

Flysystem
=========

## REQUIREMENTS ##

- PHP 5.4 or greater
- Composer (https://getcomposer.org)
- Composer manager (https://www.drupal.org/project/composer_manager)

## INSTALLATION ##

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

 1. drush dl composer_manager && drush en composer_manager -y
 2. drush dl flysystem && drush en flysystem -y
 6. Enjoy.

## CONFIGURATION ##

Stream wrappers are configured in settings.php. The keys (localexample) are the
names of the stream wrappers. Can be used like 'localexample://filename.txt' The
'driver' key, is the type of adapter. Available adapters are:

 - local
 - ftp (Requires the ftp extension)
 - dropbox (https://www.drupal.org/project/flysystem_dropbox)
 - rackspace (https://www.drupal.org/project/flysystem_rackspace)
 - s3v2 (https://www.drupal.org/project/flysystem_s3)
 - sftp (https://www.drupal.org/project/flysystem_sftp)
 - zip (https://www.drupal.org/project/flysystem_zip)

The 'config' key is the settings that will be passed into the Flysystem adapter.

Example configuration:

$schemes = array(
  'localexample' => array(       // The name of the stream wrapper. localexample://

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

    'config' => array(
      'root' => '/path/to/dir',  // If 'root' is inside the public directory,
    ),                           // then files will be served directly. Can be
                                 // relative or absolute.

    // Optional settings that apply to all adapters.

    'cache' => TRUE,             // Cache filesystem metadata. Not necessary,
                                 // since this is a local filesystem.

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

  'ftpexample' => array(
    'driver' => 'ftp',
    'config' => array(
      '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!
$conf['flysystem'] = $schemes;

File

README.txt
View source
  1. Flysystem
  2. =========
  3. ## REQUIREMENTS ##
  4. - PHP 5.4 or greater
  5. - Composer (https://getcomposer.org)
  6. - Composer manager (https://www.drupal.org/project/composer_manager)
  7. ## INSTALLATION ##
  8. These are the steps you need to take in order to use this software. Order is
  9. important. (using drush)
  10. 1. drush dl composer_manager && drush en composer_manager -y
  11. 2. drush dl flysystem && drush en flysystem -y
  12. 6. Enjoy.
  13. ## CONFIGURATION ##
  14. Stream wrappers are configured in settings.php. The keys (localexample) are the
  15. names of the stream wrappers. Can be used like 'localexample://filename.txt' The
  16. 'driver' key, is the type of adapter. Available adapters are:
  17. - local
  18. - ftp (Requires the ftp extension)
  19. - dropbox (https://www.drupal.org/project/flysystem_dropbox)
  20. - rackspace (https://www.drupal.org/project/flysystem_rackspace)
  21. - s3v2 (https://www.drupal.org/project/flysystem_s3)
  22. - sftp (https://www.drupal.org/project/flysystem_sftp)
  23. - zip (https://www.drupal.org/project/flysystem_zip)
  24. The 'config' key is the settings that will be passed into the Flysystem adapter.
  25. Example configuration:
  26. $schemes = array(
  27. 'localexample' => array( // The name of the stream wrapper. localexample://
  28. 'driver' => 'local', // The plugin key.
  29. 'config' => array(
  30. 'root' => '/path/to/dir', // If 'root' is inside the public directory,
  31. ), // then files will be served directly. Can be
  32. // relative or absolute.
  33. // Optional settings that apply to all adapters.
  34. 'cache' => TRUE, // Cache filesystem metadata. Not necessary,
  35. // since this is a local filesystem.
  36. 'replicate' => 'ftpexample', // 'replicate' writes to both filesystems, but
  37. // reads from this one. Functions as a backup.
  38. ),
  39. 'ftpexample' => array(
  40. 'driver' => 'ftp',
  41. 'config' => array(
  42. 'host' => 'ftp.example.com',
  43. 'username' => 'username',
  44. 'password' => 'password',
  45. // Optional config settings.
  46. 'port' => 21,
  47. 'root' => '/path/to/root',
  48. 'passive' => true,
  49. 'ssl' => false,
  50. 'timeout' => 90,
  51. 'permPrivate' => 0700,
  52. 'permPublic' => 0700,
  53. 'transferMode' => FTP_BINARY,
  54. ),
  55. ),
  56. );
  57. // Don't forget this!
  58. $conf['flysystem'] = $schemes;