flysystem.module in Flysystem 8
Same filename and directory in other branches
Provides access to various filesystem backends using Flysystem.
File
flysystem.moduleView source
<?php
/**
* @file
* Provides access to various filesystem backends using Flysystem.
*/
/**
* Implements hook_cron().
*/
function flysystem_cron() {
Drupal::service('flysystem_factory')
->ensure();
}
/**
* Implements hook_rebuild().
*/
function flysystem_rebuild() {
Drupal::service('flysystem_factory')
->ensure();
}
/**
* Implements hook_file_download().
*/
function flysystem_file_download($uri) {
$schemes = Drupal::service('flysystem_factory')
->getSchemes();
$scheme = Drupal::service('file_system')
->uriScheme($uri);
if (!$scheme || !in_array($scheme, $schemes, TRUE)) {
return;
}
return [
'Content-Type' => Drupal::service('file.mime_type.guesser.extension')
->guess($uri),
'Content-Length' => filesize($uri),
];
}
Functions
Name | Description |
---|---|
flysystem_cron | Implements hook_cron(). |
flysystem_file_download | Implements hook_file_download(). |
flysystem_rebuild | Implements hook_rebuild(). |