vfsStreamFile
extends vfsStreamAbstractContent
in package
File container.
Table of Contents
- $exclusiveLock : mixed
- Resource id which exclusively locked this file
- $group : mixed
- owner group of the file
- $lastAccessed : mixed
- timestamp of last access
- $lastAttributeModified : mixed
- timestamp of last attribute modification
- $lastModified : mixed
- timestamp of last modification
- $name : mixed
- name of the container
- $permissions : mixed
- permissions for content
- $sharedLock : mixed
- Resources ids which currently holds shared lock to this file
- $type : mixed
- type of the container
- $user : mixed
- owner of the file
- $content : mixed
- content of the file
- $parentPath : mixed
- path to to this content
- __construct() : mixed
- constructor
- appliesTo() : bool
- checks whether the container can be applied to given name
- at() : $this
- adds content to given container
- chgrp() : $this
- change owner group of file to given group
- chmod() : $this
- change file mode to given permissions
- chown() : $this
- change owner of file to given user
- eof() : bool
- checks whether pointer is at end of file
- fileatime() : int
- returns the last access time of the stream content
- filectime() : int
- returns the last attribute modification time of the stream content
- filemtime() : int
- returns the last modification time of the stream content
- getBytesRead() : int
- returns the current position within the file
- getContent() : string
- returns the contents of the file
- getGroup() : int
- returns owner group of file
- getName() : string
- returns the file name of the content
- getPermissions() : int
- returns permissions
- getResourceId() : string
- Returns unique resource id
- getType() : int
- returns the type of the container
- getUser() : int
- returns owner of file
- hasExclusiveLock() : bool
- checks whether file is locked in exclusive mode
- hasSharedLock() : bool
- checks whether file is locked in shared mode
- isExecutable() : bool
- checks whether content is executable
- isLocked() : bool
- checks whether file is locked
- isOwnedByGroup() : bool
- checks whether file is owned by group
- isOwnedByUser() : bool
- checks whether file is owned by given user
- isReadable() : bool
- checks whether content is readable
- isWritable() : bool
- checks whether content is writable
- lastAccessed() : $this
- sets last access time of the stream content
- lastAttributeModified() : $this
- sets the last attribute modification time of the stream content
- lastModified() : $this
- sets the last modification time of the stream content
- lock() : bool
- locks file for
- open() : mixed
- simply open the file
- openForAppend() : mixed
- open file and set pointer to end of file
- openWithTruncate() : mixed
- open file and truncate content
- path() : string
- returns path to this content
- read() : string
- reads the given amount of bytes from content
- readUntilEnd() : string
- returns the content until its end from current offset
- rename() : mixed
- renames the content
- seek() : bool
- seeks to the given offset
- setContent() : vfsStreamFile
- alias for withContent()
- size() : int
- returns size of content
- truncate() : bool
- Truncates a file to a given length
- unlock() : mixed
- Removes lock from file acquired by given resource
- url() : string
- returns complete vfsStream url for this content
- withContent() : vfsStreamFile
- sets the contents of the file
- write() : int
- writes an amount of data
- addSharedLock() : mixed
- Add shared lock on file by given resource
- getDefaultPermissions() : int
- returns default permissions for concrete implementation
- setExclusiveLock() : mixed
- Set exlusive lock on file by given resource
Properties
$exclusiveLock
Resource id which exclusively locked this file
protected
mixed
$exclusiveLock
Tags
$group
owner group of the file
protected
mixed
$group
Tags
$lastAccessed
timestamp of last access
protected
mixed
$lastAccessed
Tags
$lastAttributeModified
timestamp of last attribute modification
protected
mixed
$lastAttributeModified
Tags
$lastModified
timestamp of last modification
protected
mixed
$lastModified
Tags
$name
name of the container
protected
mixed
$name
Tags
$permissions
permissions for content
protected
mixed
$permissions
Tags
$sharedLock
Resources ids which currently holds shared lock to this file
protected
mixed
$sharedLock
= array()
Tags
$type
type of the container
protected
mixed
$type
Tags
$user
owner of the file
protected
mixed
$user
Tags
$content
content of the file
private
mixed
$content
Tags
$parentPath
path to to this content
private
mixed
$parentPath
Tags
Methods
__construct()
constructor
public
__construct(string $name[, int $permissions = null ]) : mixed
Parameters
- $name : string
- $permissions : int = null
-
optional
Return values
mixed —appliesTo()
checks whether the container can be applied to given name
public
appliesTo(string $name) : bool
Parameters
- $name : string
Return values
bool —at()
adds content to given container
public
at(vfsStreamContainer $container) : $this
Parameters
- $container : vfsStreamContainer
Return values
$this —chgrp()
change owner group of file to given group
public
chgrp(int $group) : $this
Parameters
- $group : int
Return values
$this —chmod()
change file mode to given permissions
public
chmod(int $permissions) : $this
Parameters
- $permissions : int
Return values
$this —chown()
change owner of file to given user
public
chown(int $user) : $this
Parameters
- $user : int
Return values
$this —eof()
checks whether pointer is at end of file
public
eof() : bool
Return values
bool —fileatime()
returns the last access time of the stream content
public
fileatime() : int
Tags
Return values
int —filectime()
returns the last attribute modification time of the stream content
public
filectime() : int
Tags
Return values
int —filemtime()
returns the last modification time of the stream content
public
filemtime() : int
Return values
int —getBytesRead()
returns the current position within the file
public
getBytesRead() : int
Tags
Return values
int —getContent()
returns the contents of the file
public
getContent() : string
Getting content does not change the time when the file was last accessed.
Return values
string —getGroup()
returns owner group of file
public
getGroup() : int
Return values
int —getName()
returns the file name of the content
public
getName() : string
Return values
string —getPermissions()
returns permissions
public
getPermissions() : int
Return values
int —getResourceId()
Returns unique resource id
public
getResourceId(resource|vfsStreamWrapper $resource) : string
Parameters
- $resource : resource|vfsStreamWrapper
Tags
Return values
string —getType()
returns the type of the container
public
getType() : int
Return values
int —getUser()
returns owner of file
public
getUser() : int
Return values
int —hasExclusiveLock()
checks whether file is locked in exclusive mode
public
hasExclusiveLock([resource|vfsStreamWrapper $resource = null ]) : bool
Parameters
- $resource : resource|vfsStreamWrapper = null
Tags
Return values
bool —hasSharedLock()
checks whether file is locked in shared mode
public
hasSharedLock([resource|vfsStreamWrapper $resource = null ]) : bool
Parameters
- $resource : resource|vfsStreamWrapper = null
Tags
Return values
bool —isExecutable()
checks whether content is executable
public
isExecutable(int $user, int $group) : bool
Parameters
- $user : int
-
id of user to check for
- $group : int
-
id of group to check for
Return values
bool —isLocked()
checks whether file is locked
public
isLocked([resource|vfsStreamWrapper $resource = null ]) : bool
Parameters
- $resource : resource|vfsStreamWrapper = null
Tags
Return values
bool —isOwnedByGroup()
checks whether file is owned by group
public
isOwnedByGroup(int $group) : bool
Parameters
- $group : int
Return values
bool —isOwnedByUser()
checks whether file is owned by given user
public
isOwnedByUser(int $user) : bool
Parameters
- $user : int
Return values
bool —isReadable()
checks whether content is readable
public
isReadable(int $user, int $group) : bool
Parameters
- $user : int
-
id of user to check for
- $group : int
-
id of group to check for
Return values
bool —isWritable()
checks whether content is writable
public
isWritable(int $user, int $group) : bool
Parameters
- $user : int
-
id of user to check for
- $group : int
-
id of group to check for
Return values
bool —lastAccessed()
sets last access time of the stream content
public
lastAccessed(int $fileatime) : $this
Parameters
- $fileatime : int
Tags
Return values
$this —lastAttributeModified()
sets the last attribute modification time of the stream content
public
lastAttributeModified(int $filectime) : $this
Parameters
- $filectime : int
Tags
Return values
$this —lastModified()
sets the last modification time of the stream content
public
lastModified(int $filemtime) : $this
Parameters
- $filemtime : int
Return values
$this —lock()
locks file for
public
lock(resource|vfsStreamWrapper $resource, int $operation) : bool
Parameters
- $resource : resource|vfsStreamWrapper
- $operation : int
Tags
Return values
bool —open()
simply open the file
public
open() : mixed
Tags
Return values
mixed —openForAppend()
open file and set pointer to end of file
public
openForAppend() : mixed
Tags
Return values
mixed —openWithTruncate()
open file and truncate content
public
openWithTruncate() : mixed
Tags
Return values
mixed —path()
returns path to this content
public
path() : string
Tags
Return values
string —read()
reads the given amount of bytes from content
public
read(int $count) : string
Using this method changes the time when the file was last accessed.
Parameters
- $count : int
Return values
string —readUntilEnd()
returns the content until its end from current offset
public
readUntilEnd() : string
Using this method changes the time when the file was last accessed.
Tags
Return values
string —rename()
renames the content
public
rename(string $newName) : mixed
Parameters
- $newName : string
Return values
mixed —seek()
seeks to the given offset
public
seek(int $offset, int $whence) : bool
Parameters
- $offset : int
- $whence : int
Return values
bool —setContent()
alias for withContent()
public
setContent(string $content) : vfsStreamFile
Parameters
- $content : string
Tags
Return values
vfsStreamFile —size()
returns size of content
public
size() : int
Return values
int —truncate()
Truncates a file to a given length
public
truncate(int $size) : bool
Parameters
- $size : int
-
length to truncate file to
Tags
Return values
bool —unlock()
Removes lock from file acquired by given resource
public
unlock(resource|vfsStreamWrapper $resource) : mixed
Parameters
- $resource : resource|vfsStreamWrapper
Tags
Return values
mixed —url()
returns complete vfsStream url for this content
public
url() : string
Tags
Return values
string —withContent()
sets the contents of the file
public
withContent(mixed $content) : vfsStreamFile
Setting content with this method does not change the time when the file was last modified.
Parameters
- $content : mixed
Tags
Return values
vfsStreamFile —write()
writes an amount of data
public
write(string $data) : int
Using this method changes the time when the file was last modified.
Parameters
- $data : string
Return values
int —amount of written bytes
addSharedLock()
Add shared lock on file by given resource
protected
addSharedLock(resource|vfsStreamWrapper $resource) : mixed
Parameters
- $resource : resource|vfsStreamWrapper
Tags
Return values
mixed —getDefaultPermissions()
returns default permissions for concrete implementation
protected
getDefaultPermissions() : int
Tags
Return values
int —setExclusiveLock()
Set exlusive lock on file by given resource
protected
setExclusiveLock(resource|vfsStreamWrapper $resource) : mixed
Parameters
- $resource : resource|vfsStreamWrapper