file_uri_scheme

Versions
7
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".

Related topics

▾ 15 functions call file_uri_scheme()

drupal_dirname in includes/file.inc
Gets the name of the directory from a given path.
drupal_tempnam in includes/file.inc
Creates a file with a unique filename in the specified directory.
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 (stream).
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
Implement hook_file_url_alter().
file_transfer in includes/file.inc
Transfer file using HTTP to client. Pipes a file through Drupal to the client.
file_unmanaged_copy in includes/file.inc
Copy a file to a new location without calling any hooks or making any changes to the database.
hook_file_url_alter in modules/system/system.api.php
Alter the URL to a file.
image_file_download in modules/image/image.module
Implement hook_file_download().
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.

Code

includes/file.inc, line 141

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

  return count($data) == 2 ? $data[0] : FALSE;
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.