File Class Reference
List of all members.
Detailed Description
Definition at line 44 of file file.php.
Member Function Documentation
| File::append |
( |
$ |
data, |
|
|
$ |
force = false | |
|
) |
| | |
Append given data string to this File.
- Parameters:
-
| string | $data Data to write |
| string | $force force the file to open |
- Returns:
- boolean Success public
Definition at line 255 of file file.php.
References write().
Closes the current file if it is opened.
- Returns:
- boolean True if closing was successful or file was already closed, otherwise false public
Definition at line 264 of file file.php.
Returns true if the File is executable.
- Returns:
- boolean true if its executable, false otherwise public
Definition at line 422 of file file.php.
References pwd().
Returns the current folder.
- Returns:
- Folder Current folder public
Definition at line 487 of file file.php.
Returns last access time.
- Returns:
- integer timestamp Timestamp of last access time public
Definition at line 463 of file file.php.
References exists(), and pwd().
Returns last modified time.
- Returns:
- integer timestamp Timestamp of last modification public
Definition at line 475 of file file.php.
References exists(), and pwd().
| File::md5 |
( |
$ |
maxsize = 5 |
) |
|
Get md5 Checksum of file with previous check of Filesize
- Parameters:
-
| mixed | $maxsize in MB or true to force |
- Returns:
- string md5 Checksum See md5_file() public
Definition at line 352 of file file.php.
References pwd(), and size().
| File::offset |
( |
$ |
offset = false, |
|
|
$ |
seek = SEEK_SET | |
|
) |
| | |
Sets or gets the offset for the currently opened file.
- Parameters:
-
| 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 |
- Returns:
- mixed True on success, false on failure (set mode), false on failure or integer offset on success (get mode) public
Definition at line 194 of file file.php.
References open().
| File::open |
( |
$ |
mode = 'r', |
|
|
$ |
force = false | |
|
) |
| | |
Opens the current file with a given $mode
- Parameters:
-
| 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 |
- Returns:
- boolean True on success, false on failure public
Definition at line 136 of file file.php.
References create(), exists(), and pwd().
Referenced by offset(), read(), and write().
Returns the File's owner.
- Returns:
- integer the Fileowner
Definition at line 439 of file file.php.
References exists(), and pwd().
Returns the "chmod" (permissions) of the File.
- Returns:
- string Permissions for the file public
Definition at line 388 of file file.php.
References exists(), and pwd().
| File::prepare |
( |
$ |
data, |
|
|
$ |
forceWindows = false | |
|
) |
| | |
Prepares a ascii string for writing fixes line endings
- Parameters:
-
| string | $data Data to prepare for writing. |
- Returns:
- string public
Definition at line 212 of file file.php.
Returns the full path of the File.
- Returns:
- string Full path to file public
Definition at line 369 of file file.php.
References name().
Referenced by create(), delete(), executable(), exists(), group(), info(), lastAccess(), lastChange(), md5(), open(), owner(), perms(), read(), readable(), size(), and writable().
| File::read |
( |
$ |
bytes = false, |
|
|
$ |
mode = 'rb', |
|
|
$ |
force = false | |
|
) |
| | |
Return the contents of this File as a string.
- Parameters:
-
| string | $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 |
- Returns:
- mixed string on success, false on failure public
Definition at line 161 of file file.php.
References open(), and pwd().
Returns true if the File is readable.
- Returns:
- boolean true if file is readable, false otherwise public
Definition at line 431 of file file.php.
References pwd().
| File::safe |
( |
$ |
name = null, |
|
|
$ |
ext = null | |
|
) |
| | |
makes filename safe for saving
- Parameters:
-
| string | $name the name of the file to make safe if different from $this->name |
- Returns:
- string $ext the extension of the file public
Definition at line 336 of file file.php.
References $name, ext(), and name().
Returns the Filesize, either in bytes or in human-readable format.
- Parameters:
-
| boolean | $humanReadeble Data to write to this File. |
- Returns:
- string|int filesize as int or as a human-readable string public
Definition at line 401 of file file.php.
References exists(), and pwd().
Referenced by md5().
Returns true if the File is writable.
- Returns:
- boolean true if its writable, false otherwise public
Definition at line 413 of file file.php.
References pwd().
| File::write |
( |
$ |
data, |
|
|
$ |
mode = 'w', |
|
|
$ |
force = false | |
|
) |
| | |
Write given data to this File.
- Parameters:
-
| string | $data Data to write to this File. |
| string | $mode Mode of writing. See fwrite(). |
| string | $force force the file to open |
- Returns:
- boolean Success public
Definition at line 229 of file file.php.
References open().
Referenced by append().
Member Data Documentation
The documentation for this class was generated from the following file: