1 file_example_session_streams.inc public FileExampleSessionStreamWrapper::getTarget($uri = NULL)

Implements getTarget().

The "target" is the portion of the URI to the right of the scheme. So in session://example/test.txt, the target is 'example/test.txt'.

File

modules/examples/file_example/file_example_session_streams.inc, line 109
Provides a demonstration session:// stream-wrapper.

Class

FileExampleSessionStreamWrapper
Example stream wrapper class to handle session:// streams.

Code

public 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.
  // In the session:// scheme, there is never a leading slash on the target.
  return trim($target, '\/');
}