mirror of
https://codeberg.org/icewind/streams.git
synced 2026-06-04 00:54:08 +02:00
add PathWrapper to get a virtual path for an existing file
This commit is contained in:
parent
d3620e8dc4
commit
5981b1b39c
4 changed files with 55 additions and 5 deletions
25
src/PathWrapper.php
Normal file
25
src/PathWrapper.php
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
<?php
|
||||
/**
|
||||
* Copyright (c) 2016 Robin Appelman <icewind@owncloud.com>
|
||||
* This file is licensed under the Licensed under the MIT license:
|
||||
* http://opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
namespace Icewind\Streams;
|
||||
|
||||
/**
|
||||
* A string-like object that maps to an existing stream when opened
|
||||
*/
|
||||
class PathWrapper extends NullWrapper {
|
||||
/**
|
||||
* @param resource $source
|
||||
* @return Path|string
|
||||
*/
|
||||
public static function getPath($source) {
|
||||
return new Path(__CLASS__, [
|
||||
'null' => [
|
||||
'source' => $source
|
||||
]
|
||||
]);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue