
Public Member Functions | |
| __construct ($path) | |
| Constructor. | |
| 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. | |
| __toString () | |
| Returns getPrettyPath(). | |
Static Public Member Functions | |
| static | pathIsAbsolute ($filePath) |
| Tests if a givebn file path is absolute or relative. | |
| static | prettifyPath ($path) |
| Makes transformations to a path string to make it more readable. | |
Protected Attributes | |
| $path | |
| The path pointing to the node. | |
Possible sub-classes include file, folder, named pipe, device node, etc.
Definition at line 7 of file FileNode.class.php.
| spunQ_FileNode::__construct | ( | $ | path | ) |
Constructor.
| $path | The path pointing to the node. |
Definition at line 70 of file FileNode.class.php.
| spunQ_FileNode::__toString | ( | ) |
| spunQ_FileNode::exists | ( | ) |
Whether this node already exists in the file system.
It is perfectly valid for an object to describe a non-existent node.
Implements spunQ_IFileNode.
Definition at line 78 of file FileNode.class.php.
| spunQ_FileNode::getContainingFolder | ( | ) |
Returns the folder this node is residing in.
Implements spunQ_IFileNode.
Definition at line 127 of file FileNode.class.php.
| spunQ_FileNode::getLastAccessTime | ( | ) |
Returns the time of last access of this node.
| spunQ_IOException | If the timestamp could not be read. |
Implements spunQ_IFileNode.
Definition at line 141 of file FileNode.class.php.
| spunQ_FileNode::getLastModificationTime | ( | ) |
Returns the time of last modification of this node.
| spunQ_IOException | If the timestamp could not be read. |
Implements spunQ_IFileNode.
Definition at line 151 of file FileNode.class.php.
| spunQ_FileNode::getName | ( | ) |
Returns the name of this node, deprived of its path.
Implements spunQ_IFileNode.
Definition at line 134 of file FileNode.class.php.
| spunQ_FileNode::getPath | ( | ) |
Returns the path pointing to the node.
Implements spunQ_IFileNode.
Definition at line 102 of file FileNode.class.php.
| spunQ_FileNode::getPrettyPath | ( | ) |
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/'.
Implements spunQ_IFileNode.
Definition at line 109 of file FileNode.class.php.
| spunQ_FileNode::isReadable | ( | ) |
Whether the node is readable.
Implements spunQ_IFileNode.
Definition at line 95 of file FileNode.class.php.
| static spunQ_FileNode::pathIsAbsolute | ( | $ | filePath | ) | [static] |
Tests if a givebn file path is absolute or relative.
| $filePath | The file path - a string. |
Definition at line 14 of file FileNode.class.php.
| static spunQ_FileNode::prettifyPath | ( | $ | path | ) | [static] |
Makes transformations to a path string to make it more readable.
Removes references to current and upper directories (/foo/.. or foo/.), for example. Assumes that the path has a slash as delimiter. if you want to use this function on a windows path, make sure to replace backslashes by forward slashes beforehand.
| $path | The path string to transform. |
Definition at line 34 of file FileNode.class.php.
| spunQ_FileNode::residesIn | ( | spunQ_IFolder $ | folder | ) |
Checks whether this file is in given folder or one of its subfolders.
| $folder | The folder to test against. |
Implements spunQ_IFileNode.
Definition at line 85 of file FileNode.class.php.
spunQ_FileNode::$path [protected] |
1.5.9