aboutsummaryrefslogtreecommitdiffstats
path: root/lib/fileproxy
diff options
context:
space:
mode:
authorSam Tuke <samtuke@owncloud.com>2013-01-31 16:30:37 +0000
committerSam Tuke <samtuke@owncloud.com>2013-01-31 16:30:37 +0000
commit31e723a907399d7d33a0699da082164055f79b3e (patch)
tree7da079cc3db0a46512da1b02cc19307337d9ce54 /lib/fileproxy
parentc7b1bdf00e65cca2a42d77fc5f27d0ea69e53be3 (diff)
parent209d599ec5b00c5b92a33e902867fc621e725c93 (diff)
downloadnextcloud-server-31e723a907399d7d33a0699da082164055f79b3e.tar.gz
nextcloud-server-31e723a907399d7d33a0699da082164055f79b3e.zip
Merge github.com:owncloud/core
Conflicts: lib/public/share.php
Diffstat (limited to 'lib/fileproxy')
-rw-r--r--lib/fileproxy/fileoperations.php6
-rw-r--r--lib/fileproxy/quota.php28
2 files changed, 18 insertions, 16 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 503288142aa..7e0f631c8fb 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,23 +57,25 @@ 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);
+ if (!$owner) {
+ return -1;
+ }
$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 +95,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);
}