diff options
Diffstat (limited to 'lib/fileproxy')
-rw-r--r-- | lib/fileproxy/fileoperations.php | 6 | ||||
-rw-r--r-- | lib/fileproxy/quota.php | 24 |
2 files changed, 15 insertions, 15 deletions
diff --git a/lib/fileproxy/fileoperations.php b/lib/fileproxy/fileoperations.php index 516629adaec..47ccd8f8c26 100644 --- a/lib/fileproxy/fileoperations.php +++ b/lib/fileproxy/fileoperations.php @@ -28,10 +28,10 @@ class OC_FileProxy_FileOperations extends OC_FileProxy{ static $rootView; public function premkdir($path) { - if(!self::$rootView) { - self::$rootView = new OC_FilesystemView(''); + if(!self::$rootView){ + self::$rootView = new \OC\Files\View(''); } return !self::$rootView->file_exists($path); } -}
\ No newline at end of file +} diff --git a/lib/fileproxy/quota.php b/lib/fileproxy/quota.php index 742e02d471b..80270728aba 100644 --- a/lib/fileproxy/quota.php +++ b/lib/fileproxy/quota.php @@ -22,7 +22,7 @@ */ /** - * user quota managment + * user quota management */ class OC_FileProxy_Quota extends OC_FileProxy{ @@ -57,21 +57,21 @@ class OC_FileProxy_Quota extends OC_FileProxy{ * @return int */ private function getFreeSpace($path) { - $storage=OC_Filesystem::getStorage($path); - $owner=$storage->getOwner($path); + /** + * @var \OC\Files\Storage\Storage $storage + * @var string $internalPath + */ + list($storage, $internalPath) = \OC\Files\Filesystem::resolvePath($path); + $owner=$storage->getOwner($internalPath); $totalSpace=$this->getQuota($owner); if($totalSpace==-1) { return -1; } - $rootInfo=OC_FileCache::get('', "/".$owner."/files"); - // TODO Remove after merge of share_api - if (OC_FileCache::inCache('/Shared', "/".$owner."/files")) { - $sharedInfo=OC_FileCache::get('/Shared', "/".$owner."/files"); - } else { - $sharedInfo = null; - } + $view = new \OC\Files\View("/".$owner."/files"); + + $rootInfo=$view->getFileInfo('/'); $usedSpace=isset($rootInfo['size'])?$rootInfo['size']:0; $usedSpace=isset($sharedInfo['size'])?$usedSpace-$sharedInfo['size']:$usedSpace; return $totalSpace-$usedSpace; @@ -93,8 +93,8 @@ class OC_FileProxy_Quota extends OC_FileProxy{ } public function preCopy($path1, $path2) { - if(!self::$rootView) { - self::$rootView = new OC_FilesystemView(''); + if(!self::$rootView){ + self::$rootView = new \OC\Files\View(''); } return (self::$rootView->filesize($path1)<$this->getFreeSpace($path2) or $this->getFreeSpace($path2)==-1); } |