Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. FileSystemInterface.php

function FileSystemInterface::dirname

Gets the name of the directory from a given path.

PHP's dirname() does not properly pass streams, so this function fills that gap. It is backwards compatible with normal paths and will use PHP's dirname() as a fallback.

Compatibility: normal paths and stream wrappers.

Parameters

string $uri: A URI or path.

Return value

string A string containing the directory name.

See also

dirname()

https://www.drupal.org/node/515192

Related topics

PHP wrapper functions
Functions that are wrappers or custom implementations of PHP functions.
1 method overrides FileSystemInterface::dirname()
FileSystem::dirname in core/lib/Drupal/Core/File/FileSystem.php
Gets the name of the directory from a given path.

File

core/lib/Drupal/Core/File/FileSystemInterface.php, line 176

Class

FileSystemInterface
Provides an interface for helpers that operate on files and stream wrappers.

Namespace

Drupal\Core\File

Code

public function dirname($uri);
RSS feed
Powered by Drupal