File container.

api

 Methods

constructor

__construct(string $name, int $permissions) 

Parameters

$name

string

$permissions

int

optional

checks whether the container can be applied to given name

appliesTo(string $name) : bool

Parameters

$name

string

Returns

bool

adds content to given container

at(\org\bovigo\vfs\vfsStreamContainer $container) : \org\bovigo\vfs\vfsStreamContent
Inherited

inherited_from \org\bovigo\vfs\vfsStreamAbstractContent::at()

Parameters

Returns

change owner group of file to given group

chgrp(int $group) : \org\bovigo\vfs\vfsStreamContent
Inherited

inherited_from \org\bovigo\vfs\vfsStreamAbstractContent::chgrp()

Parameters

$group

int

Returns

change file mode to given permissions

chmod(int $permissions) : \org\bovigo\vfs\vfsStreamContent
Inherited

inherited_from \org\bovigo\vfs\vfsStreamAbstractContent::chmod()

Parameters

$permissions

int

Returns

change owner of file to given user

chown(int $user) : \org\bovigo\vfs\vfsStreamContent
Inherited

inherited_from \org\bovigo\vfs\vfsStreamAbstractContent::chown()

Parameters

$user

int

Returns

checks whether pointer is at end of file

eof() : bool

Returns

bool

returns the last access time of the stream content

fileatime() : int
Inherited

since 0.9
inherited_from \org\bovigo\vfs\vfsStreamAbstractContent::fileatime()

Returns

int

returns the last attribute modification time of the stream content

filectime() : int
Inherited

since 0.9
inherited_from \org\bovigo\vfs\vfsStreamAbstractContent::filectime()

Returns

int

returns the last modification time of the stream content

filemtime() : int
Inherited

inherited_from \org\bovigo\vfs\vfsStreamAbstractContent::filemtime()

Returns

int

returns the current position within the file

getBytesRead() : int

deprecated since 1.3.0

Returns

int

returns the contents of the file

getContent() : string

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

Returns

string

returns owner group of file

getGroup() : int
Inherited

inherited_from \org\bovigo\vfs\vfsStreamAbstractContent::getGroup()

Returns

int

returns the file name of the content

getName() : string
Inherited

inherited_from \org\bovigo\vfs\vfsStreamAbstractContent::getName()

Returns

string

returns permissions

getPermissions() : int
Inherited

inherited_from \org\bovigo\vfs\vfsStreamAbstractContent::getPermissions()

Returns

int

Returns unique resource id

getResourceId(resource | \org\bovigo\vfs\vfsStreamWrapper $resource) : string

see \org\bovigo\vfs\https://github.com/mikey179/vfsStream/issues/40

Parameters

Returns

string

returns the type of the container

getType() : int
Inherited

inherited_from \org\bovigo\vfs\vfsStreamAbstractContent::getType()

Returns

int

returns owner of file

getUser() : int
Inherited

inherited_from \org\bovigo\vfs\vfsStreamAbstractContent::getUser()

Returns

int

checks whether file is locked in exclusive mode

hasExclusiveLock(resource | \org\bovigo\vfs\vfsStreamWrapper $resource) : bool

since 0.10.0
see \org\bovigo\vfs\https://github.com/mikey179/vfsStream/issues/6
see \org\bovigo\vfs\https://github.com/mikey179/vfsStream/issues/40

Parameters

Returns

bool

checks whether file is locked in shared mode

hasSharedLock(resource | \org\bovigo\vfs\vfsStreamWrapper $resource) : bool

since 0.10.0
see \org\bovigo\vfs\https://github.com/mikey179/vfsStream/issues/6
see \org\bovigo\vfs\https://github.com/mikey179/vfsStream/issues/40

Parameters

Returns

bool

checks whether content is executable

isExecutable(int $user, int $group) : bool
Inherited

inherited_from \org\bovigo\vfs\vfsStreamAbstractContent::isExecutable()

Parameters

$user

int

id of user to check for

$group

int

id of group to check for

Returns

bool

checks whether file is locked

isLocked(resource | \org\bovigo\vfs\vfsStreamWrapper $resource) : bool

since 0.10.0
see \org\bovigo\vfs\https://github.com/mikey179/vfsStream/issues/6
see \org\bovigo\vfs\https://github.com/mikey179/vfsStream/issues/40

Parameters

Returns

bool

checks whether file is owned by group

isOwnedByGroup(int $group) : bool
Inherited

inherited_from \org\bovigo\vfs\vfsStreamAbstractContent::isOwnedByGroup()

Parameters

$group

int

Returns

bool

checks whether file is owned by given user

isOwnedByUser(int $user) : bool
Inherited

inherited_from \org\bovigo\vfs\vfsStreamAbstractContent::isOwnedByUser()

Parameters

$user

int

Returns

bool

checks whether content is readable

isReadable(int $user, int $group) : bool
Inherited

inherited_from \org\bovigo\vfs\vfsStreamAbstractContent::isReadable()

Parameters

$user

int

id of user to check for

$group

int

id of group to check for

Returns

bool

checks whether content is writable

isWritable(int $user, int $group) : bool
Inherited

inherited_from \org\bovigo\vfs\vfsStreamAbstractContent::isWritable()

Parameters

$user

int

id of user to check for

$group

int

id of group to check for

Returns

bool

sets last access time of the stream content

lastAccessed(int $fileatime) : \org\bovigo\vfs\vfsStreamContent
Inherited

since 0.9
inherited_from \org\bovigo\vfs\vfsStreamAbstractContent::lastAccessed()

Parameters

$fileatime

int

Returns

sets the last attribute modification time of the stream content

lastAttributeModified(int $filectime) : \org\bovigo\vfs\vfsStreamContent
Inherited

since 0.9
inherited_from \org\bovigo\vfs\vfsStreamAbstractContent::lastAttributeModified()

Parameters

$filectime

int

Returns

sets the last modification time of the stream content

lastModified(int $filemtime) : \org\bovigo\vfs\vfsStreamContent
Inherited

inherited_from \org\bovigo\vfs\vfsStreamAbstractContent::lastModified()

Parameters

$filemtime

int

Returns

locks file for

lock(resource | \org\bovigo\vfs\vfsStreamWrapper $resource, int $operation) : bool

since 0.10.0
see \org\bovigo\vfs\https://github.com/mikey179/vfsStream/issues/6
see \org\bovigo\vfs\https://github.com/mikey179/vfsStream/issues/40

Parameters

$operation

int

Returns

bool

simply open the file

open() 

since 0.9

open file and set pointer to end of file

openForAppend() 

since 0.9

open file and truncate content

openWithTruncate() 

since 0.9

returns path to this content

path() : string
Inherited

since 1.2.0
inherited_from \org\bovigo\vfs\vfsStreamAbstractContent::path()

Returns

string

reads the given amount of bytes from content

read(int $count) : string

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

Parameters

$count

int

Returns

string

returns the content until its end from current offset

readUntilEnd() : string

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

deprecated since 1.3.0

Returns

string

renames the content

rename(string $newName) 
Inherited

inherited_from \org\bovigo\vfs\vfsStreamAbstractContent::rename()

Parameters

$newName

string

seeks to the given offset

seek(int $offset, int $whence) : bool

Parameters

$offset

int

$whence

int

Returns

bool

alias for withContent()

setContent(string $content) : \org\bovigo\vfs\vfsStreamFile

see \org\bovigo\vfs\withContent()

Parameters

$content

string

Returns

returns size of content

size() : int

Returns

int

Truncates a file to a given length

truncate(int $size) : bool

since 1.1.0

Parameters

$size

int

length to truncate file to

Returns

bool

Removes lock from file acquired by given resource

unlock(resource | \org\bovigo\vfs\vfsStreamWrapper $resource) 

see \org\bovigo\vfs\https://github.com/mikey179/vfsStream/issues/40

Parameters

returns complete vfsStream url for this content

url() : string
Inherited

since 1.2.0
inherited_from \org\bovigo\vfs\vfsStreamAbstractContent::url()

Returns

string

sets the contents of the file

withContent(\org\bovigo\vfs\string]FileContent $content) : \org\bovigo\vfs\vfsStreamFile

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

Parameters

$content

\org\bovigo\vfs\string]FileContent

Exceptions

\InvalidArgumentException

Returns

writes an amount of data

write(string $data) : \org\bovigo\vfs\amount

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

Parameters

$data

string

Returns

\org\bovigo\vfs\amountof written bytes

Add shared lock on file by given resource

addSharedLock(resource | \org\bovigo\vfs\vfsStreamWrapper $resource) 

see \org\bovigo\vfs\https://github.com/mikey179/vfsStream/issues/40

Parameters

returns default permissions for concrete implementation

getDefaultPermissions() : int

since 0.8.0

Returns

int

Set exlusive lock on file by given resource

setExclusiveLock(resource | \org\bovigo\vfs\vfsStreamWrapper $resource) 

see \org\bovigo\vfs\https://github.com/mikey179/vfsStream/issues/40

Parameters

 Properties

 

Resource id which exclusively locked this file

$exclusiveLock 

type string
 

owner group of the file

$group 
Inherited

type int
inherited_from \org\bovigo\vfs\vfsStreamAbstractContent::$$group
 

timestamp of last access

$lastAccessed 
Inherited

type int
inherited_from \org\bovigo\vfs\vfsStreamAbstractContent::$$lastAccessed
 

timestamp of last attribute modification

$lastAttributeModified 
Inherited

type int
inherited_from \org\bovigo\vfs\vfsStreamAbstractContent::$$lastAttributeModified
 

timestamp of last modification

$lastModified 
Inherited

type int
inherited_from \org\bovigo\vfs\vfsStreamAbstractContent::$$lastModified
 

name of the container

$name 
Inherited

type string
inherited_from \org\bovigo\vfs\vfsStreamAbstractContent::$$name
 

permissions for content

$permissions 
Inherited

type int
inherited_from \org\bovigo\vfs\vfsStreamAbstractContent::$$permissions
 

Resources ids which currently holds shared lock to this file

$sharedLock 

type bool[string]
 

type of the container

$type 
Inherited

type string
inherited_from \org\bovigo\vfs\vfsStreamAbstractContent::$$type
 

owner of the file

$user 
Inherited

type int
inherited_from \org\bovigo\vfs\vfsStreamAbstractContent::$$user
 

content of the file

$content 

type FileContent
 

path to to this content

$parentPath 
Inherited

type string
inherited_from \org\bovigo\vfs\vfsStreamAbstractContent::$$parentPath

 Constants

 

stream content type: directory

TYPE_DIR 
Inherited

see \org\bovigo\vfs\getType()
inherited_from \org\bovigo\vfs\vfsStreamContent::TYPE_DIR
inherited_from \org\bovigo\vfs\vfsStreamAbstractContent::TYPE_DIR
 

stream content type: file

TYPE_FILE 
Inherited

see \org\bovigo\vfs\getType()
inherited_from \org\bovigo\vfs\vfsStreamContent::TYPE_FILE
inherited_from \org\bovigo\vfs\vfsStreamAbstractContent::TYPE_FILE