function drupal_realpath

Same name in other branches
  1. 7.x includes/file.inc \drupal_realpath()

Resolves the absolute filepath of a local URI or filepath.

Deprecated

in drupal:8.0.0 and is removed from drupal:9.0.0. Use \Drupal\Core\File\FileSystem::realpath().

See also

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

Related topics

1 call to drupal_realpath()
FileSystemDeprecationTest::testRealpath in core/tests/Drupal/KernelTests/Core/File/FileSystemDeprecationTest.php
@expectedDeprecation drupal_realpath() is deprecated in drupal:8.0.0 and will be removed in drupal:9.0.0. Use \Drupal\Core\File\FileSystemInterface::realpath(). See https://www.drupal.org/node/2418133.

File

core/includes/file.inc, line 1045

Code

function drupal_realpath($uri) {
    @trigger_error('drupal_realpath() is deprecated in drupal:8.0.0 and will be removed in drupal:9.0.0. Use \\Drupal\\Core\\File\\FileSystemInterface::realpath(). See https://www.drupal.org/node/2418133.', E_USER_DEPRECATED);
    return \Drupal::service('file_system')->realpath($uri);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.