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/vfsStreamFile.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\vfsStreamFile

Package: Default
File container.
Parent(s)
\org\bovigo\vfs\vfsStreamAbstractContent
Api

Constants

> V Constant TYPE_DIR = 16384

Methods

method public __construct (string $name, int $permissions = null) : void

constructor

Parameters
Name Type Description
$name string
$permissions int

optional

method public appliesTo (string $name) : bool

checks whether the container can be applied to given name

Parameters
Name Type Description
$name string
Returns
Type Description
bool
method public at ( \org\bovigo\vfs\vfsStreamContainer $container) : \org\bovigo\vfs\vfsStreamContent
inherited

adds content to given container

Inherited from: \org\bovigo\vfs\vfsStreamAbstractContent::at()
Parameters
Name Type Description
$container \org\bovigo\vfs\vfsStreamContainer
Returns
Type Description
\org\bovigo\vfs\vfsStreamContent
method public chgrp (int $group) : \org\bovigo\vfs\vfsStreamContent
inherited

change owner group of file to given group

Inherited from: \org\bovigo\vfs\vfsStreamAbstractContent::chgrp()
Parameters
Name Type Description
$group int
Returns
Type Description
\org\bovigo\vfs\vfsStreamContent
method public chmod (int $permissions) : \org\bovigo\vfs\vfsStreamContent
inherited

change file mode to given permissions

Inherited from: \org\bovigo\vfs\vfsStreamAbstractContent::chmod()
Parameters
Name Type Description
$permissions int
Returns
Type Description
\org\bovigo\vfs\vfsStreamContent
method public chown (int $user) : \org\bovigo\vfs\vfsStreamContent
inherited

change owner of file to given user

Inherited from: \org\bovigo\vfs\vfsStreamAbstractContent::chown()
Parameters
Name Type Description
$user int
Returns
Type Description
\org\bovigo\vfs\vfsStreamContent
method public eof () : bool

checks whether pointer is at end of file

Returns
Type Description
bool
method public fileatime () : int
inherited

returns the last access time of the stream content

Inherited from: \org\bovigo\vfs\vfsStreamAbstractContent::fileatime()
Returns
Type Description
int
Details
Since
0.9
method public filectime () : int
inherited

returns the last attribute modification time of the stream content

Inherited from: \org\bovigo\vfs\vfsStreamAbstractContent::filectime()
Returns
Type Description
int
Details
Since
0.9
method public filemtime () : int
inherited

returns the last modification time of the stream content

Inherited from: \org\bovigo\vfs\vfsStreamAbstractContent::filemtime()
Returns
Type Description
int
method public getBytesRead () : int

returns the current position within the file

Returns
Type Description
int
method public getContent () : string

returns the contents of the file

Getting content does not change the time when the file was last accessed.

Returns
Type Description
string
method public getGroup () : int
inherited

returns owner group of file

Inherited from: \org\bovigo\vfs\vfsStreamAbstractContent::getGroup()
Returns
Type Description
int
method public getName () : string
inherited

returns the file name of the content

Inherited from: \org\bovigo\vfs\vfsStreamAbstractContent::getName()
Returns
Type Description
string
method public getPermissions () : int
inherited

returns permissions

Inherited from: \org\bovigo\vfs\vfsStreamAbstractContent::getPermissions()
Returns
Type Description
int
method public getResourceId (resource | \org\bovigo\vfs\vfsStreamWrapper $resource) : string

Returns unique resource id

Parameters
Name Type Description
$resource resource | \org\bovigo\vfs\vfsStreamWrapper
Returns
Type Description
string
Details
See
\org\bovigo\vfs\https://github.com/mikey179/vfsStream/issues/40
method public getType () : int
inherited

returns the type of the container

Inherited from: \org\bovigo\vfs\vfsStreamAbstractContent::getType()
Returns
Type Description
int
method public getUser () : int
inherited

returns owner of file

Inherited from: \org\bovigo\vfs\vfsStreamAbstractContent::getUser()
Returns
Type Description
int
method public hasExclusiveLock (resource | \org\bovigo\vfs\vfsStreamWrapper $resource = null) : bool

checks whether file is locked in exclusive mode

Parameters
Name Type Description
$resource resource | \org\bovigo\vfs\vfsStreamWrapper
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/40
Since
0.10.0
method public hasSharedLock (resource | \org\bovigo\vfs\vfsStreamWrapper $resource = null) : bool

checks whether file is locked in shared mode

Parameters
Name Type Description
$resource resource | \org\bovigo\vfs\vfsStreamWrapper
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/40
Since
0.10.0
method public isExecutable (int $user, int $group) : bool
inherited

checks whether content is executable

Inherited from: \org\bovigo\vfs\vfsStreamAbstractContent::isExecutable()
Parameters
Name Type Description
$user int

id of user to check for

$group int

id of group to check for

Returns
Type Description
bool
method public isLocked (resource | \org\bovigo\vfs\vfsStreamWrapper $resource = null) : bool

checks whether file is locked

Parameters
Name Type Description
$resource resource | \org\bovigo\vfs\vfsStreamWrapper
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/40
Since
0.10.0
method public isOwnedByGroup (int $group) : bool
inherited

checks whether file is owned by group

Inherited from: \org\bovigo\vfs\vfsStreamAbstractContent::isOwnedByGroup()
Parameters
Name Type Description
$group int
Returns
Type Description
bool
method public isOwnedByUser (int $user) : bool
inherited

checks whether file is owned by given user

Inherited from: \org\bovigo\vfs\vfsStreamAbstractContent::isOwnedByUser()
Parameters
Name Type Description
$user int
Returns
Type Description
bool
method public isReadable (int $user, int $group) : bool
inherited

checks whether content is readable

Inherited from: \org\bovigo\vfs\vfsStreamAbstractContent::isReadable()
Parameters
Name Type Description
$user int

id of user to check for

$group int

id of group to check for

Returns
Type Description
bool
method public isWritable (int $user, int $group) : bool
inherited

checks whether content is writable

Inherited from: \org\bovigo\vfs\vfsStreamAbstractContent::isWritable()
Parameters
Name Type Description
$user int

id of user to check for

$group int

id of group to check for

Returns
Type Description
bool
method public lastAccessed (int $fileatime) : \org\bovigo\vfs\vfsStreamContent
inherited

sets last access time of the stream content

Inherited from: \org\bovigo\vfs\vfsStreamAbstractContent::lastAccessed()
Parameters
Name Type Description
$fileatime int
Returns
Type Description
\org\bovigo\vfs\vfsStreamContent
Details
Since
0.9
method public lastAttributeModified (int $filectime) : \org\bovigo\vfs\vfsStreamContent
inherited

sets the last attribute modification time of the stream content

Inherited from: \org\bovigo\vfs\vfsStreamAbstractContent::lastAttributeModified()
Parameters
Name Type Description
$filectime int
Returns
Type Description
\org\bovigo\vfs\vfsStreamContent
Details
Since
0.9
method public lastModified (int $filemtime) : \org\bovigo\vfs\vfsStreamContent
inherited

sets the last modification time of the stream content

Inherited from: \org\bovigo\vfs\vfsStreamAbstractContent::lastModified()
Parameters
Name Type Description
$filemtime int
Returns
Type Description
\org\bovigo\vfs\vfsStreamContent
method public lock (resource | \org\bovigo\vfs\vfsStreamWrapper $resource, int $operation) : bool

locks file for

Parameters
Name Type Description
$resource resource | \org\bovigo\vfs\vfsStreamWrapper
$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/40
Since
0.10.0
method public open () : void

simply open the file

Details
Since
0.9
method public openForAppend () : void

open file and set pointer to end of file

Details
Since
0.9
method public openWithTruncate () : void

open file and truncate content

Details
Since
0.9
method public path () : string
inherited

returns path to this content

Inherited from: \org\bovigo\vfs\vfsStreamAbstractContent::path()
Returns
Type Description
string
Details
Since
1.2.0
method public read (int $count) : string

reads the given amount of bytes from content

Using this method changes the time when the file was last accessed.

Parameters
Name Type Description
$count int
Returns
Type Description
string
method public readUntilEnd () : string

returns the content until its end from current offset

Using this method changes the time when the file was last accessed.

Returns
Type Description
string
method public rename (string $newName) : void
inherited

renames the content

Inherited from: \org\bovigo\vfs\vfsStreamAbstractContent::rename()
Parameters
Name Type Description
$newName string
method public 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 setContent (string $content) : \org\bovigo\vfs\vfsStreamFile

alias for withContent()

Parameters
Name Type Description
$content string
Returns
Type Description
\org\bovigo\vfs\vfsStreamFile
Details
See
\org\bovigo\vfs\withContent()
method public size () : int

returns size of content

Returns
Type Description
int
method public 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 unlock (resource | \org\bovigo\vfs\vfsStreamWrapper $resource) : void

Removes lock from file acquired by given resource

Parameters
Name Type Description
$resource resource | \org\bovigo\vfs\vfsStreamWrapper
Details
See
\org\bovigo\vfs\https://github.com/mikey179/vfsStream/issues/40
method public url () : string
inherited

returns complete vfsStream url for this content

Inherited from: \org\bovigo\vfs\vfsStreamAbstractContent::url()
Returns
Type Description
string
Details
Since
1.2.0
method public withContent (string $content) : \org\bovigo\vfs\vfsStreamFile

sets the contents of the file

Setting content with this method does not change the time when the file was last modified.

Parameters
Name Type Description
$content string
Returns
Type Description
\org\bovigo\vfs\vfsStreamFile
method public write (string $data) : \org\bovigo\vfs\amount

writes an amount of data

Using this method changes the time when the file was last modified.

Parameters
Name Type Description
$data string
Returns
Type Description
\org\bovigo\vfs\amount of written bytes
Documentation was generated by phpDocumentor 2.0.0a12 .