vfsStreamFile.php

Show: inherited
Table of Contents

File container.

Package
bovigo_vfs  

\vfsStreamFile

Package: bovigo\vfs

File container.

Parent(s)
\vfsStreamAbstractContent < \vfsStreamContent

Properties

Propertyprotectedint  $bytes_read= '0'

amount of read bytes

Default value0Details
Type
int
Propertyprotectedstring  $content= ''

the real content of the file

Details
Type
string
Propertyprotectedint  $group= ''
inherited

owner group of the file

Inherited from: \vfsStreamAbstractContent::$$group
Details
Type
int
Inherited_from
\vfsStreamAbstractContent::$$group  
Propertyprotectedint  $lastAccessed= ''
inherited

timestamp of last access

Inherited from: \vfsStreamAbstractContent::$$lastAccessed
Details
Type
int
Inherited_from
\vfsStreamAbstractContent::$$lastAccessed  
Propertyprotectedint  $lastAttributeModified= ''
inherited

timestamp of last attribute modification

Inherited from: \vfsStreamAbstractContent::$$lastAttributeModified
Details
Type
int
Inherited_from
\vfsStreamAbstractContent::$$lastAttributeModified  
Propertyprotectedint  $lastModified= ''
inherited

timestamp of last modification

Inherited from: \vfsStreamAbstractContent::$$lastModified
Details
Type
int
Inherited_from
\vfsStreamAbstractContent::$$lastModified  
Propertyprotectedint  $lock= 'LOCK_UN'

current lock status of file

Default valueLOCK_UNDetails
Type
int
Propertyprotectedstring  $name= ''
inherited

name of the container

Inherited from: \vfsStreamAbstractContent::$$name
Details
Type
string
Inherited_from
\vfsStreamAbstractContent::$$name  
Propertyprotectedint  $permissions= ''
inherited

permissions for content

Inherited from: \vfsStreamAbstractContent::$$permissions
Details
Type
int
Inherited_from
\vfsStreamAbstractContent::$$permissions  
Propertyprotectedstring  $type= ''
inherited

type of the container

Inherited from: \vfsStreamAbstractContent::$$type
Details
Type
string
Inherited_from
\vfsStreamAbstractContent::$$type  
Propertyprotectedint  $user= ''
inherited

owner of the file

Inherited from: \vfsStreamAbstractContent::$$user
Details
Type
int
Inherited_from
\vfsStreamAbstractContent::$$user  

Methods

methodpublic__construct( string $name, int $permissions = null ) : void

constructor

Parameters
Name Type Description
$name string
$permissions int

optional

methodpublicappliesTo( string $name ) : bool

checks whether the container can be applied to given name

Parameters
Name Type Description
$name string
Returns
Type Description
bool
methodpublicat( \vfsStreamContainer $container ) : \vfsStreamContent
inherited

adds content to given container

Inherited from: \vfsStreamAbstractContent::at()
Parameters
Name Type Description
$container \vfsStreamContainer
Returns
Type Description
\vfsStreamContent
methodpublicchgrp( int $group ) : \vfsStreamContent
inherited

change owner group of file to given group

Inherited from: \vfsStreamAbstractContent::chgrp()
Parameters
Name Type Description
$group int
Returns
Type Description
\vfsStreamContent
methodpublicchmod( int $permissions ) : \vfsStreamContent
inherited

change file mode to given permissions

Inherited from: \vfsStreamAbstractContent::chmod()
Parameters
Name Type Description
$permissions int
Returns
Type Description
\vfsStreamContent
methodpublicchown( int $user ) : \vfsStreamContent
inherited

change owner of file to given user

Inherited from: \vfsStreamAbstractContent::chown()
Parameters
Name Type Description
$user int
Returns
Type Description
\vfsStreamContent
methodpubliceof( ) : bool

checks whether pointer is at end of file

Returns
Type Description
bool
methodpublicfileatime( ) : int
inherited

returns the last access time of the stream content

Inherited from: \vfsStreamAbstractContent::fileatime()
Returns
Type Description
int
Details
Since
0.9  
methodpublicfilectime( ) : int
inherited

returns the last attribute modification time of the stream content

Inherited from: \vfsStreamAbstractContent::filectime()
Returns
Type Description
int
Details
Since
0.9  
methodpublicfilemtime( ) : int
inherited

returns the last modification time of the stream content

Inherited from: \vfsStreamAbstractContent::filemtime()
Returns
Type Description
int
methodpublicgetBytesRead( ) : int

returns the current position within the file

Returns
Type Description
int
methodpublicgetContent( ) : string

returns the contents of the file

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

Returns
Type Description
string
methodprotectedgetDefaultPermissions( ) : int

returns default permissions for concrete implementation

Returns
Type Description
int
Details
Since
0.8.0  
methodpublicgetGroup( ) : int
inherited

returns owner group of file

Inherited from: \vfsStreamAbstractContent::getGroup()
Returns
Type Description
int
methodpublicgetName( ) : string
inherited

returns the file name of the content

Inherited from: \vfsStreamAbstractContent::getName()
Returns
Type Description
string
methodpublicgetPermissions( ) : int
inherited

returns permissions

Inherited from: \vfsStreamAbstractContent::getPermissions()
Returns
Type Description
int
methodpublicgetType( ) : int
inherited

returns the type of the container

Inherited from: \vfsStreamAbstractContent::getType()
Returns
Type Description
int
methodpublicgetUser( ) : int
inherited

returns owner of file

Inherited from: \vfsStreamAbstractContent::getUser()
Returns
Type Description
int
methodpublichasExclusiveLock( ) : bool

checks whether file is locked in exclusive mode

Returns
Type Description
bool
Details
See
\https://github.com/mikey179/vfsStream/issues/6  
Since
0.10.0  
methodpublichasSharedLock( ) : bool

checks whether file is locked in shared mode

Returns
Type Description
bool
Details
See
\https://github.com/mikey179/vfsStream/issues/6  
Since
0.10.0  
methodpublicisExecutable( int $user, int $group ) : bool
inherited

checks whether content is executable

Inherited from: \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
methodpublicisLocked( ) : bool

checks whether file is locked

Returns
Type Description
bool
Details
See
\https://github.com/mikey179/vfsStream/issues/6  
Since
0.10.0  
methodpublicisOwnedByGroup( int $group ) : bool
inherited

checks whether file is owned by group

Inherited from: \vfsStreamAbstractContent::isOwnedByGroup()
Parameters
Name Type Description
$group int
Returns
Type Description
bool
methodpublicisOwnedByUser( int $user ) : bool
inherited

checks whether file is owned by given user

Inherited from: \vfsStreamAbstractContent::isOwnedByUser()
Parameters
Name Type Description
$user int
Returns
Type Description
bool
methodpublicisReadable( int $user, int $group ) : bool
inherited

checks whether content is readable

Inherited from: \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
methodpublicisWritable( int $user, int $group ) : bool
inherited

checks whether content is writable

Inherited from: \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
methodpubliclastAccessed( int $fileatime ) : \vfsStreamContent
inherited

sets last access time of the stream content

Inherited from: \vfsStreamAbstractContent::lastAccessed()
Parameters
Name Type Description
$fileatime int
Returns
Type Description
\vfsStreamContent
Details
Since
0.9  
methodpubliclastAttributeModified( int $filectime ) : \vfsStreamContent
inherited

sets the last attribute modification time of the stream content

Inherited from: \vfsStreamAbstractContent::lastAttributeModified()
Parameters
Name Type Description
$filectime int
Returns
Type Description
\vfsStreamContent
Details
Since
0.9  
methodpubliclastModified( int $filemtime ) : \vfsStreamContent
inherited

sets the last modification time of the stream content

Inherited from: \vfsStreamAbstractContent::lastModified()
Parameters
Name Type Description
$filemtime int
Returns
Type Description
\vfsStreamContent
methodpubliclock( int $operation ) : \vfsStreamFile

locks file for

Parameters
Name Type Description
$operation int
Returns
Type Description
\vfsStreamFile
Details
See
\https://github.com/mikey179/vfsStream/issues/6  
Since
0.10.0  
methodpublicopen( ) : void

simply open the file

Details
Since
0.9  
methodpublicopenForAppend( ) : void

open file and set pointer to end of file

Details
Since
0.9  
methodpublicopenWithTruncate( ) : void

open file and truncate content

Details
Since
0.9  
methodpublicread( 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
methodpublicreadUntilEnd( ) : 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
methodpublicrename( string $newName ) : void
inherited

renames the content

Inherited from: \vfsStreamAbstractContent::rename()
Parameters
Name Type Description
$newName string
methodpublicseek( int $offset, int $whence ) : bool

seeks to the given offset

Parameters
Name Type Description
$offset int
$whence int
Returns
Type Description
bool
methodpublicsetContent( string $content ) : \vfsStreamFile

alias for withContent()

Parameters
Name Type Description
$content string
Returns
Type Description
\vfsStreamFile
Details
See
\withContent()  
methodpublicsize( ) : int

returns size of content

Returns
Type Description
int
methodpublicwithContent( string $content ) : \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
\vfsStreamFile
Details
See
\setContent()  
methodpublicwrite( string $data ) : \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
\amount of written bytes
Documentation was generated by DocBlox 0.18.1.