ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
Sabre\DAV\TreeDirectoryTester Class Reference
+ Inheritance diagram for Sabre\DAV\TreeDirectoryTester:
+ Collaboration diagram for Sabre\DAV\TreeDirectoryTester:

Public Member Functions

 createDirectory ($name)
 Creates a new subdirectory. More...
 
 createFile ($name, $data=null)
 Creates a new file in the directory. More...
 
 getChild ($name)
 Returns a specific child node, referenced by its name. More...
 
 childExists ($name)
 Checks if a child-node with the specified name exists. More...
 
 delete ()
 Deleted the current node. More...
 
 setName ($name)
 Renames the node. More...
 
- Public Member Functions inherited from Sabre\DAV\SimpleCollection
 __construct ($name, array $children=[])
 Creates this node. More...
 
 addChild (INode $child)
 Adds a new childnode to this collection. More...
 
 getName ()
 Returns the name of the collection. More...
 
 getChild ($name)
 Returns a child object, by its name. More...
 
 getChildren ()
 Returns a list of children for this collection. More...
 
- Public Member Functions inherited from Sabre\DAV\Collection
 getChild ($name)
 Returns a child object, by its name. More...
 
 childExists ($name)
 Checks is a child-node exists. More...
 
 createFile ($name, $data=null)
 Creates a new file in the directory. More...
 
 createDirectory ($name)
 Creates a new subdirectory. More...
 
- Public Member Functions inherited from Sabre\DAV\Node
 getLastModified ()
 Returns the last modification time as a unix timestamp. More...
 
 delete ()
 Deletes the current node. More...
 
 setName ($name)
 Renames the node. More...
 

Data Fields

 $newDirectories = []
 
 $newFiles = []
 
 $isDeleted = false
 
 $isRenamed = false
 

Additional Inherited Members

- Protected Attributes inherited from Sabre\DAV\SimpleCollection
 $children = []
 
 $name
 

Detailed Description

Definition at line 114 of file TreeTest.php.

Member Function Documentation

◆ childExists()

Sabre\DAV\TreeDirectoryTester::childExists (   $name)

Checks if a child-node with the specified name exists.

Parameters
string$name
Returns
bool

Implements Sabre\DAV\ICollection.

Definition at line 141 of file TreeTest.php.

References $name.

141  {
142 
143  return !!$this->getChild($name);
144 
145  }
getChild($name)
Returns a specific child node, referenced by its name.
Definition: TreeTest.php:133

◆ createDirectory()

Sabre\DAV\TreeDirectoryTester::createDirectory (   $name)

Creates a new subdirectory.

Parameters
string$name
Returns
void

Implements Sabre\DAV\ICollection.

Definition at line 121 of file TreeTest.php.

References $name.

121  {
122 
123  $this->newDirectories[$name] = true;
124 
125  }

◆ createFile()

Sabre\DAV\TreeDirectoryTester::createFile (   $name,
  $data = null 
)

Creates a new file in the directory.

Data will either be supplied as a stream resource, or in certain cases as a string. Keep in mind that you may have to support either.

After successful creation of the file, you may choose to return the ETag of the new file here.

The returned ETag must be surrounded by double-quotes (The quotes should be part of the actual string).

If you cannot accurately determine the ETag, you should not return it. If you don't store the file exactly as-is (you're transforming it somehow) you should also not return an ETag.

This means that if a subsequent GET to this new file does not exactly return the same contents of what was submitted here, you are strongly recommended to omit the ETag.

Parameters
string$nameName of the file
resource | string$dataInitial payload
Returns
null|string

Implements Sabre\DAV\ICollection.

Definition at line 127 of file TreeTest.php.

References $data, and $name.

127  {
128 
129  $this->newFiles[$name] = $data;
130 
131  }
$data
Definition: bench.php:6

◆ delete()

Sabre\DAV\TreeDirectoryTester::delete ( )

Deleted the current node.

Returns
void

Implements Sabre\DAV\INode.

Definition at line 147 of file TreeTest.php.

147  {
148 
149  $this->isDeleted = true;
150 
151  }

◆ getChild()

Sabre\DAV\TreeDirectoryTester::getChild (   $name)

Returns a specific child node, referenced by its name.

This method must throw Sabre if the node does not exist.

Parameters
string$name
Returns
INode

Implements Sabre\DAV\ICollection.

Definition at line 133 of file TreeTest.php.

References $name.

133  {
134 
135  if (isset($this->newDirectories[$name])) return new self($name);
136  if (isset($this->newFiles[$name])) return new TreeFileTester($name, $this->newFiles[$name]);
137  return parent::getChild($name);
138 
139  }

◆ setName()

Sabre\DAV\TreeDirectoryTester::setName (   $name)

Renames the node.

Parameters
string$nameThe new name
Returns
void

Implements Sabre\DAV\INode.

Definition at line 153 of file TreeTest.php.

References $name.

153  {
154 
155  $this->isRenamed = true;
156  $this->name = $name;
157 
158  }

Field Documentation

◆ $isDeleted

Sabre\DAV\TreeDirectoryTester::$isDeleted = false

Definition at line 118 of file TreeTest.php.

◆ $isRenamed

Sabre\DAV\TreeDirectoryTester::$isRenamed = false

Definition at line 119 of file TreeTest.php.

◆ $newDirectories

Sabre\DAV\TreeDirectoryTester::$newDirectories = []

Definition at line 116 of file TreeTest.php.

◆ $newFiles

Sabre\DAV\TreeDirectoryTester::$newFiles = []

Definition at line 117 of file TreeTest.php.


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