ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
Sabre\DAV\FS\Node Class Reference

Base node-class. More...

+ Inheritance diagram for Sabre\DAV\FS\Node:
+ Collaboration diagram for Sabre\DAV\FS\Node:

Public Member Functions

 __construct ($path)
 Sets up the node, expects a full path name. More...
 
 getName ()
 Returns the name of the node. More...
 
 setName ($name)
 Renames the node. More...
 
 getLastModified ()
 Returns the last modification time, as a unix timestamp. More...
 
- Public Member Functions inherited from Sabre\DAV\INode
 delete ()
 Deleted the current node. More...
 
 getName ()
 Returns the name of the node. More...
 
 setName ($name)
 Renames the node. More...
 
 getLastModified ()
 Returns the last modification time, as a unix timestamp. More...
 

Protected Attributes

 $path
 

Detailed Description

Base node-class.

The node class implements the method used by both the File and the Directory classes

Author
Evert Pot (http://evertpot.com/) @license http://sabre.io/license/ Modified BSD License

Definition at line 17 of file Node.php.

Constructor & Destructor Documentation

◆ __construct()

Sabre\DAV\FS\Node::__construct (   $path)

Sets up the node, expects a full path name.

Parameters
string$path

Definition at line 31 of file Node.php.

31 {
32
33 $this->path = $path;
34
35 }

References Sabre\DAV\FS\Node\$path.

Member Function Documentation

◆ getLastModified()

Sabre\DAV\FS\Node::getLastModified ( )

Returns the last modification time, as a unix timestamp.

Returns
int

Implements Sabre\DAV\INode.

Definition at line 74 of file Node.php.

74 {
75
76 return filemtime($this->path);
77
78 }

◆ getName()

Sabre\DAV\FS\Node::getName ( )

Returns the name of the node.

Returns
string

Implements Sabre\DAV\INode.

Definition at line 44 of file Node.php.

44 {
45
46 list(, $name) = URLUtil::splitPath($this->path);
47 return $name;
48
49 }
static splitPath($path)
Returns the 'dirname' and 'basename' for a path.
Definition: URLUtil.php:83

References $name, and Sabre\HTTP\URLUtil\splitPath().

+ Here is the call graph for this function:

◆ setName()

Sabre\DAV\FS\Node::setName (   $name)

Renames the node.

Parameters
string$nameThe new name
Returns
void

Implements Sabre\DAV\INode.

Definition at line 57 of file Node.php.

57 {
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 }

References $name, and Sabre\HTTP\URLUtil\splitPath().

+ Here is the call graph for this function:

Field Documentation

◆ $path


The documentation for this class was generated from the following file: