Checks that the scheme of a stream URI is valid.
Confirms that there is a registered stream handler for the provided scheme and that it is callable. This is useful if you want to confirm a valid scheme without creating a new instance of the registered handler.
$scheme: A URI scheme, a stream is referenced as "scheme://target".
Returns TRUE if the string is the name of a validated stream, or FALSE if the scheme does not have a registered handler.
function file_stream_wrapper_valid_scheme($scheme) {
return $scheme && class_exists(file_stream_wrapper_get_class($scheme));
}