You are here

function system_stream_wrappers in Drupal 7

Implements hook_stream_wrappers().

File

modules/system/system.module, line 1665
Configuration system that lets administrators modify the workings of the site.

Code

function system_stream_wrappers() {
  $wrappers = array(
    'public' => array(
      'name' => t('Public files'),
      'class' => 'DrupalPublicStreamWrapper',
      'description' => t('Public local files served by the webserver.'),
      'type' => STREAM_WRAPPERS_LOCAL_NORMAL,
    ),
    'temporary' => array(
      'name' => t('Temporary files'),
      'class' => 'DrupalTemporaryStreamWrapper',
      'description' => t('Temporary local files for upload and previews.'),
      'type' => STREAM_WRAPPERS_LOCAL_HIDDEN,
    ),
  );

  // Only register the private file stream wrapper if a file path has been set.
  if (variable_get('file_private_path', FALSE)) {
    $wrappers['private'] = array(
      'name' => t('Private files'),
      'class' => 'DrupalPrivateStreamWrapper',
      'description' => t('Private local files served by Drupal.'),
      'type' => STREAM_WRAPPERS_LOCAL_NORMAL,
    );
  }
  return $wrappers;
}