summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing
diff options
context:
space:
mode:
authorMichael Gapczynski <GapczynskiM@gmail.com>2011-07-30 19:40:19 -0400
committerMichael Gapczynski <GapczynskiM@gmail.com>2011-07-30 19:40:19 -0400
commit11d162751381963e0c8a86cf15c811cc99003654 (patch)
tree276b5b1e67a66491ef553346087b2959f35b3bc7 /apps/files_sharing
parentd13ba0ee2d93080ba56776442b9d39a53e2b6321 (diff)
parentd6faa89ed720da7319923cba33a83d0210216d57 (diff)
downloadnextcloud-server-11d162751381963e0c8a86cf15c811cc99003654.tar.gz
nextcloud-server-11d162751381963e0c8a86cf15c811cc99003654.zip
Merge branch 'master' into sharing. Integrate with changes in master, rename classes
Conflicts: lib/base.php
Diffstat (limited to 'apps/files_sharing')
-rw-r--r--apps/files_sharing/ajax/share.php2
-rw-r--r--apps/files_sharing/ajax/unshare.php2
-rw-r--r--apps/files_sharing/ajax/userautocomplete.php6
-rw-r--r--apps/files_sharing/appinfo/app.php6
-rw-r--r--apps/files_sharing/lib_share.php38
-rw-r--r--apps/files_sharing/list.php11
-rw-r--r--apps/files_sharing/sharedstorage.php94
7 files changed, 78 insertions, 81 deletions
diff --git a/apps/files_sharing/ajax/share.php b/apps/files_sharing/ajax/share.php
index b2c3a477958..6e860d584ea 100644
--- a/apps/files_sharing/ajax/share.php
+++ b/apps/files_sharing/ajax/share.php
@@ -9,7 +9,7 @@ $uid_shared_with = $_GET['uid_shared_with'];
$permissions = $_GET['permissions'];
foreach ($sources as $source) {
foreach ($uid_shared_with as $uid) {
- new OC_SHARE($source, $uid, $permissions);
+ new OC_Share($source, $uid, $permissions);
}
}
diff --git a/apps/files_sharing/ajax/unshare.php b/apps/files_sharing/ajax/unshare.php
index 4d83d332257..78d7d2e25f0 100644
--- a/apps/files_sharing/ajax/unshare.php
+++ b/apps/files_sharing/ajax/unshare.php
@@ -6,6 +6,6 @@ require_once('../lib_share.php');
$source = $_GET['source'];
$uid_shared_with = $_GET['uid_shared_with'];
-OC_SHARE::unshare($source, $uid_shared_with);
+OC_Share::unshare($source, $uid_shared_with);
?> \ No newline at end of file
diff --git a/apps/files_sharing/ajax/userautocomplete.php b/apps/files_sharing/ajax/userautocomplete.php
index 6e1469ae348..816e01ba9ee 100644
--- a/apps/files_sharing/ajax/userautocomplete.php
+++ b/apps/files_sharing/ajax/userautocomplete.php
@@ -3,7 +3,7 @@ $RUNTIME_NOAPPS = true;
require_once('../../../lib/base.php');
-if (!OC_USER::isLoggedIn()) {
+if (!OC_User::isLoggedIn()) {
echo json_encode(array("status" => "error", "data" => array("message" => "Authentication error")));
exit();
}
@@ -11,8 +11,8 @@ $query = $_GET['term'];
$length = strlen($query);
$query = strtolower($query);
$users = array();
-$ocusers = OC_USER::getUsers();
-$self = OC_USER::getUser();
+$ocusers = OC_User::getUsers();
+$self = OC_User::getUser();
$groups = OC_GROUP::getUserGroups($self);
foreach ($ocusers as $user) {
if ($user != $self && substr(strtolower($user), 0, $length) == $query) {
diff --git a/apps/files_sharing/appinfo/app.php b/apps/files_sharing/appinfo/app.php
index 60abcda50f9..e7e19869d2a 100644
--- a/apps/files_sharing/appinfo/app.php
+++ b/apps/files_sharing/appinfo/app.php
@@ -2,11 +2,11 @@
require_once('apps/files_sharing/lib_share.php');
-OC_UTIL::addScript("files_sharing", "share");
-OC_APP::addNavigationSubEntry("files_index", array(
+OC_Util::addScript("files_sharing", "share");
+OC_App::addNavigationSubEntry("files_index", array(
"id" => "files_sharing_list",
"order" => 10,
- "href" => OC_HELPER::linkTo( "files_sharing", "list.php" ),
+ "href" => OC_Helper::linkTo( "files_sharing", "list.php" ),
"name" => "Shared"));
?>
diff --git a/apps/files_sharing/lib_share.php b/apps/files_sharing/lib_share.php
index fa74cd14ee9..f8b00aa905d 100644
--- a/apps/files_sharing/lib_share.php
+++ b/apps/files_sharing/lib_share.php
@@ -20,13 +20,13 @@
*
*/
-OC_HOOK::connect("OC_FILESYSTEM","post_delete", "OC_SHARE", "deleteItem");
-OC_HOOK::connect("OC_FILESYSTEM","post_rename", "OC_SHARE", "renameItem");
+OC_Hook::connect("OC_FILESYSTEM","post_delete", "OC_Share", "deleteItem");
+OC_Hook::connect("OC_FILESYSTEM","post_rename", "OC_Share", "renameItem");
/**
* This class manages shared items within the database.
*/
-class OC_SHARE {
+class OC_Share {
const WRITE = 1;
const DELETE = 2;
@@ -39,8 +39,8 @@ class OC_SHARE {
*/
public function __construct($source, $uid_shared_with, $permissions, $public = false) {
if ($source && OC_FILESYSTEM::file_exists($source) && OC_FILESYSTEM::is_readable($source)) {
- $source = "/".OC_USER::getUser()."/files".$source;
- $uid_owner = OC_USER::getUser();
+ $source = "/".OC_User::getUser()."/files".$source;
+ $uid_owner = OC_User::getUser();
if ($public) {
// TODO create token for public file
$token = sha1("$uid_owner-$item");
@@ -85,8 +85,8 @@ class OC_SHARE {
* @return An array to be used by the IN operator in a query for uid_shared_with
*/
private static function getUserAndGroups() {
- $self = OC_USER::getUser();
- $groups = OC_GROUP::getUserGroups($self);
+ $self = OC_User::getUser();
+ $groups = OC_Group::getUserGroups($self);
array_unshift($groups, $self);
return $groups;
}
@@ -104,7 +104,7 @@ class OC_SHARE {
$source = $folders['source'].substr($oldTarget, strlen($folders['target']));
$item = self::getItem($folders['target']);
$query = OC_DB::prepare("INSERT INTO *PREFIX*sharing VALUES(?,?,?,?,?)");
- $query->execute(array($item[0]['uid_owner'], OC_USER::getUser(), $source, $newTarget, $item[0]['permissions']));
+ $query->execute(array($item[0]['uid_owner'], OC_User::getUser(), $source, $newTarget, $item[0]['permissions']));
}
/**
@@ -115,7 +115,7 @@ class OC_SHARE {
public static function getItem($target) {
$target = self::cleanPath($target);
$query = OC_DB::prepare("SELECT uid_owner, source, permissions FROM *PREFIX*sharing WHERE target = ? AND uid_shared_with = ? LIMIT 1");
- return $query->execute(array($target, OC_USER::getUser()))->fetchAll();
+ return $query->execute(array($target, OC_User::getUser()))->fetchAll();
}
/**
@@ -124,7 +124,7 @@ class OC_SHARE {
*/
public static function getMySharedItems() {
$query = OC_DB::prepare("SELECT uid_shared_with, source, permissions FROM *PREFIX*sharing WHERE uid_owner = ?");
- return $query->execute(array(OC_USER::getUser()))->fetchAll();
+ return $query->execute(array(OC_User::getUser()))->fetchAll();
}
/**
@@ -230,7 +230,7 @@ class OC_SHARE {
$oldSource = self::cleanPath($oldSource);
$newSource = self::cleanPath($newSource);
$query = OC_DB::prepare("UPDATE *PREFIX*sharing SET source = REPLACE(source, ?, ?) WHERE uid_owner = ?");
- $query->execute(array($oldSource, $newSource, OC_USER::getUser()));
+ $query->execute(array($oldSource, $newSource, OC_User::getUser()));
}
/**
@@ -245,7 +245,7 @@ class OC_SHARE {
$oldTarget = self::cleanPath($oldTarget);
$newTarget = self::cleanPath($newTarget);
$query = OC_DB::prepare("UPDATE *PREFIX*sharing SET target = REPLACE(target, ?, ?) WHERE uid_shared_with = ?");
- $query->execute(array($oldTarget, $newTarget, OC_USER::getUser()));
+ $query->execute(array($oldTarget, $newTarget, OC_User::getUser()));
}
/**
@@ -260,7 +260,7 @@ class OC_SHARE {
public static function setPermissions($source, $uid_shared_with, $permissions) {
$source = self::cleanPath($source);
$query = OC_DB::prepare("UPDATE *PREFIX*sharing SET permissions = ? WHERE SUBSTR(source, 1, ?) = ? AND uid_shared_with = ? AND uid_owner = ?");
- $query->execute(array($permissions, strlen($source), $source, $uid_shared_with, OC_USER::getUser()));
+ $query->execute(array($permissions, strlen($source), $source, $uid_shared_with, OC_User::getUser()));
}
/**
@@ -274,7 +274,7 @@ class OC_SHARE {
public static function unshare($source, $uid_shared_with) {
$source = self::cleanPath($source);
$query = OC_DB::prepare("DELETE FROM *PREFIX*sharing WHERE SUBSTR(source, 1, ?) = ? AND uid_shared_with = ? AND uid_owner = ?");
- $query->execute(array(strlen($source), $source, $uid_shared_with, OC_USER::getUser()));
+ $query->execute(array(strlen($source), $source, $uid_shared_with, OC_User::getUser()));
}
/**
@@ -287,7 +287,7 @@ class OC_SHARE {
public static function unshareFromMySelf($target) {
$target = self::cleanPath($target);
$query = OC_DB::prepare("DELETE FROM *PREFIX*sharing WHERE SUBSTR(target, 1, ?) = ? AND uid_shared_with = ?");
- $query->execute(array(strlen($target), $target, OC_USER::getUser()));
+ $query->execute(array(strlen($target), $target, OC_User::getUser()));
}
/**
@@ -295,10 +295,10 @@ class OC_SHARE {
* @param $arguments Array of arguments passed from OC_HOOK
*/
public static function deleteItem($arguments) {
- $source = "/".OC_USER::getUser()."/files".$arguments['path'];
+ $source = "/".OC_User::getUser()."/files".$arguments['path'];
$source = self::cleanPath($source);
$query = OC_DB::prepare("DELETE FROM *PREFIX*sharing WHERE SUBSTR(source, 1, ?) = ? AND uid_owner = ?");
- $query->execute(array(strlen($source), $source, OC_USER::getUser()));
+ $query->execute(array(strlen($source), $source, OC_User::getUser()));
}
/**
@@ -306,9 +306,9 @@ class OC_SHARE {
* @param $arguments Array of arguments passed from OC_HOOK
*/
public static function renameItem($arguments) {
- $oldSource = "/".OC_USER::getUser()."/files".$arguments['oldpath'];
+ $oldSource = "/".OC_User::getUser()."/files".$arguments['oldpath'];
$oldSource = self::cleanPath($oldSource);
- $newSource = "/".OC_USER::getUser()."/files".$arguments['newpath'];
+ $newSource = "/".OC_User::getUser()."/files".$arguments['newpath'];
$newSource = self::cleanPath($newSource);
self::setSource($oldSource, $newSource);
}
diff --git a/apps/files_sharing/list.php b/apps/files_sharing/list.php
index 6c27899369d..0a11f438eb7 100644
--- a/apps/files_sharing/list.php
+++ b/apps/files_sharing/list.php
@@ -22,19 +22,18 @@
require_once('../../lib/base.php');
require_once('lib_share.php');
-require('template.php');
-if (!OC_USER::isLoggedIn()){
+if (!OC_User::isLoggedIn()){
header( "Location: ".OC_HELPER::linkTo( "index.php" ));
exit();
}
-OC_APP::setActiveNavigationEntry("files_sharing_list");
+OC_App::setActiveNavigationEntry("files_sharing_list");
-OC_UTIL::addScript("files_sharing", "list");
+OC_Util::addScript("files_sharing", "list");
-$tmpl = new OC_TEMPLATE("files_sharing", "list", "user");
-$tmpl->assign("shared_items", OC_SHARE::getMySharedItems());
+$tmpl = new OC_Template("files_sharing", "list", "user");
+$tmpl->assign("shared_items", OC_Share::getMySharedItems());
$tmpl->printPage();
?> \ No newline at end of file
diff --git a/apps/files_sharing/sharedstorage.php b/apps/files_sharing/sharedstorage.php
index 44a78277fc8..75767daf839 100644
--- a/apps/files_sharing/sharedstorage.php
+++ b/apps/files_sharing/sharedstorage.php
@@ -22,12 +22,10 @@
require_once( 'lib_share.php' );
-OC_FILESYSTEM::registerStorageType('shared','OC_FILESTORAGE_SHARED',array('datadir'=>'string'));
-
/**
* Convert target path to source path and pass the function call to the correct storage provider
*/
-class OC_FILESTORAGE_SHARED extends OC_FILESTORAGE {
+class OC_Filestorage_Shared extends OC_Filestorage {
private $datadir;
private $sourcePaths = array();
@@ -37,7 +35,7 @@ class OC_FILESTORAGE_SHARED extends OC_FILESTORAGE {
}
public function getInternalPath($path) {
- $mountPoint = OC_FILESYSTEM::getMountPoint($path);
+ $mountPoint = OC_Filesystem::getMountPoint($path);
$internalPath = substr($path, strlen($mountPoint));
return $internalPath;
}
@@ -47,7 +45,7 @@ class OC_FILESTORAGE_SHARED extends OC_FILESTORAGE {
if (array_key_exists($target, $this->sourcePaths)) {
return $this->sourcePaths[$target];
} else {
- $source = OC_SHARE::getSource($target);
+ $source = OC_Share::getSource($target);
$this->sourcePaths[$target] = $source;
return $source;
}
@@ -60,7 +58,7 @@ class OC_FILESTORAGE_SHARED extends OC_FILESTORAGE {
$source = $this->getSource($path);
if ($source) {
if ($this->is_writeable($path)) {
- $storage = OC_FILESYSTEM::getStorage($source);
+ $storage = OC_Filesystem::getStorage($source);
return $storage->mkdir($this->getInternalPath($source));
}
}
@@ -69,14 +67,14 @@ class OC_FILESTORAGE_SHARED extends OC_FILESTORAGE {
public function rmdir($path) {
// The folder will be removed from the database, but won't be deleted from the owner's filesystem
- OC_SHARE::unshareFromMySelf($this->datadir.$path);
+ OC_Share::unshareFromMySelf($this->datadir.$path);
}
public function opendir($path) {
if ($path == "" || $path == "/") {
global $FAKEDIRS;
$path = $this->datadir.$path;
- $sharedItems = OC_SHARE::getItemsInFolder($path);
+ $sharedItems = OC_Share::getItemsInFolder($path);
if (empty($sharedItems)) {
return false;
}
@@ -91,12 +89,12 @@ class OC_FILESTORAGE_SHARED extends OC_FILESTORAGE {
} else {
$source = $this->getSource($path);
if ($source) {
- $storage = OC_FILESYSTEM::getStorage($source);
+ $storage = OC_Filesystem::getStorage($source);
$dh = $storage->opendir($this->getInternalPath($source));
// Remove any duplicate or trailing '/'
$path = rtrim($this->datadir.$path, "/");
$path = preg_replace('{(/)\1+}', "/", $path);
- $modifiedItems = OC_SHARE::getItemsInFolder($source);
+ $modifiedItems = OC_Share::getItemsInFolder($source);
if ($modifiedItems && $dh) {
global $FAKEDIRS;
$sources = array();
@@ -147,7 +145,7 @@ class OC_FILESTORAGE_SHARED extends OC_FILESTORAGE {
} else {
$source = $this->getSource($path);
if ($source) {
- $storage = OC_FILESYSTEM::getStorage($source);
+ $storage = OC_Filesystem::getStorage($source);
return $storage->is_dir($this->getInternalPath($source));
}
}
@@ -156,7 +154,7 @@ class OC_FILESTORAGE_SHARED extends OC_FILESTORAGE {
public function is_file($path) {
$source = $this->getSource($path);
if ($source) {
- $storage = OC_FILESYSTEM::getStorage($source);
+ $storage = OC_Filesystem::getStorage($source);
return $storage->is_file($this->getInternalPath($source));
}
}
@@ -181,7 +179,7 @@ class OC_FILESTORAGE_SHARED extends OC_FILESTORAGE {
} else {
$source = $this->getSource($path);
if ($source) {
- $storage = OC_FILESYSTEM::getStorage($source);
+ $storage = OC_Filesystem::getStorage($source);
return $storage->stat($this->getInternalPath($source));
}
}
@@ -193,7 +191,7 @@ class OC_FILESTORAGE_SHARED extends OC_FILESTORAGE {
} else {
$source = $this->getSource($path);
if ($source) {
- $storage = OC_FILESYSTEM::getStorage($source);
+ $storage = OC_Filesystem::getStorage($source);
return $storage->filetype($this->getInternalPath($source));
}
}
@@ -206,7 +204,7 @@ class OC_FILESTORAGE_SHARED extends OC_FILESTORAGE {
} else {
$source = $this->getSource($path);
if ($source) {
- $storage = OC_FILESYSTEM::getStorage($source);
+ $storage = OC_Filesystem::getStorage($source);
return $storage->filesize($this->getInternalPath($source));
}
}
@@ -214,7 +212,7 @@ class OC_FILESTORAGE_SHARED extends OC_FILESTORAGE {
public function getFolderSize($path) {
if ($path == "" || $path == "/") {
- $dbpath = $this->datadir;
+ $dbpath = OC_User::getUser()."/files/Share/";
} else {
$source = $this->getSource($path);
$dbpath = $this->getInternalPath($source);
@@ -250,7 +248,7 @@ class OC_FILESTORAGE_SHARED extends OC_FILESTORAGE {
}
if ($size > 0) {
if ($path == "" || $path == "/") {
- $dbpath = OC_USER::getUser()."/files/Share/";
+ $dbpath = OC_User::getUser()."/files/Share/";
} else {
$source = $this->getSource($path);
$dbpath = $this->getInternalPath($source);
@@ -267,7 +265,7 @@ class OC_FILESTORAGE_SHARED extends OC_FILESTORAGE {
}
public function is_writeable($path) {
- if ($path == "" || $path == "/" || OC_SHARE::getPermissions($this->datadir.$path) & OC_SHARE::WRITE) {
+ if ($path == "" || $path == "/" || OC_Share::getPermissions($this->datadir.$path) & OC_Share::WRITE) {
return true;
} else {
return false;
@@ -280,7 +278,7 @@ class OC_FILESTORAGE_SHARED extends OC_FILESTORAGE {
} else {
$source = $this->getSource($path);
if ($source) {
- $storage = OC_FILESYSTEM::getStorage($source);
+ $storage = OC_Filesystem::getStorage($source);
return $storage->file_exists($this->getInternalPath($source));
}
}
@@ -289,7 +287,7 @@ class OC_FILESTORAGE_SHARED extends OC_FILESTORAGE {
public function readfile($path) {
$source = $this->getSource($path);
if ($source) {
- $storage = OC_FILESYSTEM::getStorage($source);
+ $storage = OC_Filesystem::getStorage($source);
return $storage->readfile($this->getInternalPath($source));
}
}
@@ -308,7 +306,7 @@ class OC_FILESTORAGE_SHARED extends OC_FILESTORAGE {
} else {
$source = $this->getSource($path);
if ($source) {
- $storage = OC_FILESYSTEM::getStorage($source);
+ $storage = OC_Filesystem::getStorage($source);
return $storage->filectime($this->getInternalPath($source));
}
}
@@ -328,7 +326,7 @@ class OC_FILESTORAGE_SHARED extends OC_FILESTORAGE {
} else {
$source = $this->getSource($path);
if ($source) {
- $storage = OC_FILESYSTEM::getStorage($source);
+ $storage = OC_Filesystem::getStorage($source);
return $storage->filemtime($this->getInternalPath($source));
}
}
@@ -348,7 +346,7 @@ class OC_FILESTORAGE_SHARED extends OC_FILESTORAGE {
} else {
$source = $this->getSource($path);
if ($source) {
- $storage = OC_FILESYSTEM::getStorage($source);
+ $storage = OC_Filesystem::getStorage($source);
return $storage->fileatime($this->getInternalPath($source));
}
}
@@ -357,7 +355,7 @@ class OC_FILESTORAGE_SHARED extends OC_FILESTORAGE {
public function file_get_contents($path) {
$source = $this->getSource($path);
if ($source) {
- $storage = OC_FILESYSTEM::getStorage($source);
+ $storage = OC_Filesystem::getStorage($source);
return $storage->file_get_contents($this->getInternalPath($source));
}
}
@@ -366,7 +364,7 @@ class OC_FILESTORAGE_SHARED extends OC_FILESTORAGE {
if ($this->is_writeable($path)) {
$source = $this->getSource($path);
if ($source) {
- $storage = OC_FILESYSTEM::getStorage($source);
+ $storage = OC_Filesystem::getStorage($source);
return $storage->file_put_contents($this->getInternalPath($source), $data);
}
}
@@ -375,29 +373,29 @@ class OC_FILESTORAGE_SHARED extends OC_FILESTORAGE {
public function unlink($path) {
$target = $this->datadir.$path;
// If the user has delete permission for the item, the source item will be deleted
- if (OC_SHARE::getPermissions($target) & OC_SHARE::DELETE) {
+ if (OC_Share::getPermissions($target) & OC_Share::DELETE) {
$source = $this->getSource($path);
if ($source) {
- $storage = OC_FILESYSTEM::getStorage($source);
+ $storage = OC_Filesystem::getStorage($source);
return $storage->unlink($this->getInternalPath($source));
}
// The item will be removed from the database, but won't be touched on the owner's filesystem
} else {
// Check if the item is inside a shared folder
- if (OC_SHARE::getParentFolders($target)) {
+ if (OC_Share::getParentFolders($target)) {
// If entry for item already exists
- if (OC_SHARE::getItem($target)) {
- OC_SHARE::setTarget($target, "/");
+ if (OC_Share::getItem($target)) {
+ OC_Share::setTarget($target, "/");
} else {
- OC_SHARE::pullOutOfFolder($target, "/");
+ OC_Share::pullOutOfFolder($target, "/");
// If this is a folder being deleted, call setTarget in case there are any database entries inside the folder
if (self::is_dir($path)) {
- OC_SHARE::setTarget($target, "/");
+ OC_Share::setTarget($target, "/");
}
}
// Delete the database entry
} else {
- OC_SHARE::unshareFromMySelf($target);
+ OC_Share::unshareFromMySelf($target);
}
}
return true;
@@ -408,21 +406,21 @@ class OC_FILESTORAGE_SHARED extends OC_FILESTORAGE {
if ($this->is_writeable($path1)) {
$source = $this->getSource($path1);
if ($source) {
- $storage = OC_FILESYSTEM::getStorage($source);
+ $storage = OC_Filesystem::getStorage($source);
return $storage->rename($path1, $path2);
}
// The item will be renamed in the database, but won't be touched on the owner's filesystem
} else {
$oldTarget = $this->datadir.$path1;
$newTarget = $this->datadir.$path2;
- if (OC_SHARE::getItem($oldTarget)) {
- OC_SHARE::setTarget($oldTarget, $newTarget);
+ if (OC_Share::getItem($oldTarget)) {
+ OC_Share::setTarget($oldTarget, $newTarget);
// There is no entry in the database for the item, it must be inside a shared folder
} else {
- OC_SHARE::pullOutOfFolder($oldTarget, $newTarget);
+ OC_Share::pullOutOfFolder($oldTarget, $newTarget);
// If this is a folder being renamed, call setTarget in case there are any database entries inside the folder
if (self::is_dir($path1)) {
- OC_SHARE::setTarget($oldTarget, $newTarget);
+ OC_Share::setTarget($oldTarget, $newTarget);
}
}
}
@@ -445,7 +443,7 @@ class OC_FILESTORAGE_SHARED extends OC_FILESTORAGE {
public function fopen($path, $mode) {
$source = $this->getSource($path);
if ($source) {
- $storage = OC_FILESYSTEM::getStorage($source);
+ $storage = OC_Filesystem::getStorage($source);
return $storage->fopen($this->getInternalPath($source), $mode);
}
}
@@ -453,7 +451,7 @@ class OC_FILESTORAGE_SHARED extends OC_FILESTORAGE {
public function toTmpFile($path) {
$source = $this->getSource($path);
if ($source) {
- $storage = OC_FILESYSTEM::getStorage($source);
+ $storage = OC_Filesystem::getStorage($source);
return $storage->toTmpFile($this->getInternalPath($source));
}
}
@@ -462,7 +460,7 @@ class OC_FILESTORAGE_SHARED extends OC_FILESTORAGE {
if ($this->is_writeable($path)) {
$source = $this->getSource($path);
if ($source) {
- $storage = OC_FILESYSTEM::getStorage($source);
+ $storage = OC_Filesystem::getStorage($source);
return $storage->fromTmpFile($tmpFile, $this->getInternalPath($source));
}
} else {
@@ -473,7 +471,7 @@ class OC_FILESTORAGE_SHARED extends OC_FILESTORAGE {
public function fromUploadedFile($tmpPath, $path) {
$source = $this->getSource($tmpPath);
if ($source) {
- $storage = OC_FILESYSTEM::getStorage($source);
+ $storage = OC_Filesystem::getStorage($source);
return $storage->fromUploadedFile($this->getInternalPath($source), $path);
}
}
@@ -481,7 +479,7 @@ class OC_FILESTORAGE_SHARED extends OC_FILESTORAGE {
public function getMimeType($path) {
$source = $this->getSource($path);
if ($source) {
- $storage = OC_FILESYSTEM::getStorage($source);
+ $storage = OC_Filesystem::getStorage($source);
return $storage->getMimeType($this->getInternalPath($source));
}
}
@@ -489,7 +487,7 @@ class OC_FILESTORAGE_SHARED extends OC_FILESTORAGE {
public function delTree($path) {
$source = $this->getSource($path);
if ($source) {
- $storage = OC_FILESYSTEM::getStorage($source);
+ $storage = OC_Filesystem::getStorage($source);
return $storage->delTree($this->getInternalPath($source));
}
}
@@ -497,7 +495,7 @@ class OC_FILESTORAGE_SHARED extends OC_FILESTORAGE {
public function find($path) {
$source = $this->getSource($path);
if ($source) {
- $storage = OC_FILESYSTEM::getStorage($source);
+ $storage = OC_Filesystem::getStorage($source);
return $storage->find($this->getInternalPath($source));
}
}
@@ -505,7 +503,7 @@ class OC_FILESTORAGE_SHARED extends OC_FILESTORAGE {
public function getTree($path) {
$source = $this->getSource($path);
if ($source) {
- $storage = OC_FILESYSTEM::getStorage($source);
+ $storage = OC_Filesystem::getStorage($source);
return $storage->getTree($this->getInternalPath($source));
}
}
@@ -513,7 +511,7 @@ class OC_FILESTORAGE_SHARED extends OC_FILESTORAGE {
public function hash($type, $path, $raw) {
$source = $this->getSource($path);
if ($source) {
- $storage = OC_FILESYSTEM::getStorage($source);
+ $storage = OC_Filesystem::getStorage($source);
return $storage->hash($type, $this->getInternalPath($source), $raw);
}
}
@@ -521,7 +519,7 @@ class OC_FILESTORAGE_SHARED extends OC_FILESTORAGE {
public function free_space($path) {
$source = $this->getSource($path);
if ($source) {
- $storage = OC_FILESYSTEM::getStorage($source);
+ $storage = OC_Filesystem::getStorage($source);
return $storage->free_space($this->getInternalPath($source));
}
}