You are here

function hook_s3fs_url_settings_alter in S3 File System 7

Same name and namespace in other branches
  1. 8.3 s3fs.api.php \hook_s3fs_url_settings_alter()
  2. 8.2 s3fs.api.php \hook_s3fs_url_settings_alter()
  3. 7.3 s3fs.api.php \hook_s3fs_url_settings_alter()
  4. 7.2 s3fs.api.php \hook_s3fs_url_settings_alter()
  5. 4.0.x s3fs.api.php \hook_s3fs_url_settings_alter()

Alters the format and options used when creating an external URL.

For example the URL can be a URL directly to the file, or can be a URL to a torrent. In addition, it can be authenticated (time limited), and in that case a save-as can be forced.

Parameters

array $url_settings: Associative array of URL settings:

string $s3_file_path: The path to the file within your S3 bucket.

Return value

array The modified array of configuration items.

1 invocation of hook_s3fs_url_settings_alter()
S3fsStreamWrapper::getExternalUrl in ./S3fsStreamWrapper.inc
Returns a web accessible URL for the resource.

File

./s3fs.api.php, line 35
This file contains no working PHP code; it exists to provide additional documentation for doxygen as well as to document hooks in the standard Drupal manner.

Code

function hook_s3fs_url_settings_alter(&$url_settings, $s3_file_path) {

  // An example of what you might want to do with this hook.
  if ($s3_file_path == 'myfile.jpg') {
    $url_settings['presigned_url'] = TRUE;
    $url_settings['timeout'] = 10;
  }
}