function FileSystemInterface::realpath
Same name in other branches
- 9 core/lib/Drupal/Core/File/FileSystemInterface.php \Drupal\Core\File\FileSystemInterface::realpath()
- 8.9.x core/lib/Drupal/Core/File/FileSystemInterface.php \Drupal\Core\File\FileSystemInterface::realpath()
- 10 core/lib/Drupal/Core/File/FileSystemInterface.php \Drupal\Core\File\FileSystemInterface::realpath()
Resolves the absolute filepath of a local URI or filepath.
The use of this method is discouraged, because it does not work for remote URIs. Except in rare cases, URIs should not be manually resolved.
Only use this function if you know that the stream wrapper in the URI uses the local file system, and you need to pass an absolute path to a function that is incompatible with stream URIs.
Parameters
string $uri: A stream wrapper URI or a filepath, possibly including one or more symbolic links.
Return value
string|false The absolute local filepath (with no symbolic links) or FALSE on failure.
See also
\Drupal\Core\StreamWrapper\StreamWrapperInterface::realpath()
http://php.net/manual/function.realpath.php
Related topics
1 method overrides FileSystemInterface::realpath()
- FileSystem::realpath in core/
lib/ Drupal/ Core/ File/ FileSystem.php - Resolves the absolute filepath of a local URI or filepath.
File
-
core/
lib/ Drupal/ Core/ File/ FileSystemInterface.php, line 155
Class
- FileSystemInterface
- Provides an interface for helpers that operate on files and stream wrappers.
Namespace
Drupal\Core\FileCode
public function realpath($uri);
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.