file_uri_target

  1. drupal
    1. 8
    2. 7
Versions
8 – 7 file_uri_target($uri)

Returns the part of an URI after the schema.

Parameters

$uri A stream, referenced as "scheme://target".

Return value

A string containing the target (path), or FALSE if none. For example, the URI "public://sample/test.txt" would return "sample/test.txt".

See also

file_uri_scheme()

Related topics

▾ 13 functions call file_uri_target()

file_stream_wrapper_uri_normalize in includes/file.inc
Normalizes a URI by making it syntactically correct.
file_test_file_url_alter in modules/simpletest/tests/file_test.module
Implements hook_file_url_alter().
hook_file_download in modules/system/system.api.php
Control access to private file downloads and specify HTTP headers.
hook_file_url_alter in modules/system/system.api.php
Alter the URL to a file.
ImageExampleTestCase::testImageExamplePage in examples/image_example/image_example.test
Tests for image block provided by module.
image_file_download in modules/image/image.module
Implements hook_file_download().
image_style_deliver in modules/image/image.module
Menu callback; Given a style and image path, generate a derivative.
image_style_path in modules/image/image.module
Return the URI of an image when using a style.
image_style_url in modules/image/image.module
Return the URL for an image derivative given a style and image path.
StreamWrapperTest::testUriFunctions in modules/simpletest/tests/file.test
Test the URI and target functions.
system_theme_settings in modules/system/system.admin.inc
Form builder; display theme configuration for entire site and individual themes.
UserPictureTestCase::testPictureIsValid in modules/user/user.test
Do the test: Picture is valid (proper size and dimension)
user_file_download in modules/user/user.module
Implements hook_file_download().

Code

includes/file.inc, line 247

<?php
function file_uri_target($uri) {
  $data = explode('://', $uri, 2);

  // Remove erroneous leading or trailing, forward-slashes and backslashes.
  return count($data) == 2 ? trim($data[1], '\/') : FALSE;
}
?>