public LocalStream::dirname($uri = NULL)
Gets the name of the directory from a given path.
This method is usually accessed through drupal_dirname(), which wraps around the PHP dirname() function because it does not support stream wrappers.
string $uri: A URI or path.
string A string containing the directory name.
Overrides StreamWrapperInterface::dirname
public function dirname($uri = NULL) { list($scheme) = explode('://', $uri, 2); $target = $this->getTarget($uri); $dirname = dirname($target); if ($dirname == '.') { $dirname = ''; } return $scheme . '://' . $dirname; }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!StreamWrapper!LocalStream.php/function/LocalStream::dirname/8.1.x