You are here

protected static function Uri::getScheme in Feeds 8.3

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

Parameters

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

Return value

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

1 call to Uri::getScheme()
Uri::validateUrl in src/Element/Uri.php
Form element validation handler for #type 'feeds_uri'.

File

src/Element/Uri.php, line 67

Class

Uri
Provides a form element for input of a URI.

Namespace

Drupal\feeds\Element

Code

protected static function getScheme($uri) {
  $position = strpos($uri, '://');
  return $position ? substr($uri, 0, $position) : FALSE;
}