
Public Member Functions | |
| getFolder () | |
| Alias for getContainingFolder(). | |
| getExtension () | |
| Gets the extension of this file. | |
| create () | |
| Makes sure this file actually exists. | |
| delete () | |
| Deletes this file from the file system. | |
| rename ($newName, $overwrite) | |
| Renames the file, but keeps it in the same folder. | |
| copyTo ($file, $overwrite) | |
| Copies the contents of this file into another file. | |
| moveTo ($folder, $overwrite, $newName=NULL) | |
| Moves this file into another directory (and optionally renames it). | |
| readIntoArray () | |
| Reads the contents of this file into an array, where every line is an element. | |
| readIntoString () | |
| Reads the contents of this file into a string. | |
| getFileName () | |
| Gets the name of this file, up to the first dot. | |
| assureExists () | |
| Throws an exception if this file does not exist. | |
| write ($string, $append) | |
| Writes the content of the given string into the file. | |
| getSize () | |
| Gets this file's size in bytes. | |
| exists () | |
| Whether this node already exists in the file system. | |
| residesIn (spunQ_IFolder $folder) | |
| Checks whether this file is in given folder or one of its subfolders. | |
| isReadable () | |
| Whether the node is readable. | |
| getPath () | |
| Returns the path pointing to the node. | |
| getPrettyPath () | |
| Returns the most unique and human-readable path. | |
| getContainingFolder () | |
| Returns the folder this node is residing in. | |
| getName () | |
| Returns the name of this node, deprived of its path. | |
| getLastAccessTime () | |
| Returns the time of last access of this node. | |
| getLastModificationTime () | |
| Returns the time of last modification of this node. | |
Definition at line 6 of file IFile.interface.php.
| spunQ_IFile::assureExists | ( | ) |
Throws an exception if this file does not exist.
| spunQ_IOException |
Implemented in spunQ_File.
| spunQ_IFile::copyTo | ( | $ | file, | |
| $ | overwrite | |||
| ) |
Copies the contents of this file into another file.
| $file | The file to copy to. Either a spunQ_IFile object or a string. | |
| $overwrite | Whether the destination file should be overwritten. |
Implemented in spunQ_File.
| spunQ_IFile::create | ( | ) |
Makes sure this file actually exists.
Doesn't do anything, if the node already exists.
Implemented in spunQ_File.
| spunQ_IFile::delete | ( | ) |
| spunQ_IFileNode::exists | ( | ) | [inherited] |
Whether this node already exists in the file system.
It is perfectly valid for an object to describe a non-existent node.
Implemented in spunQ_FileNode.
| spunQ_IFileNode::getContainingFolder | ( | ) | [inherited] |
| spunQ_IFile::getExtension | ( | ) |
Gets the extension of this file.
Extension is defined as the last part of the file that is seperated by a dot. The extension of the file 'Some.class.php' is 'php'.
Implemented in spunQ_File.
| spunQ_IFile::getFileName | ( | ) |
Gets the name of this file, up to the first dot.
The FileName of 'Some.class.php' is 'Some'.
Implemented in spunQ_File.
| spunQ_IFile::getFolder | ( | ) |
| spunQ_IFileNode::getLastAccessTime | ( | ) | [inherited] |
Returns the time of last access of this node.
| spunQ_IOException | If the timestamp could not be read. |
Implemented in spunQ_FileNode.
| spunQ_IFileNode::getLastModificationTime | ( | ) | [inherited] |
Returns the time of last modification of this node.
| spunQ_IOException | If the timestamp could not be read. |
Implemented in spunQ_FileNode.
| spunQ_IFileNode::getName | ( | ) | [inherited] |
| spunQ_IFileNode::getPath | ( | ) | [inherited] |
| spunQ_IFileNode::getPrettyPath | ( | ) | [inherited] |
Returns the most unique and human-readable path.
If the file exists, the builtin function realpath() is used. Otherwise, a better-looking path is achieved through string manipulation, i.e. '../a/../d/./' becomes '../d/'.
Implemented in spunQ_FileNode.
| spunQ_IFile::getSize | ( | ) |
Gets this file's size in bytes.
| spunQ_IOException |
Implemented in spunQ_File.
| spunQ_IFileNode::isReadable | ( | ) | [inherited] |
| spunQ_IFile::moveTo | ( | $ | folder, | |
| $ | overwrite, | |||
| $ | newName = NULL | |||
| ) |
Moves this file into another directory (and optionally renames it).
| $folder | the folder to move to. Either a spunQ_IFolder or a string. | |
| $overwrite | Whether the destination file should be overwritten. | |
| $newName | The file will be renamed, too if this is set. |
Implemented in spunQ_File.
| spunQ_IFile::readIntoArray | ( | ) |
Reads the contents of this file into an array, where every line is an element.
Implemented in spunQ_File, and spunQ_GzipFile.
| spunQ_IFile::readIntoString | ( | ) |
Reads the contents of this file into a string.
Implemented in spunQ_File, and spunQ_GzipFile.
| spunQ_IFile::rename | ( | $ | newName, | |
| $ | overwrite | |||
| ) |
Renames the file, but keeps it in the same folder.
Use moveTo() if you want to rename and move.
| $newName | The new name of the file. | |
| $overwrite | Whether the destination file should be overwritten. |
Implemented in spunQ_File.
| spunQ_IFileNode::residesIn | ( | spunQ_IFolder $ | folder | ) | [inherited] |
Checks whether this file is in given folder or one of its subfolders.
| $folder | The folder to test against. |
Implemented in spunQ_FileNode.
| spunQ_IFile::write | ( | $ | string, | |
| $ | append | |||
| ) |
Writes the content of the given string into the file.
| $string | The string to write | |
| $append | Whether to append to the exiosting file, or replace its content. |
| spunQ_IOException |
Implemented in spunQ_File, and spunQ_GzipFile.
1.5.9