third_party/vfsstream/vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/vfsStreamFile.php
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
- Parent(s)
- \org\bovigo\vfs\vfsStreamAbstractContent
- Api
Constants
TYPE_FILE
= 32768
- Inherited_from
- \org\bovigo\vfs\vfsStreamContent::TYPE_FILE
- Inherited_from
- \org\bovigo\vfs\vfsStreamAbstractContent::TYPE_FILE
- See
- \org\bovigo\vfs\getType()
TYPE_DIR
= 16384
- Inherited_from
- \org\bovigo\vfs\vfsStreamContent::TYPE_DIR
- Inherited_from
- \org\bovigo\vfs\vfsStreamAbstractContent::TYPE_DIR
- See
- \org\bovigo\vfs\getType()
Methods
__construct
(string $name, int $permissions = null)
: void
constructor
| Name | Type | Description |
|---|---|---|
| $name | string | |
| $permissions | int |
optional |
appliesTo
(string $name)
: bool
checks whether the container can be applied to given name
| Name | Type | Description |
|---|---|---|
| $name | string |
| Type | Description |
|---|---|
| bool |
at
(
\org\bovigo\vfs\vfsStreamContainer
$container)
:
\org\bovigo\vfs\vfsStreamContent
adds content to given container
Inherited from: \org\bovigo\vfs\vfsStreamAbstractContent::at()| Name | Type | Description |
|---|---|---|
| $container | \org\bovigo\vfs\vfsStreamContainer |
| Type | Description |
|---|---|
| \org\bovigo\vfs\vfsStreamContent |
chgrp
(int $group)
:
\org\bovigo\vfs\vfsStreamContent
change owner group of file to given group
Inherited from: \org\bovigo\vfs\vfsStreamAbstractContent::chgrp()| Name | Type | Description |
|---|---|---|
| $group | int |
| Type | Description |
|---|---|
| \org\bovigo\vfs\vfsStreamContent |
chmod
(int $permissions)
:
\org\bovigo\vfs\vfsStreamContent
change file mode to given permissions
Inherited from: \org\bovigo\vfs\vfsStreamAbstractContent::chmod()| Name | Type | Description |
|---|---|---|
| $permissions | int |
| Type | Description |
|---|---|
| \org\bovigo\vfs\vfsStreamContent |
chown
(int $user)
:
\org\bovigo\vfs\vfsStreamContent
change owner of file to given user
Inherited from: \org\bovigo\vfs\vfsStreamAbstractContent::chown()| Name | Type | Description |
|---|---|---|
| $user | int |
| Type | Description |
|---|---|
| \org\bovigo\vfs\vfsStreamContent |
fileatime
()
: int
returns the last access time of the stream content
Inherited from: \org\bovigo\vfs\vfsStreamAbstractContent::fileatime()| Type | Description |
|---|---|
| int |
- Since
- 0.9
filectime
()
: int
returns the last attribute modification time of the stream content
Inherited from: \org\bovigo\vfs\vfsStreamAbstractContent::filectime()| Type | Description |
|---|---|
| int |
- Since
- 0.9
filemtime
()
: int
returns the last modification time of the stream content
Inherited from: \org\bovigo\vfs\vfsStreamAbstractContent::filemtime()| Type | Description |
|---|---|
| int |
getContent
()
: string
returns the contents of the file
Getting content does not change the time when the file was last accessed.
| Type | Description |
|---|---|
| string |
getGroup
()
: int
returns owner group of file
Inherited from: \org\bovigo\vfs\vfsStreamAbstractContent::getGroup()| Type | Description |
|---|---|
| int |
getName
()
: string
returns the file name of the content
Inherited from: \org\bovigo\vfs\vfsStreamAbstractContent::getName()| Type | Description |
|---|---|
| string |
getPermissions
()
: int
returns permissions
Inherited from: \org\bovigo\vfs\vfsStreamAbstractContent::getPermissions()| Type | Description |
|---|---|
| int |
getResourceId
(resource |
\org\bovigo\vfs\vfsStreamWrapper
$resource)
: string
Returns unique resource id
| Name | Type | Description |
|---|---|---|
| $resource | resource | \org\bovigo\vfs\vfsStreamWrapper |
| Type | Description |
|---|---|
| string |
- See
- \org\bovigo\vfs\https://github.com/mikey179/vfsStream/issues/40
getType
()
: int
returns the type of the container
Inherited from: \org\bovigo\vfs\vfsStreamAbstractContent::getType()| Type | Description |
|---|---|
| int |
hasExclusiveLock
(resource |
\org\bovigo\vfs\vfsStreamWrapper
$resource = null)
: bool
checks whether file is locked in exclusive mode
| Name | Type | Description |
|---|---|---|
| $resource | resource | \org\bovigo\vfs\vfsStreamWrapper |
| Type | Description |
|---|---|
| bool |
- 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
hasSharedLock
(resource |
\org\bovigo\vfs\vfsStreamWrapper
$resource = null)
: bool
checks whether file is locked in shared mode
| Name | Type | Description |
|---|---|---|
| $resource | resource | \org\bovigo\vfs\vfsStreamWrapper |
| Type | Description |
|---|---|
| bool |
- 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
isExecutable
(int $user, int $group)
: bool
checks whether content is executable
Inherited from: \org\bovigo\vfs\vfsStreamAbstractContent::isExecutable()| Name | Type | Description |
|---|---|---|
| $user | int |
id of user to check for |
| $group | int |
id of group to check for |
| Type | Description |
|---|---|
| bool |
isLocked
(resource |
\org\bovigo\vfs\vfsStreamWrapper
$resource = null)
: bool
checks whether file is locked
| Name | Type | Description |
|---|---|---|
| $resource | resource | \org\bovigo\vfs\vfsStreamWrapper |
| Type | Description |
|---|---|
| bool |
- 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
isOwnedByGroup
(int $group)
: bool
checks whether file is owned by group
Inherited from: \org\bovigo\vfs\vfsStreamAbstractContent::isOwnedByGroup()| Name | Type | Description |
|---|---|---|
| $group | int |
| Type | Description |
|---|---|
| bool |
isOwnedByUser
(int $user)
: bool
checks whether file is owned by given user
Inherited from: \org\bovigo\vfs\vfsStreamAbstractContent::isOwnedByUser()| Name | Type | Description |
|---|---|---|
| $user | int |
| Type | Description |
|---|---|
| bool |
isReadable
(int $user, int $group)
: bool
checks whether content is readable
Inherited from: \org\bovigo\vfs\vfsStreamAbstractContent::isReadable()| Name | Type | Description |
|---|---|---|
| $user | int |
id of user to check for |
| $group | int |
id of group to check for |
| Type | Description |
|---|---|
| bool |
isWritable
(int $user, int $group)
: bool
checks whether content is writable
Inherited from: \org\bovigo\vfs\vfsStreamAbstractContent::isWritable()| Name | Type | Description |
|---|---|---|
| $user | int |
id of user to check for |
| $group | int |
id of group to check for |
| Type | Description |
|---|---|
| bool |
lastAccessed
(int $fileatime)
:
\org\bovigo\vfs\vfsStreamContent
sets last access time of the stream content
Inherited from: \org\bovigo\vfs\vfsStreamAbstractContent::lastAccessed()| Name | Type | Description |
|---|---|---|
| $fileatime | int |
| Type | Description |
|---|---|
| \org\bovigo\vfs\vfsStreamContent |
- Since
- 0.9
lastAttributeModified
(int $filectime)
:
\org\bovigo\vfs\vfsStreamContent
sets the last attribute modification time of the stream content
Inherited from: \org\bovigo\vfs\vfsStreamAbstractContent::lastAttributeModified()| Name | Type | Description |
|---|---|---|
| $filectime | int |
| Type | Description |
|---|---|
| \org\bovigo\vfs\vfsStreamContent |
- Since
- 0.9
lastModified
(int $filemtime)
:
\org\bovigo\vfs\vfsStreamContent
sets the last modification time of the stream content
Inherited from: \org\bovigo\vfs\vfsStreamAbstractContent::lastModified()| Name | Type | Description |
|---|---|---|
| $filemtime | int |
| Type | Description |
|---|---|
| \org\bovigo\vfs\vfsStreamContent |
lock
(resource |
\org\bovigo\vfs\vfsStreamWrapper
$resource, int $operation)
: bool
locks file for
| Name | Type | Description |
|---|---|---|
| $resource | resource | \org\bovigo\vfs\vfsStreamWrapper | |
| $operation | int |
| Type | Description |
|---|---|
| bool |
- 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
path
()
: string
returns path to this content
Inherited from: \org\bovigo\vfs\vfsStreamAbstractContent::path()| Type | Description |
|---|---|
| string |
- Since
- 1.2.0
read
(int $count)
: string
reads the given amount of bytes from content
Using this method changes the time when the file was last accessed.
| Name | Type | Description |
|---|---|---|
| $count | int |
| Type | Description |
|---|---|
| string |
readUntilEnd
()
: string
returns the content until its end from current offset
Using this method changes the time when the file was last accessed.
| Type | Description |
|---|---|
| string |
seek
(int $offset, int $whence)
: bool
seeks to the given offset
| Name | Type | Description |
|---|---|---|
| $offset | int | |
| $whence | int |
| Type | Description |
|---|---|
| bool |
setContent
(string $content)
:
\org\bovigo\vfs\vfsStreamFile
alias for withContent()
| Name | Type | Description |
|---|---|---|
| $content | string |
| Type | Description |
|---|---|
| \org\bovigo\vfs\vfsStreamFile |
- See
- \org\bovigo\vfs\withContent()
truncate
(int $size)
: bool
Truncates a file to a given length
| Name | Type | Description |
|---|---|---|
| $size | int |
length to truncate file to |
| Type | Description |
|---|---|
| bool |
- Since
- 1.1.0
unlock
(resource |
\org\bovigo\vfs\vfsStreamWrapper
$resource)
: void
Removes lock from file acquired by given resource
| Name | Type | Description |
|---|---|---|
| $resource | resource | \org\bovigo\vfs\vfsStreamWrapper |
- See
- \org\bovigo\vfs\https://github.com/mikey179/vfsStream/issues/40
url
()
: string
returns complete vfsStream url for this content
Inherited from: \org\bovigo\vfs\vfsStreamAbstractContent::url()| Type | Description |
|---|---|
| string |
- Since
- 1.2.0
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.
| Name | Type | Description |
|---|---|---|
| $content | string |
| Type | Description |
|---|---|
| \org\bovigo\vfs\vfsStreamFile |