file_uri_scheme

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

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

Parameters

$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

file_uri_target()

Related topics

▾ 28 functions call file_uri_scheme()

drupal_dirname in includes/file.inc
Gets the name of the directory from a given path.
drupal_load_stylesheet in includes/common.inc
Loads the stylesheet and resolves all @import commands.
drupal_rmdir in includes/file.inc
Remove a directory.
drupal_tempnam in includes/file.inc
Creates a file with a unique filename in the specified directory.
drupal_unlink in includes/file.inc
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/file.inc
Creates an .htaccess file in the given directory.
file_create_url in includes/file.inc
Creates a web-accessible URL for a stream to an external or local file.
file_prepare_directory in includes/file.inc
Check that the directory exists and is writable.
file_save_upload in includes/file.inc
Saves a file upload to a new location.
file_stream_wrapper_get_instance_by_uri in includes/file.inc
Returns a reference to the stream wrapper class responsible for a given URI.
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().
file_transfer in includes/file.inc
Transfer file using HTTP to client.
file_valid_uri in includes/file.inc
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/image.gd.inc
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/system.admin.inc
Form builder; display theme configuration for entire site and individual themes.

Code

includes/file.inc, line 203

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