FileInterface
in
FileInterface
Tags
Table of Contents
Methods
- __toString() : string
- Returns the path to this file
- append() : mixed
- copy() : mixed
- delete() : mixed
- exists() : bool
- Wrapper for file_exists()
- getAbsoluteFilePath() : mixed
- getHandle() : resource
- Returns a file handle for the given file
- getRelativeFilePath() : string
- isWithinWebsiteData() : bool
- Returns whether this file is part of website data
- makeWritable() : mixed
- move() : mixed
- rename() : mixed
- touch() : mixed
- write() : mixed
Methods
__toString()
Returns the path to this file
public
__toString() : string
If the file is within the website directory a relative path is returned. Otherwise the absolute path is returned to avoid confusion.
Return values
string —Path to this file
append()
public
append(mixed $data) : mixed
Parameters
- $data : mixed
copy()
public
copy(mixed $dst) : mixed
Parameters
- $dst : mixed
delete()
public
delete() : mixed
exists()
Wrapper for file_exists()
public
exists() : bool
Return values
bool —True if the file exists
getAbsoluteFilePath()
public
getAbsoluteFilePath() : mixed
getHandle()
Returns a file handle for the given file
public
getHandle([bool $writable = false ]) : resource
If you want to use this handle for writing you need to ensure proper locking yourself!
Parameters
- $writable : bool = false
-
Set to true if you need to write to the handle
Tags
Return values
resource —A file handle
getRelativeFilePath()
public
getRelativeFilePath() : string
Return values
stringisWithinWebsiteData()
Returns whether this file is part of website data
public
isWithinWebsiteData() : bool
Return values
bool —True if this is a website data file
makeWritable()
public
makeWritable() : mixed
move()
public
move(mixed $dst[, mixed $force = false ]) : mixed
Parameters
- $dst : mixed
- $force : mixed = false
rename()
public
rename(mixed $dst[, mixed $force = false ]) : mixed
Parameters
- $dst : mixed
- $force : mixed = false
touch()
public
touch() : mixed
write()
public
write(mixed $data) : mixed
Parameters
- $data : mixed