Skip to content
This repository was archived by the owner on Nov 25, 2020. It is now read-only.

Commit aea7dd8

Browse files
committed
Dav impl childExists function is highly inefficient, replace by a simple call to is_file on childnode.
1 parent 9815d75 commit aea7dd8

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

core/src/core/src/pydio/Core/Http/Dav/Collection.php

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -201,14 +201,9 @@ public function getChildren()
201201
* @param string $name
202202
* @return bool
203203
*/
204-
public function childExists($name)
205-
{
206-
foreach ($this->getChildren() as $child) {
207-
208-
if ($child->getName()==$name) return true;
209-
210-
}
211-
return false;
212-
204+
public function childExists($name) {
205+
$ajxpNode = new AJXP_Node($this->getUrl());
206+
$child = $ajxpNode->createChildNode($name);
207+
return is_file($child->getUrl());
213208
}
214209
}

0 commit comments

Comments
 (0)