ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
Node.php
Go to the documentation of this file.
1 <?php
2 
3 namespace Sabre\DAV\FS;
4 
5 use Sabre\DAV;
7 
17 abstract 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 }
getName()
Returns the name of the node.
Definition: Node.php:44
setName($name)
Renames the node.
Definition: Node.php:57
The INode interface is the base interface, and the parent class of both ICollection and IFile...
Definition: INode.php:12
__construct($path)
Sets up the node, expects a full path name.
Definition: Node.php:31
Base node-class.
Definition: Node.php:17
static splitPath($path)
Returns the &#39;dirname&#39; and &#39;basename&#39; for a path.
Definition: URLUtil.php:83
getLastModified()
Returns the last modification time, as a unix timestamp.
Definition: Node.php:74