InMemoryFile
in package
implements
ISimpleFile
This class represents a file that is only hold in memory.
Tags
Table of Contents
Interfaces
- ISimpleFile
- This interface allows to manage simple files.
Properties
Methods
- __construct() : mixed
- InMemoryFile constructor.
- delete() : void
- In memory files can't be deleted.
- getContent() : string
- Get the content
- getETag() : string
- Get the ETag
- getExtension() : string
- getMimeType() : string
- Get the MimeType
- getMTime() : int
- Get the last modification time
- getName() : string
- Get the name
- getSize() : int|float
- Get the size in bytes
- putContent() : void
- Overwrite the file
- read() : resource|false
- Stream reading is unsupported for in memory files.
- write() : resource|bool
- Stream writing isn't available for in memory files.
Properties
$contents
Holds the file contents.
private
string
$contents
$name
Holds the file name.
private
string
$name
Methods
__construct()
InMemoryFile constructor.
public
__construct(string $name, string $contents) : mixed
Parameters
- $name : string
-
The file name
- $contents : string
-
The file contents
Tags
delete()
In memory files can't be deleted.
public
delete() : void
Tags
getContent()
Get the content
public
getContent() : string
Tags
Return values
stringgetETag()
Get the ETag
public
getETag() : string
Tags
Return values
stringgetExtension()
public
getExtension() : string
Tags
Return values
stringgetMimeType()
Get the MimeType
public
getMimeType() : string
Tags
Return values
stringgetMTime()
Get the last modification time
public
getMTime() : int
Tags
Return values
intgetName()
Get the name
public
getName() : string
Tags
Return values
stringgetSize()
Get the size in bytes
public
getSize() : int|float
Tags
Return values
int|floatputContent()
Overwrite the file
public
putContent(mixed $data) : void
Parameters
- $data : mixed
Tags
read()
Stream reading is unsupported for in memory files.
public
read() : resource|false
Tags
Return values
resource|falsewrite()
Stream writing isn't available for in memory files.
public
write() : resource|bool