Drupal private (private://) stream wrapper class.
Provides support for storing privately accessible files with the Drupal file interface.
Extends DrupalPublicStreamWrapper.
Hierarchy
Properties
| Name | Description |
|---|---|
| DrupalLocalStreamWrapper::$context | Stream context resource. |
| DrupalLocalStreamWrapper::$handle | A generic resource handle. |
| DrupalLocalStreamWrapper::$uri | Instance URI (stream). |
Functions & methods
File
- includes/
stream_wrappers.inc, line 794 - Drupal stream wrapper interface.
View source
class DrupalPrivateStreamWrapper extends DrupalLocalStreamWrapper {
/**
* Implements abstract public function getDirectoryPath()
*/
public function getDirectoryPath() {
return variable_get('file_private_path', '');
}
/**
* Overrides getExternalUrl().
*
* Return the HTML URI of a private file.
*/
function getExternalUrl() {
$path = str_replace('\\', '/', $this->getTarget());
return url('system/files/' . $path, array('absolute' => TRUE));
}
}