public static function get($name = null)
{
$name = static::setDirectorySeparator($name ?: uniqid());
$adapter = static::getAdapter();
if (($protocol = static::getProtocol($name)) === null) {
$protocol = static::defaultProtocol;
$name = $protocol . static::protocolSeparator . $name;
}
if (in_array($protocol, $adapter->stream_get_wrappers()) === false && $adapter->stream_wrapper_register($protocol, get_called_class(), 0) === false) {
throw new exceptions\runtime('Unable to register ' . $protocol . ' stream');
}
$stream = static::findControllerForStream($name);
if ($stream === null) {
static::$streams[] = $stream = static::getController($name);
}
return $stream;
}