protected function DrupalLocalStreamWrapper::getTarget
7.x stream_wrappers.inc | protected DrupalLocalStreamWrapper::getTarget($uri = NULL) |
Returns the local writable target of the resource within the stream.
This function should be used in place of calls to realpath() or similar functions when attempting to determine the location of a file. While functions like realpath() may return the location of a read-only file, this method may return a URI or path suitable for writing that is completely separate from the URI used for reading.
Parameters
$uri: Optional URI.
Return value
Returns a string representing a location suitable for writing of a file, or FALSE if unable to write to the file such as with read-only streams.
6 calls to DrupalLocalStreamWrapper::getTarget()
- DrupalLocalStreamWrapper::dirname in drupal-7.x/
includes/ stream_wrappers.inc - Gets the name of the directory from a given path.
- DrupalLocalStreamWrapper::getLocalPath in drupal-7.x/
includes/ stream_wrappers.inc - Returns the canonical absolute path of the URI, if possible.
- DrupalLocalStreamWrapper::mkdir in drupal-7.x/
includes/ stream_wrappers.inc - Support for mkdir().
- DrupalPrivateStreamWrapper::getExternalUrl in drupal-7.x/
includes/ stream_wrappers.inc - Overrides getExternalUrl().
- DrupalPublicStreamWrapper::getExternalUrl in drupal-7.x/
includes/ stream_wrappers.inc - Overrides getExternalUrl().
File
- drupal-7.x/
includes/ stream_wrappers.inc, line 297 - Drupal stream wrapper interface.
Class
- DrupalLocalStreamWrapper
- Drupal stream wrapper base class for local files.
Code
protected function getTarget($uri = NULL) {
if (!isset($uri)) {
$uri = $this->uri;
}
list($scheme, $target) = explode('://', $uri, 2);
// Remove erroneous leading or trailing, forward-slashes and backslashes.
return trim($target, '\/');
}