You are here

function drupal_dirname in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/includes/file.inc \drupal_dirname()

Gets the name of the directory from a given path.

Deprecated

in Drupal 8.0.x-dev, will be removed before Drupal 9.0.0. Use \Drupal\Core\File\FileSystem::dirname().

Related topics

6 calls to drupal_dirname()
FileTokenReplaceTest::testFileTokenReplacement in core/modules/file/src/Tests/FileTokenReplaceTest.php
Creates a file, then tests the tokens generated from it.
file_destination in core/includes/file.inc
Determines the destination path for a file.
file_unmanaged_copy in core/includes/file.inc
Copies a file to a new location without invoking the file API.
ImageStyle::createDerivative in core/modules/image/src/Entity/ImageStyle.php
Creates a new image derivative based on this image style.
locale_translation_source_build in core/modules/locale/locale.translation.inc
Builds abstract translation source.

... See full list

File

core/includes/file.inc, line 1054
API for handling file uploads and server file management.

Code

function drupal_dirname($uri) {
  return \Drupal::service('file_system')
    ->dirname($uri);
}