Class File
Object-oriented file handler
Author: Arturas Molcanovas <a.molcanovas@gmail.com>
Located at sys/class/alo/file.php
Methods summary
public
|
|
public static
string
|
|
public
boolean
|
|
protected
|
|
public static
string
|
#
get_extension( string $filename, integer $depth = 1, boolean $only_that_member = false )
Gets the file extension based on name |
public
string
|
#
getExtension( integer $depth = 1, boolean $only_that_member = false )
Gets the file extension based on the currently set filename |
public
boolean
|
|
public
boolean
|
|
public
boolean
|
|
public
boolean
|
|
public
boolean
|
|
public
|
|
protected
|
|
protected
|
|
public
boolean
|
|
public
string
|
|
protected
|
|
public
string
|
|
public
|
|
public
|
|
public
array
|
|
public
|
|
public
|
|
public
|
Magic methods summary
Constants summary
string |
M_READ_EXISTING_BEGIN
|
'r' |
#
Open for reading only; place the file pointer at the beginning of the file. |
string |
M_RW_EXISTING_BEGIN
|
'r+' |
#
Open for reading and writing; place the file pointer at the beginning of the file. |
string |
M_WRITE_TRUNCATE_BEGIN
|
'w' |
#
Open for writing only; place the file pointer at the beginning of the file and truncate the file to zero length. If the file does not exist, attempt to create it. |
string |
M_RW_TRUNCATE_BEGIN
|
'w+' |
#
Open for reading and writing; place the file pointer at the beginning of the file and truncate the file to zero length. If the file does not exist, attempt to create it. |
string |
M_WRITE_END
|
'a' |
#
Open for writing only; place the file pointer at the end of the file. If the file does not exist, attempt to create it. |
string |
M_RW_END
|
'a+' |
#
Open for reading and writing; place the file pointer at the end of the file. If the file does not exist, attempt to create it. |
string |
M_WRITE_NONEXIST_BEGIN
|
'x' |
#
Create and open for writing only; place the file pointer at the beginning of the file. If the file already exists, the fopen() call will fail by returning FALSE and generating an error of level E_WARNING. If the file does not exist, attempt to create it. This is equivalent to specifying O_EXCL|O_CREAT flags for the underlying open(2) system call. |
string |
M_RW_NONEXIST_BEGIN
|
'x+' |
#
Create and open for reading and writing; otherwise it has the same behavior as M_WRITE_NONEXIST_BEGIN |
string |
M_WRITE_BEGIN
|
'c' |
#
Open the file for writing only. If the file does not exist, it is created. If it exists, it is neither truncated (as opposed to M_WRITE_TRUNCATE_BEGIN), nor the call to this function fails (as is the case with M_WRITE_NONEXIST_BEGIN). The file pointer is positioned on the beginning of the file. This may be useful if it's desired to get an advisory lock (see flock()) before attempting to modify the file, as using M_WRITE_NONEXIST_BEGIN could truncate the file before the lock was obtained (if truncation is desired, ftruncate() can be used after the lock is requested). |
string |
M_RW_BEGIN
|
'c+' |
#
Open the file for reading and writing; otherwise it has the same behavior as M_WRITE_BEGIN. |
Properties summary
protected
string
|
$content |
#
The file content |
protected
string
|
$name |
#
The file name |
protected
string
|
$dir |
#
The file directory |
protected
array
|
$replace |
#
Replacements for placeholders |
protected
string
|
$filepath |
#
The full file path. Updates with every setName & setDir |
protected static
boolean
|
$gz |
#
Whether GZIP is installed |