|
| | __construct ($path, $create=false, $mode=0755) |
| |
| | __destruct () |
| |
| | create () |
| |
| | open ($mode='r', $force=false) |
| |
| | read ($bytes=false, $mode='rb', $force=false) |
| |
| | offset ($offset=false, $seek=SEEK_SET) |
| |
| | prepare ($data) |
| |
| | write ($data, $mode='w', $force=false) |
| |
| | append ($data, $force=false) |
| |
| | close () |
| |
| | delete () |
| |
| | info () |
| |
| | ext () |
| |
| | name () |
| |
| | safe ($name=null, $ext=null) |
| |
| | md5 ($maxsize=5) |
| |
| | pwd () |
| |
| | exists () |
| |
| | perms () |
| |
| | size () |
| |
| | writable () |
| |
| | executable () |
| |
| | readable () |
| |
| | owner () |
| |
| | group () |
| |
| | lastAccess () |
| |
| | lastChange () |
| |
| & | folder () |
| |
◆ __construct()
| __construct |
( |
|
$path, |
|
|
|
$create = false, |
|
|
|
$mode = 0755 |
|
) |
| |
Constructor
- Paramètres
-
| string | $path | Path to file |
| boolean | $create | Create file if it does not exist (if true) |
| integer | $mode | Mode to apply to the folder holding the file @access private |
◆ __destruct()
Closes the current file if it is opened
@access private
◆ append()
| append |
( |
|
$data, |
|
|
|
$force = false |
|
) |
| |
Append given data string to this File.
- Paramètres
-
| string | $data | Data to write |
| bool | string | $force | force the file to open |
- Renvoie
- boolean Success @access public
◆ close()
Closes the current file if it is opened.
- Renvoie
- boolean True if closing was successful or file was already closed, otherwise false @access public
◆ create()
Creates the File.
- Renvoie
- boolean Success @access public
◆ delete()
Deletes the File.
- Renvoie
- boolean Success @access public
◆ executable()
Returns true if the File is executable.
- Renvoie
- boolean true if its executable, false otherwise @access public
◆ exists()
Returns true if the File exists.
- Renvoie
- boolean true if it exists, false otherwise @access public
◆ ext()
Returns the File extension.
- Renvoie
- string The File extension @access public
◆ folder()
Returns the current folder.
- Renvoie
- Folder Current folder @access public
◆ group()
Returns the File group.
- Renvoie
- integer the Filegroup @access public
◆ info()
Returns the File extension.
- Renvoie
- string The File extension @access public
◆ lastAccess()
Returns last access time.
- Renvoie
- integer timestamp Timestamp of last access time @access public
◆ lastChange()
Returns last modified time.
- Renvoie
- integer timestamp Timestamp of last modification @access public
◆ md5()
Get md5 Checksum of file with previous check of Filesize
- Paramètres
-
| mixed | $maxsize | in MB or true to force |
- Renvoie
- string md5 Checksum See md5_file() @access public
◆ name()
Returns the File name without extension.
- Renvoie
- string The File name without extension. @access public
◆ offset()
| offset |
( |
|
$offset = false, |
|
|
|
$seek = SEEK_SET |
|
) |
| |
Sets or gets the offset for the currently opened file.
- Paramètres
-
| mixed | $offset | The $offset in bytes to seek. If set to false then the current offset is returned. |
| integer | $seek | PHP Constant SEEK_SET | SEEK_CUR | SEEK_END determining what the $offset is relative to |
- Renvoie
- mixed True on success, false on failure (set mode), false on failure or integer offset on success (get mode) @access public
◆ open()
| open |
( |
|
$mode = 'r', |
|
|
|
$force = false |
|
) |
| |
Opens the current file with a given $mode
- Paramètres
-
| string | $mode | A valid 'fopen' mode string (r|w|a ...) |
| boolean | $force | If true then the file will be re-opened even if its already opened, otherwise it won't |
- Renvoie
- boolean True on success, false on failure @access public
◆ owner()
Returns the File's owner.
- Renvoie
- integer the Fileowner
◆ perms()
Returns the "chmod" (permissions) of the File.
- Renvoie
- string Permissions for the file @access public
◆ prepare()
Prepares a ascii string for writing fixes line endings
- Paramètres
-
| string | $data | Data to prepare for writing. |
- Renvoie
- string @access public
◆ pwd()
Returns the full path of the File.
- Renvoie
- string Full path to file @access public
◆ read()
| read |
( |
|
$bytes = false, |
|
|
|
$mode = 'rb', |
|
|
|
$force = false |
|
) |
| |
Return the contents of this File as a string.
- Paramètres
-
| bool | string | int | $bytes | where to start |
| string | $mode | |
| boolean | $force | If true then the file will be re-opened even if its already opened, otherwise it won't |
- Renvoie
- mixed string on success, false on failure @access public
◆ readable()
Returns true if the File is readable.
- Renvoie
- boolean true if file is readable, false otherwise @access public
◆ safe()
makes filename safe for saving
- Paramètres
-
| string | $name | the name of the file to make safe if different from $this->name |
| null | string | $ext | |
- Renvoie
- string $ext the extension of the file @access public
◆ size()
Returns the Filesize, either in bytes or in human-readable format.
- Renvoie
- string |int filesize as int or as a human-readable string @access public
◆ writable()
Returns true if the File is writable.
- Renvoie
- boolean true if its writable, false otherwise @access public
◆ write()
| write |
( |
|
$data, |
|
|
|
$mode = 'w', |
|
|
|
$force = false |
|
) |
| |
Write given data to this File.
- Paramètres
-
| string | $data | Data to write to this File. |
| string | $mode | Mode of writing. See fwrite(). |
| bool | string | $force | force the file to open |
- Renvoie
- boolean Success @access public
◆ $folder
◆ $handle
◆ $info
◆ $lock
◆ $name
La documentation de cette classe a été générée à partir du fichier suivant :
- XoopsCore25-2.5.11-Beta1/htdocs/class/file/file.php