function emapi_uri_scheme in Embedded Media Field 6.3
Returns the scheme of a URI (e.g. a stream).
Note that this function is lifted from Drupal 7's file_uri_scheme().
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 "youtube://v/3gfh6asey" would return "youtube".
3 calls to emapi_uri_scheme()
- emapi_get_provider_class in emapi/
emapi.module - Returns the registered class for a specific provider.
- emapi_media_delete in emapi/
emapi.module - Delete a media object from the database.
- emfield_widget in ./
emfield.module - Implementation of hook_widget()
File
- emapi/
emapi.module, line 186 - Provides an API for parsing, storage, and display of third party media.
Code
function emapi_uri_scheme($uri) {
$data = explode('://', $uri, 2);
return count($data) == 2 ? $data[0] : FALSE;
}