vfsStreamWrapper.php
Stream wrapper to mock file system requests.
- Package
- bovigo_vfs
Package: bovigo\vfsStream wrapper to mock file system requests.
Constants
Properties



bool
$registered= 'false'
staticswitch whether class has already been registered as stream wrapper or not
Default valuefalse
Details
- Type
- bool
Methods



calculateMode(
string $mode, bool $extended
)
:
int
Parameters
Name |
Type |
Description |
$mode |
string |
opening mode: r, w, a or x |
$extended |
bool |
true if + was set with opening mode
|
Returns



getContent(
string $path
)
:
\vfsStreamContent
returns content for given path
Parameters
Name |
Type |
Description |
$path |
string |
|
Returns



getContentOfType(
string $path, int $type
)
:
\vfsStreamContent
returns content for given path but only when it is of given type
Parameters
Name |
Type |
Description |
$path |
string |
|
$type |
int |
|
Returns



register(
)
:
void
staticmethod to register the stream wrapper
Please be aware that a call to this method will reset the root element
to null.
If the stream is already registered the method returns silently. If there
is already another stream wrapper registered for the scheme used by
vfsStream a vfsStreamException will be thrown.
Throws



rename(
string $path_from, string $path_to
)
:
bool
rename from one path to another
Parameters
Name |
Type |
Description |
$path_from |
string |
|
$path_to |
string |
|
Returns
Details
- Author
- Benoit Aubuchon



resolvePath(
string $path
)
:
string
helper method to resolve a path from /foo/bar/. to /foo/bar
Parameters
Name |
Type |
Description |
$path |
string |
|
Returns



splitPath(
string $path
)
:
array
splits path into its dirname and the basename
Parameters
Name |
Type |
Description |
$path |
string |
|
Returns



stream_cast(
int $cast_as
)
:
bool
retrieve the underlaying resource
Please note that this method always returns false as there is no
underlaying resource to return.
Parameters
Name |
Type |
Description |
$cast_as |
int |
|
Returns
Details
- See
- \https://github.com/mikey179/vfsStream/issues/3
- Since
- 0.9.0



stream_lock(
int $operation
)
:
bool
set lock status for stream
Parameters
Name |
Type |
Description |
$operation |
int |
|
Returns
Details
- See
- \https://github.com/mikey179/vfsStream/issues/6
- Since
- 0.10.0



stream_open(
string $path, string $mode, string $options, string $opened_path
)
:
bool
Parameters
Name |
Type |
Description |
$path |
string |
the path to open |
$mode |
string |
mode for opening |
$options |
string |
options for opening |
$opened_path |
string |
full path that was actually opened |
Returns



stream_read(
int $count
)
:
string
read the stream up to $count bytes
Parameters
Name |
Type |
Description |
$count |
int |
amount of bytes to read |
Returns



stream_seek(
int $offset, int $whence
)
:
bool
seeks to the given offset
Parameters
Name |
Type |
Description |
$offset |
int |
|
$whence |
int |
|
Returns



stream_set_option(
int $option, int $arg1, int $arg2
)
:
bool
sets options on the stream
Parameters
Name |
Type |
Description |
$option |
int |
key of option to set |
$arg1 |
int |
|
$arg2 |
int |
|
Returns
Details
- See
- \https://github.com/mikey179/vfsStream/issues/15
- See
- \http://www.php.net/manual/streamwrapper.stream-set-option.php
- Since
- 0.10.0



stream_write(
string $data
)
:
int
writes data into the stream
Parameters
Name |
Type |
Description |
$data |
string |
|
Returns
Type |
Description |
int |
amount of bytes written |



unlink(
string $path
)
:
bool
remove the data under the given path
Parameters
Name |
Type |
Description |
$path |
string |
|
Returns



url_stat(
string $path, \? $flags
)
:
array
Parameters
Name |
Type |
Description |
$path |
string |
path of url to return status for |
$flags |
\? |
flags set by the stream API |
Returns