summaryrefslogtreecommitdiffstats
path: root/lib/files.php
diff options
context:
space:
mode:
authorBart Visscher <bartv@thisnet.nl>2012-09-21 13:30:39 +0200
committerBart Visscher <bartv@thisnet.nl>2012-09-21 13:31:12 +0200
commitb6dc6c5bb9903a85b634a0b4d57f5cf6657ea49b (patch)
treeb716171bec3a33438b35d6f0a101ccedaa749abf /lib/files.php
parent2a7a928ae9e808652029d3d8febe9d4d8b05558c (diff)
downloadnextcloud-server-b6dc6c5bb9903a85b634a0b4d57f5cf6657ea49b.tar.gz
nextcloud-server-b6dc6c5bb9903a85b634a0b4d57f5cf6657ea49b.zip
Don't use OC_FileCache directly, but use the functions in OC_Files
This adds getFileInfo to OC_Files to also get fileinfo from shared files
Diffstat (limited to 'lib/files.php')
-rw-r--r--lib/files.php28
1 files changed, 28 insertions, 0 deletions
diff --git a/lib/files.php b/lib/files.php
index 63dd96b9509..f7cc70959c0 100644
--- a/lib/files.php
+++ b/lib/files.php
@@ -29,6 +29,34 @@ class OC_Files {
static $tmpFiles=array();
/**
+ * get the filesystem info
+ * @param string path
+ * @return array
+ *
+ * returns an associative array with the following keys:
+ * - size
+ * - mtime
+ * - ctime
+ * - mimetype
+ * - encrypted
+ * - versioned
+ */
+ public static function getFileInfo($path) {
+ if (($path == '/Shared' || substr($path, 0, 8) == '/Shared/') && OC_App::isEnabled('files_sharing')) {
+ if ($path == '/Shared') {
+ $info = OCP\Share::getItemsSharedWith('file', OC_Share_Backend_File::FORMAT_FILE_APP_ROOT);
+ }
+ else {
+ $info = OCP\Share::getItemSharedWith('file', '/'.$name, OC_Share_Backend_File::FORMAT_FILE_APP);
+ }
+ $info = $info[0];
+ }
+ else {
+ $info = OC_FileCache::get($path);
+ }
+ }
+
+ /**
* get the content of a directory
* @param dir $directory path under datadirectory
*/