@@ -26,28 +26,28 @@ |
||
26 | 26 | use Sabre\DAV\Tree; |
27 | 27 | |
28 | 28 | class CachingTree extends Tree { |
29 | - /** |
|
30 | - * Store a node in the cache |
|
31 | - * |
|
32 | - * @param Node $node |
|
33 | - * @param null|string $path |
|
34 | - */ |
|
35 | - public function cacheNode(Node $node, $path = null) { |
|
36 | - if (is_null($path)) { |
|
37 | - $path = $node->getPath(); |
|
38 | - } |
|
39 | - $this->cache[trim($path, '/')] = $node; |
|
40 | - } |
|
29 | + /** |
|
30 | + * Store a node in the cache |
|
31 | + * |
|
32 | + * @param Node $node |
|
33 | + * @param null|string $path |
|
34 | + */ |
|
35 | + public function cacheNode(Node $node, $path = null) { |
|
36 | + if (is_null($path)) { |
|
37 | + $path = $node->getPath(); |
|
38 | + } |
|
39 | + $this->cache[trim($path, '/')] = $node; |
|
40 | + } |
|
41 | 41 | |
42 | - public function markDirty($path) { |
|
43 | - // We don't care enough about sub-paths |
|
44 | - // flushing the entire cache |
|
45 | - $path = trim($path, '/'); |
|
46 | - foreach ($this->cache as $nodePath => $node) { |
|
47 | - $nodePath = (string) $nodePath; |
|
48 | - if ('' === $path || $nodePath == $path || 0 === strpos($nodePath, $path.'/')) { |
|
49 | - unset($this->cache[$nodePath]); |
|
50 | - } |
|
51 | - } |
|
52 | - } |
|
42 | + public function markDirty($path) { |
|
43 | + // We don't care enough about sub-paths |
|
44 | + // flushing the entire cache |
|
45 | + $path = trim($path, '/'); |
|
46 | + foreach ($this->cache as $nodePath => $node) { |
|
47 | + $nodePath = (string) $nodePath; |
|
48 | + if ('' === $path || $nodePath == $path || 0 === strpos($nodePath, $path.'/')) { |
|
49 | + unset($this->cache[$nodePath]); |
|
50 | + } |
|
51 | + } |
|
52 | + } |
|
53 | 53 | } |