diff --git a/apps/files_sharing/lib_share.php b/apps/files_sharing/lib_share.php index 049a74278b..42739bdfba 100644 --- a/apps/files_sharing/lib_share.php +++ b/apps/files_sharing/lib_share.php @@ -88,12 +88,15 @@ class OC_Share { $uid = $uid."@".$gid; } $query->execute(array($uid_owner, $uid, $source, $target, $permissions)); - // Clear the folder size cache for the 'Shared' folder -// $clearFolderSize = OC_DB::prepare("DELETE FROM *PREFIX*foldersize WHERE path = ?"); -// $clearFolderSize->execute(array($sharedFolder)); - // Emit post_create and post_write hooks to notify of a new file in the user's filesystem - OC_Hook::emit("OC_Filesystem", "post_create", array('path' => $target)); - OC_Hook::emit("OC_Filesystem", "post_write", array('path' => $target)); + // Add file to filesystem cache + $userDirectory = "/".OC_User::getUser()."/files"; + $data = OC_Filecache::get(substr($source, strlen($userDirectory))); + $parentQuery = OC_DB::prepare('SELECT id FROM *PREFIX*fscache WHERE path=?'); + $parentResult = $parentQuery->execute(array($sharedFolder))->fetchRow(); + $parent = $parentResult['id']; + $is_writeable = $permissions & OC_Share::WRITE; + $cacheQuery = OC_DB::prepare('INSERT INTO *PREFIX*fscache(parent, name, path, size, mtime, ctime, mimetype, mimepart, user, writable) VALUES(?,?,?,?,?,?,?,?,?,?)'); + $cacheQuery->execute(array($parent, basename($target), $target, $data['size'], $data['mtime'], $data['ctime'], $data['mimetype'], dirname($data['mimetype']), $uid, $is_writeable)); } } } diff --git a/lib/filestorage/google.php b/lib/filestorage/google.php new file mode 100644 index 0000000000..fc271f4e4b --- /dev/null +++ b/lib/filestorage/google.php @@ -0,0 +1,55 @@ +. +*/ + +class OC_Filestorage_Google extends OC_Filestorage_Common { + + private $auth; + + public function __construct($parameters) { + + } + + private function connect() { + + } + public function mkdir($path){} + public function rmdir($path){} + public function opendir($path){} + public function is_dir($path){} + public function is_file($path){} + public function stat($path){} + public function filetype($path){} + public function is_readable($path){} + public function is_writable($path){} + public function file_exists($path){} + public function unlink($path){} + public function rename($path1,$path2){} + public function fopen($path,$mode){} + public function toTmpFile($path){} + public function fromTmpFile($tmpPath,$path){} + public function fromUploadedFile($tmpPath,$path){} + public function getMimeType($path){} + public function hash($type,$path,$raw){} + public function free_space($path){} + public function search($query){} + public function getLocalFile($path){} +} \ No newline at end of file