46 throw new UnexpectedValueException(
"Missing ID in URL component." );
54 foreach ( $urls as $url ) {
56 if (
$blob !==
false ) {
68 return "memory://$location/$index";
75 foreach ( self::$data as &$dataForLocation ) {
76 unset( $dataForLocation[$this->dbDomain] );
78 unset( $dataForLocation );
79 self::$data = array_filter( self::$data,
'count' );
88 list( $proto,
$path ) = explode(
'://', $url, 2 ) + [
null, null ];
89 if ( $proto !==
'memory' ) {
90 throw new UnexpectedValueException(
"Got URL of protocol '$proto', not 'memory'." );
91 } elseif (
$path ===
null ) {
92 throw new UnexpectedValueException(
"URL is missing path component." );
95 $parts = explode(
'/',
$path );
96 if ( count( $parts ) > 2 ) {
97 throw new UnexpectedValueException(
"Too components in URL '$path'." );
100 return [ $parts[0], $parts[1] ?? null ];