diff options
author | zotlabs <mike@macgirvin.com> | 2017-12-06 16:07:40 -0800 |
---|---|---|
committer | zotlabs <mike@macgirvin.com> | 2017-12-06 16:07:40 -0800 |
commit | d326e7a75c58e49d84d286f89a97573dbc3e870b (patch) | |
tree | 30a6ea15488250066af84754b1ee4e88325a6b45 /Zotlabs/Storage | |
parent | 4c08d7c4808a811ad8c942df9fa3983d261826ff (diff) | |
download | volse-hubzilla-d326e7a75c58e49d84d286f89a97573dbc3e870b.tar.gz volse-hubzilla-d326e7a75c58e49d84d286f89a97573dbc3e870b.tar.bz2 volse-hubzilla-d326e7a75c58e49d84d286f89a97573dbc3e870b.zip |
hubzilla issue #680, implement IMoveTarget and recursive file/directory move/rename
Diffstat (limited to 'Zotlabs/Storage')
-rw-r--r-- | Zotlabs/Storage/Directory.php | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/Zotlabs/Storage/Directory.php b/Zotlabs/Storage/Directory.php index 45df9ddd5..63ff4341c 100644 --- a/Zotlabs/Storage/Directory.php +++ b/Zotlabs/Storage/Directory.php @@ -16,7 +16,7 @@ use Sabre\DAV; * @link http://github.com/friendica/red * @license http://opensource.org/licenses/mit-license.php The MIT License (MIT) */ -class Directory extends DAV\Node implements DAV\ICollection, DAV\IQuota { +class Directory extends DAV\Node implements DAV\ICollection, DAV\IQuota, DAV\IMoveTarget { /** * @brief The path inside /cloud @@ -457,6 +457,22 @@ class Directory extends DAV\Node implements DAV\ICollection, DAV\IQuota { return false; } + + public function moveInto($targetName,$sourcePath, DAV\INode $sourceNode) { + + if(! $this->auth->owner_id) { + return false; + } + + if(! ($sourceNode->data && $sourceNode->data->hash)) { + return false; + } + + return attach_move($this->auth->owner_id, $sourceNode->data->hash, $this->folder_hash); + + } + + /** * @todo add description of what this function does. * |