diff options
Diffstat (limited to 'modules/system/system.api.php')
-rw-r--r-- | modules/system/system.api.php | 31 |
1 files changed, 26 insertions, 5 deletions
diff --git a/modules/system/system.api.php b/modules/system/system.api.php index a5773c300..05c6d4241 100644 --- a/modules/system/system.api.php +++ b/modules/system/system.api.php @@ -2297,9 +2297,13 @@ function hook_modules_uninstalled($modules) { * - 'class' A string specifying the PHP class that implements the * DrupalStreamWrapperInterface interface. * - 'description' A string with a short description of what the wrapper does. - * - 'type' A bitmask of flags indicating what type of streams this wrapper - * will access - local or remote, readable and/or writeable, etc. Many - * shortcut constants are defined in stream_wrappers.inc. + * - 'type' (Optional) A bitmask of flags indicating what type of streams this + * wrapper will access - local or remote, readable and/or writeable, etc. + * Many shortcut constants are defined in stream_wrappers.inc. Defaults to + * STREAM_WRAPPERS_NORMAL which includes all of these bit flags: + * - STREAM_WRAPPERS_READ + * - STREAM_WRAPPERS_WRITE + * - STREAM_WRAPPERS_VISIBLE * * @see file_get_stream_wrappers() * @see hook_stream_wrappers_alter() @@ -2311,18 +2315,35 @@ function hook_stream_wrappers() { 'name' => t('Public files'), 'class' => 'DrupalPublicStreamWrapper', 'description' => t('Public local files served by the webserver.'), + 'type' => STREAM_WRAPPERS_LOCAL_NORMAL, ), 'private' => array( 'name' => t('Private files'), 'class' => 'DrupalPrivateStreamWrapper', 'description' => t('Private local files served by Drupal.'), + 'type' => STREAM_WRAPPERS_LOCAL_NORMAL, ), 'temp' => array( 'name' => t('Temporary files'), 'class' => 'DrupalTempStreamWrapper', 'description' => t('Temporary local files for upload and previews.'), - 'type' => STREAM_WRAPPERS_HIDDEN, - ) + 'type' => STREAM_WRAPPERS_LOCAL_HIDDEN, + ), + 'cdn' => array( + 'name' => t('Content delivery network files'), + 'class' => 'MyModuleCDNStreamWrapper', + 'description' => t('Files served by a content delivery network.'), + // 'type' can be omitted to use the default of STREAM_WRAPPERS_NORMAL + ), + 'youtube' => array( + 'name' => t('YouTube video'), + 'class' => 'MyModuleYouTubeStreamWrapper', + 'description' => t('Video streamed from YouTube.'), + // A module implementing YouTube integration may decide to support using + // the YouTube API for uploading video, but here, we assume that this + // particular module only supports playing YouTube video. + 'type' => STREAM_WRAPPERS_READ_VISIBLE, + ), ); } |