|
|
@ -318,19 +318,22 @@ class Cache { |
|
|
|
* @param string $target |
|
|
|
* @param string $target |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public function move($source, $target) { |
|
|
|
public function move($source, $target) { |
|
|
|
$sourceId = $this->getId($source); |
|
|
|
$sourceData = $this->get($source); |
|
|
|
|
|
|
|
$sourceId = $sourceData['fileid']; |
|
|
|
$newParentId = $this->getParentId($target); |
|
|
|
$newParentId = $this->getParentId($target); |
|
|
|
|
|
|
|
|
|
|
|
//find all child entries |
|
|
|
if ($sourceData['mimetype'] === 'httpd/unix-directory') { |
|
|
|
$query = \OC_DB::prepare('SELECT `path`, `fileid` FROM `*PREFIX*filecache` WHERE `path` LIKE ?'); |
|
|
|
//find all child entries |
|
|
|
$result = $query->execute(array($source . '/%')); |
|
|
|
$query = \OC_DB::prepare('SELECT `path`, `fileid` FROM `*PREFIX*filecache` WHERE `path` LIKE ?'); |
|
|
|
$childEntries = $result->fetchAll(); |
|
|
|
$result = $query->execute(array($source . '/%')); |
|
|
|
$sourceLength = strlen($source); |
|
|
|
$childEntries = $result->fetchAll(); |
|
|
|
$query = \OC_DB::prepare('UPDATE `*PREFIX*filecache` SET `path` = ?, `path_hash` = ? WHERE `fileid` = ?'); |
|
|
|
$sourceLength = strlen($source); |
|
|
|
|
|
|
|
$query = \OC_DB::prepare('UPDATE `*PREFIX*filecache` SET `path` = ?, `path_hash` = ? WHERE `fileid` = ?'); |
|
|
|
foreach ($childEntries as $child) { |
|
|
|
|
|
|
|
$targetPath = $target . substr($child['path'], $sourceLength); |
|
|
|
foreach ($childEntries as $child) { |
|
|
|
$query->execute(array($targetPath, md5($targetPath), $child['fileid'])); |
|
|
|
$targetPath = $target . substr($child['path'], $sourceLength); |
|
|
|
|
|
|
|
$query->execute(array($targetPath, md5($targetPath), $child['fileid'])); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
$query = \OC_DB::prepare('UPDATE `*PREFIX*filecache` SET `path` = ?, `path_hash` = ?, `name` = ?, `parent` =?' |
|
|
|
$query = \OC_DB::prepare('UPDATE `*PREFIX*filecache` SET `path` = ?, `path_hash` = ?, `name` = ?, `parent` =?' |
|
|
|