diff options
author | Robin Appelman <robin@icewind.nl> | 2017-04-26 16:41:48 +0200 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2017-04-26 16:41:48 +0200 |
commit | 43970b93d137f06d64f58819a3c4f48dac07fea1 (patch) | |
tree | bc6e09444e84254d6d0ce34d55ee4919b6be2dc9 /apps/files_external | |
parent | f2bd5f749605d64cc82a337c0a31cbb87bee7693 (diff) | |
download | nextcloud-server-43970b93d137f06d64f58819a3c4f48dac07fea1.tar.gz nextcloud-server-43970b93d137f06d64f58819a3c4f48dac07fea1.zip |
remove excessive logging
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'apps/files_external')
-rw-r--r-- | apps/files_external/lib/Lib/Storage/SMB.php | 33 |
1 files changed, 8 insertions, 25 deletions
diff --git a/apps/files_external/lib/Lib/Storage/SMB.php b/apps/files_external/lib/Lib/Storage/SMB.php index 859fceb50aa..8f595f05bc1 100644 --- a/apps/files_external/lib/Lib/Storage/SMB.php +++ b/apps/files_external/lib/Lib/Storage/SMB.php @@ -31,6 +31,7 @@ namespace OCA\Files_External\Lib\Storage; +use Icewind\SMB\Exception\AlreadyExistsException; use Icewind\SMB\Exception\ConnectException; use Icewind\SMB\Exception\Exception; use Icewind\SMB\Exception\ForbiddenException; @@ -182,28 +183,21 @@ class SMB extends Common implements INotifyStorage { * @return bool true if the rename is successful, false otherwise */ public function rename($source, $target) { - $this->log("enter: rename('$source', '$target')", Util::DEBUG); - if ($this->isRootDir($source) || $this->isRootDir($target)) { - $this->log("refusing to rename \"$source\" to \"$target\""); - return $this->leave(__FUNCTION__, false); + return false; } try { $result = $this->share->rename($this->root . $source, $this->root . $target); - $this->removeFromCache($this->root . $source); - $this->removeFromCache($this->root . $target); + unset($this->statCache[$this->root . $source], $this->statCache[$this->root . $target]); } catch (AlreadyExistsException $e) { $this->unlink($target); $result = $this->share->rename($this->root . $source, $this->root . $target); - $this->removeFromCache($this->root . $source); - $this->removeFromCache($this->root . $target); - $this->swallow(__FUNCTION__, $e); + unset($this->statCache[$this->root . $source], $this->statCache[$this->root . $target]); } catch (\Exception $e) { - $this->swallow(__FUNCTION__, $e); $result = false; } - return $this->leave(__FUNCTION__, $result); + return $result; } /** @@ -258,11 +252,8 @@ class SMB extends Common implements INotifyStorage { * @return bool */ public function unlink($path) { - $this->log('enter: '.__FUNCTION__."($path)"); - if ($this->isRootDir($path)) { - $this->log("refusing to unlink \"$path\""); - return $this->leave(__FUNCTION__, false); + return false; } try { @@ -311,7 +302,7 @@ class SMB extends Common implements INotifyStorage { * @return bool */ public function hasUpdated($path, $time) { - if (!$path and $this->root == '/') { + if (!$path and $this->root === '/') { // mtime doesn't work for shares, but giving the nature of the backend, // doing a full update is still just fast enough return true; @@ -388,11 +379,8 @@ class SMB extends Common implements INotifyStorage { } public function rmdir($path) { - $this->log('enter: '.__FUNCTION__."($path)"); - if ($this->isRootDir($path)) { - $this->log("refusing to delete \"$path\""); - return $this->leave(__FUNCTION__, false); + return false; } try { @@ -491,8 +479,6 @@ class SMB extends Common implements INotifyStorage { } public function isUpdatable($path) { - $this->log('enter: '.__FUNCTION__."($path)"); - $result = false; try { $info = $this->getFileInfo($path); // following windows behaviour for read-only folders: they can be written into @@ -503,12 +489,9 @@ class SMB extends Common implements INotifyStorage { } catch (ForbiddenException $e) { return false; } - return $this->leave(__FUNCTION__, $result); } public function isDeletable($path) { - $this->log('enter: '.__FUNCTION__."($path)"); - $result = false; try { $info = $this->getFileInfo($path); return !$info->isHidden() && !$info->isReadOnly(); |