protected function DrupalLocalStreamWrapper::getLocalPath

cis7 stream_wrappers.inc protected DrupalLocalStreamWrapper::getLocalPath($uri = NULL)
cle7 stream_wrappers.inc protected DrupalLocalStreamWrapper::getLocalPath($uri = NULL)
elmsmedia7 stream_wrappers.inc protected DrupalLocalStreamWrapper::getLocalPath($uri = NULL)
icor7 stream_wrappers.inc protected DrupalLocalStreamWrapper::getLocalPath($uri = NULL)
meedjum_blog7 stream_wrappers.inc protected DrupalLocalStreamWrapper::getLocalPath($uri = NULL)
mooc7 stream_wrappers.inc protected DrupalLocalStreamWrapper::getLocalPath($uri = NULL)

Returns the canonical absolute path of the URI, if possible.

Parameters

string $uri: (optional) The stream wrapper URI to be converted to a canonical absolute path. This may point to a directory or another type of file.

Return value

string|false If $uri is not set, returns the canonical absolute path of the URI previously set by the DrupalStreamWrapperInterface::setUri() function. If $uri is set and valid for this class, returns its canonical absolute path, as determined by the realpath() function. If $uri is set but not valid, returns FALSE.

9 calls to DrupalLocalStreamWrapper::getLocalPath()

File

includes/stream_wrappers.inc, line 372
Drupal stream wrapper interface.

Class

DrupalLocalStreamWrapper
Drupal stream wrapper base class for local files.

Code

protected function getLocalPath($uri = NULL) {
  if (!isset($uri)) {
    $uri = $this->uri;
  }
  $path = $this->getDirectoryPath() . '/' . $this->getTarget($uri);
  $realpath = realpath($path);
  if (!$realpath) {
    // This file does not yet exist.
    $realpath = realpath(dirname($path)) . '/' . drupal_basename($path);
  }
  $directory = realpath($this->getDirectoryPath());
  if (!$realpath || !$directory || strpos($realpath, $directory) !== 0) {
    return FALSE;
  }
  return $realpath;
}
Error | ELMSLN API

Error

×

Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/api.elmsln.org/includes/common.inc:2791) in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/api.elmsln.org/sites/all/modules/apc/drupal_apc_cache.inc).
The website encountered an unexpected error. Please try again later.