1. drupal
    1. 8
    2. 7
7 – 8 file_uri_scheme($uri)

Returns the scheme of a URI (e.g. a stream).


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

Return value

A string containing the name of the scheme, or FALSE if none. For example, the URI "public://example.txt" would return "public".

See also


Related topics

▾ 28 functions call file_uri_scheme()

drupal_dirname in includes/
Gets the name of the directory from a given path.
drupal_load_stylesheet in includes/
Loads the stylesheet and resolves all @import commands.
drupal_rmdir in includes/
Remove a directory.
drupal_tempnam in includes/
Creates a file with a unique filename in the specified directory.
drupal_unlink in includes/
Deletes a file.
FileSaveDataTest::testExistingRename in modules/simpletest/tests/file.test
Test file_save_data() when renaming around an existing file.
FileSaveDataTest::testExistingReplace in modules/simpletest/tests/file.test
Test file_save_data() when replacing an existing file.
FileSaveDataTest::testWithFilename in modules/simpletest/tests/file.test
Test the file_save_data() function when a filename is provided.
FileSaveDataTest::testWithoutFilename in modules/simpletest/tests/file.test
Test the file_save_data() function when no filename is provided.
FileUnmanagedSaveDataTest::testFileSaveData in modules/simpletest/tests/file.test
Test the file_unmanaged_save_data() function.
file_create_htaccess in includes/
Creates an .htaccess file in the given directory.
file_create_url in includes/
Creates a web-accessible URL for a stream to an external or local file.
file_prepare_directory in includes/
Check that the directory exists and is writable.
file_save_upload in includes/
Saves a file upload to a new location.
file_stream_wrapper_get_instance_by_uri in includes/
Returns a reference to the stream wrapper class responsible for a given URI.
file_stream_wrapper_uri_normalize in includes/
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().
file_transfer in includes/
Transfer file using HTTP to client.
file_valid_uri in includes/
Determine whether the URI has a valid scheme for file API operations.
hook_file_url_alter in modules/system/system.api.php
Alter the URL to a file.
ImageFieldDisplayTestCase::testImageFieldDefaultImage in modules/image/image.test
Test use of a default image with an image field.
image_field_update_field in modules/image/image.module
Implements hook_field_update_field().
image_file_download in modules/image/image.module
Implements hook_file_download().
image_gd_save in modules/system/
GD helper to write an image resource to a destination file.
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::testGetValidStreamScheme in modules/simpletest/tests/file.test
Test the scheme functions.
system_theme_settings in modules/system/
Form builder; display theme configuration for entire site and individual themes.


includes/, line 203

function file_uri_scheme($uri) {
  $position = strpos($uri, '://');
  return $position ? substr($uri, 0, $position) : FALSE;