File extends File implements IErrorable uses Error
Table of Contents
Interfaces
- IErrorable
Constants
Methods
- __construct() : mixed
- close() : void
- Closes the file.
- delete() : mixed
- deleteFile() : mixed
- generateTemporalFile() : static
- Creates temporal file.
- getContents() : mixed
- getContentType() : mixed
- getCreationTime() : mixed
- getDirectory() : mixed
- getDirectoryName() : mixed
- getExtension() : mixed
- getFileContents() : mixed
- getFileSize() : mixed
- getLastAccessTime() : mixed
- getModificationTime() : mixed
- getName() : mixed
- getPath() : mixed
- getPermissions() : mixed
- getPhysicalPath() : mixed
- getSize() : float|int
- Returns the file size.
- isDirectory() : mixed
- isExists() : mixed
- isFile() : mixed
- isFileExists() : mixed
- isLink() : mixed
- isReadable() : mixed
- isSystem() : mixed
- isWritable() : mixed
- markWritable() : mixed
- open() : resource
- Opens the file and returns the file pointer.
- openLoad() : bool
- Opens file for reading.
- openWrite() : bool
- Opens file for writing.
- putContents() : mixed
- putFileContents() : mixed
- read() : string
- Read file.
- readFile() : mixed
- rename() : mixed
- seek() : int
- Seeks on the file pointer from the beginning (SEEK_SET only).
- write() : int
- Write file.
Constants
APPEND
public
mixed
APPEND
= 1
REWRITE
public
mixed
REWRITE
= 0
Methods
__construct()
public
__construct(mixed $path[, mixed $siteId = null ]) : mixed
Parameters
- $path : mixed
- $siteId : mixed = null
close()
Closes the file.
public
close() : void
Tags
delete()
public
delete() : mixed
deleteFile()
public
static deleteFile(mixed $path) : mixed
Parameters
- $path : mixed
generateTemporalFile()
Creates temporal file.
public
static generateTemporalFile(string $prefix[, string $suffix = '.tmp' ][, int $timeToLive = 3 ]) : static
Parameters
- $prefix : string
-
Name prefix.
- $suffix : string = '.tmp'
-
Name suffix.
- $timeToLive : int = 3
-
Hours to keep files alive.
Return values
staticgetContents()
public
getContents() : mixed
getContentType()
public
getContentType() : mixed
getCreationTime()
public
getCreationTime() : mixed
getDirectory()
public
getDirectory() : mixed
getDirectoryName()
public
getDirectoryName() : mixed
getExtension()
public
getExtension() : mixed
getFileContents()
public
static getFileContents(mixed $path) : mixed
Parameters
- $path : mixed
getFileSize()
public
getFileSize() : mixed
Use getSize() instead
getLastAccessTime()
public
getLastAccessTime() : mixed
getModificationTime()
public
getModificationTime() : mixed
getName()
public
getName() : mixed
getPath()
public
getPath() : mixed
getPermissions()
public
getPermissions() : mixed
getPhysicalPath()
public
getPhysicalPath() : mixed
getSize()
Returns the file size.
public
getSize() : float|int
Tags
Return values
float|intisDirectory()
public
isDirectory() : mixed
isExists()
public
isExists() : mixed
isFile()
public
isFile() : mixed
isFileExists()
public
static isFileExists(mixed $path) : mixed
Parameters
- $path : mixed
isLink()
public
isLink() : mixed
isReadable()
public
isReadable() : mixed
isSystem()
public
isSystem() : mixed
isWritable()
public
isWritable() : mixed
markWritable()
public
markWritable() : mixed
open()
Opens the file and returns the file pointer.
public
open(string $mode) : resource
Parameters
- $mode : string
Tags
Return values
resourceopenLoad()
Opens file for reading.
public
openLoad() : bool
Return values
boolopenWrite()
Opens file for writing.
public
openWrite() : bool
Return values
boolputContents()
public
putContents(mixed $data[, mixed $flags = self::REWRITE ]) : mixed
Parameters
- $data : mixed
- $flags : mixed = self::REWRITE
putFileContents()
public
static putFileContents(mixed $path, mixed $data[, mixed $flags = self::REWRITE ]) : mixed
Parameters
- $path : mixed
- $data : mixed
- $flags : mixed = self::REWRITE
read()
Read file.
public
read(int $length) : string
Parameters
- $length : int
-
Amount bytes to read.
Return values
stringreadFile()
public
readFile() : mixed
rename()
public
rename(mixed $newPath) : mixed
Parameters
- $newPath : mixed
seek()
Seeks on the file pointer from the beginning (SEEK_SET only).
public
seek(int|float $position) : int
Parameters
- $position : int|float
Tags
Return values
intwrite()
Write file.
public
write(string $content) : int
Parameters
- $content : string
-
Data to write.