ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
Node.php
Go to the documentation of this file.
1<?php
2
3namespace Sabre\DAV\FS;
4
5use Sabre\DAV;
7
17abstract class Node implements DAV\INode {
18
24 protected $path;
25
31 function __construct($path) {
32
33 $this->path = $path;
34
35 }
36
37
38
44 function getName() {
45
46 list(, $name) = URLUtil::splitPath($this->path);
47 return $name;
48
49 }
50
57 function setName($name) {
58
59 list($parentPath, ) = URLUtil::splitPath($this->path);
60 list(, $newName) = URLUtil::splitPath($name);
61
62 $newPath = $parentPath . '/' . $newName;
63 rename($this->path, $newPath);
64
65 $this->path = $newPath;
66
67 }
68
74 function getLastModified() {
75
76 return filemtime($this->path);
77
78 }
79
80}
An exception for terminatinating execution or to throw for unit testing.
Base node-class.
Definition: Node.php:17
getLastModified()
Returns the last modification time, as a unix timestamp.
Definition: Node.php:74
setName($name)
Renames the node.
Definition: Node.php:57
getName()
Returns the name of the node.
Definition: Node.php:44
__construct($path)
Sets up the node, expects a full path name.
Definition: Node.php:31
URL utility class.
Definition: URLUtil.php:18
static splitPath($path)
Returns the 'dirname' and 'basename' for a path.
Definition: URLUtil.php:83
The INode interface is the base interface, and the parent class of both ICollection and IFile.
Definition: INode.php:12