function file_build_uri
Same name in other branches
- 7.x includes/file.inc \file_build_uri()
- 8.9.x core/includes/file.inc \file_build_uri()
Constructs a URI to Drupal's default files location given a relative path.
Deprecated
in drupal:9.3.0 and is removed from drupal:10.0.0 without replacement.
See also
https://www.drupal.org/node/3223091
Related topics
1 call to file_build_uri()
- FileSystemDeprecationTest::testDeprecatedFileBuildUri in core/
tests/ Drupal/ KernelTests/ Core/ File/ FileSystemDeprecationTest.php - Tests deprecated file_build_uri()
File
-
core/
includes/ file.inc, line 113
Code
function file_build_uri($path) {
@trigger_error('file_build_uri() is deprecated in drupal:9.3.0 and is removed from drupal:10.0.0 without replacement. See https://www.drupal.org/node/3223091', E_USER_DEPRECATED);
$uri = \Drupal::config('system.file')->get('default_scheme') . '://' . $path;
/** @var \Drupal\Core\StreamWrapper\StreamWrapperManagerInterface $stream_wrapper_manager */
$stream_wrapper_manager = \Drupal::service('stream_wrapper_manager');
return $stream_wrapper_manager->normalizeUri($uri);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.