To read and write files Same use like globals variables Singleton
Definition at line 12 of file file.class.php.
◆ __construct()
◆ copy()
static copy |
( |
|
$oldName, |
|
|
|
$newName |
|
) |
| |
|
static |
Copy a file to a new location
- Parameters
-
string | $oldName | Old name path |
string | $newName | New name path |
- Returns
- bool True if success
Definition at line 268 of file file.class.php.
◆ createDir()
static createDir |
( |
|
$path, |
|
|
|
$chmod = 0777 |
|
) |
| |
|
static |
Create a directory, and all subdirectory if needed If directory already exists, nothing is done
- Parameters
-
- Returns
- bool True if directory exists
Definition at line 291 of file file.class.php.
◆ date()
Get the file update date
- Parameters
-
- Returns
- int Timestamp
Definition at line 302 of file file.class.php.
◆ delete()
Delete a file
- Parameters
-
- Returns
- bool True if success
Definition at line 355 of file file.class.php.
◆ exists()
Check if a file exists
- Parameters
-
- Returns
- bool
Definition at line 97 of file file.class.php.
◆ fetch()
static fetch |
( |
|
$file, |
|
|
array |
$vars = array() |
|
) |
| |
|
static |
Fetch a file with vars (used in tpl)
- Parameters
-
string | $file | File path name |
array | $vars | Variables used in the php file |
- Returns
- string The file fetched
Definition at line 441 of file file.class.php.
◆ getExt()
Get the file extension
- Parameters
-
- Returns
- null|string The extension
Definition at line 400 of file file.class.php.
◆ getType()
Get the Mime Type of a file
- Parameters
-
string | $file | File path name |
- Returns
- string
Definition at line 413 of file file.class.php.
◆ humanSize()
static humanSize |
( |
|
$file, |
|
|
|
$sizeGiven = false |
|
) |
| |
|
static |
Get a human file size
- Parameters
-
string | $file | The file path |
boolean | $sizeGiven | Indicates if the size is given in firt param |
- Returns
- string The human size
Definition at line 339 of file file.class.php.
◆ init()
◆ initCache()
◆ initCfg()
◆ isLater()
static isLater |
( |
|
$file1, |
|
|
|
$file2 |
|
) |
| |
|
static |
Compare 2 date files
- Parameters
-
string | $file1 | The first file path |
string | $file2 | The second file path |
- Returns
- bool True if the first file is later than the second
Definition at line 314 of file file.class.php.
◆ move()
static move |
( |
|
$oldName, |
|
|
|
$newName |
|
) |
| |
|
static |
Move a file to a new location
- Parameters
-
string | $oldName | Old name path |
string | $newName | New name path |
- Returns
- bool True if success
Definition at line 279 of file file.class.php.
◆ multipleDelete()
static multipleDelete |
( |
|
$pattern, |
|
|
|
$matchPattern = null |
|
) |
| |
|
static |
Delete files with a pattern
- Parameters
-
string | $pattern | The pattern to delete files (glob used) |
string | $matchPattern | A more specific pattern to be applied with preg_match |
- Returns
- int Number of files deleted
Definition at line 386 of file file.class.php.
◆ name()
Get the filename from a path
- Parameters
-
- Returns
- string
Definition at line 118 of file file.class.php.
◆ nyroExists()
static nyroExists |
( |
|
$prm | ) |
|
|
static |
Try to find the file location, in the nyro installation in this order: my directory, plugin directory and nyro directory. The order can be reverse by setting rtl parameter to false. If the file is located on a subdirectory, use _ to replace /.
- Parameters
-
array | $prm | Possible values :
- name (required) string: FileName (with _ to replace /)
- realName boolean: Indicate if the given name is real or should be parsed
- type string: class, extend, cfg, tpl, lib or other (default: class)
- rtl bool: see description (default: true)
- list bool: Search all the matched files and return the order list. (default: false)
- tplExt string: Tpl Extension (default: request::get('out'))
|
- Returns
- false|string|array The absolute file location, an absolute file location array or false if not found
Definition at line 137 of file file.class.php.
◆ read()
Read a file
- Parameters
-
- Returns
- string|false The file content
Definition at line 242 of file file.class.php.
◆ saveCache()
◆ search()
static search |
( |
|
$pattern, |
|
|
|
$matchPattern = null |
|
) |
| |
|
static |
Search files regarding a pattern
- Parameters
-
string | $pattern | |
string | $matchPattern | A more specific pattern to be applied with preg_match |
- Returns
- array
Definition at line 457 of file file.class.php.
◆ size()
Get a file size
- Parameters
-
- Returns
- int The file size
Definition at line 325 of file file.class.php.
◆ webExists()
static webExists |
( |
|
$file | ) |
|
|
static |
Check if a file exists in the web directory
- Parameters
-
- Returns
- bool
Definition at line 232 of file file.class.php.
◆ write()
static write |
( |
|
$file, |
|
|
|
$content |
|
) |
| |
|
static |
Write into a file
- Parameters
-
string | $file | The file path |
string | $content | The file content |
- Returns
- bool True if success
Definition at line 256 of file file.class.php.
◆ $cacheFiles
◆ $cfg
◆ $saveCacheFiles
◆ $searchFiles
Checkif a file exists
- Parameters
-
- Returns
- bool
Definition at line 27 of file file.class.php.
The documentation for this class was generated from the following file: