Please note that the contents of this offline web site may be out of date. To access the most recent documentation visit the online version .
Note that links that point to online resources are green in color and will open in a new window.
We would love it if you could give us feedback about this material by filling this form (You have to be online to fill it)



third_party/vfsstream/vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/vfsStreamWrapper.php

Table of Contents
This file is part of vfsStream.

For the full copyright and license information, please view the LICENSE file that was distributed with this source code.

Package
org\bovigo\vfs

\org\bovigo\vfs\vfsStreamWrapper

Package: Default
Stream wrapper to mock file system requests.
Children
\org\bovigo\vfs\vfsStreamWrapperRecordingProxy
\org\bovigo\vfs\TestvfsStreamWrapper

Constants

> V Constant READ = 'r'
open file for reading
> V Constant TRUNCATE = 'w'
truncate file
> V Constant APPEND = 'a'
set file pointer to end, append new data
> V Constant WRITE = 'x'
set file pointer to start, overwrite existing data
> V Constant WRITE_NEW = 'c'
set file pointer to start, overwrite existing data; or create file if does not exist
> V Constant READONLY = 0
file mode: read only
> V Constant WRITEONLY = 1
file mode: write only
> V Constant ALL = 2
file mode: read and write

Methods

method public dir_closedir () : bool

closes directory

Returns
Type Description
bool
method public dir_opendir (string $path, int $options) : bool

opens a directory

Parameters
Name Type Description
$path string
$options int
Returns
Type Description
bool
method public dir_readdir () : string

reads directory contents

Returns
Type Description
string
method public dir_rewinddir () : bool

reset directory iteration

Returns
Type Description
bool
method public getRoot () : \org\bovigo\vfs\vfsStreamContainer
static

returns the root content

Returns
Type Description
\org\bovigo\vfs\vfsStreamContainer
method public mkdir (string $path, int $mode, int $options) : bool

creates a new directory

Parameters
Name Type Description
$path string
$mode int
$options int
Returns
Type Description
bool
method public register () : void
static

method 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
Exception Description
\org\bovigo\vfs\vfsStreamException
method public 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
Type Description
bool
Details
Author
Benoit Aubuchon
method public rmdir (string $path, int $options) : bool

removes a directory

Parameters
Name Type Description
$path string
$options int
Returns
Type Description
bool
Details
Todo
consider $options with STREAM_MKDIR_RECURSIVE
method public setQuota (\org\bovigo\vfs\Quota $quota) : void
static

sets quota for disk space

Parameters
Name Type Description
$quota \org\bovigo\vfs\Quota
Details
Since
1.1.0
method public setRoot ( \org\bovigo\vfs\vfsStreamContainer $root) : \org\bovigo\vfs\vfsStreamContainer
static

sets the root content

Parameters
Name Type Description
$root \org\bovigo\vfs\vfsStreamContainer
Returns
Type Description
\org\bovigo\vfs\vfsStreamContainer
method public 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
Type Description
bool
Details
See
\org\bovigo\vfs\https://github.com/mikey179/vfsStream/issues/3
Since
0.9.0
method public stream_close () : void

closes the stream

Details
See
\org\bovigo\vfs\https://github.com/mikey179/vfsStream/issues/40
method public stream_eof () : bool

checks whether stream is at end of file

Returns
Type Description
bool
method public stream_flush () : bool

flushes unstored data into storage

Returns
Type Description
bool
method public stream_lock (int $operation) : bool

set lock status for stream

Parameters
Name Type Description
$operation int
Returns
Type Description
bool
Details
See
\org\bovigo\vfs\https://github.com/mikey179/vfsStream/issues/6
See
\org\bovigo\vfs\https://github.com/mikey179/vfsStream/issues/31
See
\org\bovigo\vfs\https://github.com/mikey179/vfsStream/issues/40
Since
0.10.0
method public stream_metadata (string $path, int $option, mixed $var) : bool

sets metadata like owner, user or permissions

Parameters
Name Type Description
$path string
$option int
$var mixed
Returns
Type Description
bool
Details
Since
1.1.0
method public stream_open (string $path, string $mode, string $options, string $opened_path) : bool

open the stream

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
Type Description
bool
method public stream_read (int $count) : string

read the stream up to $count bytes

Parameters
Name Type Description
$count int

amount of bytes to read

Returns
Type Description
string
method public stream_seek (int $offset, int $whence) : bool

seeks to the given offset

Parameters
Name Type Description
$offset int
$whence int
Returns
Type Description
bool
method public 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
Type Description
bool
Details
See
\org\bovigo\vfs\https://github.com/mikey179/vfsStream/issues/15
See
\org\bovigo\vfs\http://www.php.net/manual/streamwrapper.stream-set-option.php
Since
0.10.0
method public stream_stat () : array

returns status of stream

Returns
Type Description
array
method public stream_tell () : int

returns the current position of the stream

Returns
Type Description
int
method public stream_truncate (int $size) : bool

truncates a file to a given length

Parameters
Name Type Description
$size int

length to truncate file to

Returns
Type Description
bool
Details
Since
1.1.0
method public stream_write (string $data) : int

writes data into the stream

Parameters
Name Type Description
$data string
Returns
Type Description
int amount of bytes written
method public unlink (string $path) : bool

remove the data under the given path

Parameters
Name Type Description
$path string
Returns
Type Description
bool
method public url_stat (string $path, int $flags) : array

returns status of url

Parameters
Name Type Description
$path string

path of url to return status for

$flags int

flags set by the stream API

Returns
Type Description
array
Documentation was generated by phpDocumentor 2.0.0a12 .