You are here

public function SystemStreamWrapper::getExternalUrl in System stream wrapper 7

Overrides getExternalUrl().

Return the HTML URI of a system file.

Overrides DrupalStreamWrapperInterface::getExternalUrl

File

./SystemStreamWrapper.inc, line 54

Class

SystemStreamWrapper
Drupal system stream wrapper abstract class.

Code

public function getExternalUrl() {
  $dir = $this
    ->getDirectoryPath();
  if (empty($dir)) {
    return FALSE;
  }
  $path = str_replace('\\', '/', $this
    ->getTarget());
  return $GLOBALS['base_url'] . '/' . $dir . '/' . drupal_encode_path($path);
}