From 4a3c67fdb4b89bbbb384f869a585a4238e213538 Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Wed, 8 Jun 2016 08:19:32 +0200 Subject: [PATCH] Bring back sharedstorage hooks --- apps/files_sharing/lib/sharedstorage.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/apps/files_sharing/lib/sharedstorage.php b/apps/files_sharing/lib/sharedstorage.php index 965c4d36ca..b5b5e41688 100644 --- a/apps/files_sharing/lib/sharedstorage.php +++ b/apps/files_sharing/lib/sharedstorage.php @@ -415,4 +415,22 @@ class Shared extends \OC\Files\Storage\Wrapper\Jail implements ISharedStorage { return $this->sourceStorage; } + public function file_get_contents($path) { + $info = [ + 'target' => $this->getMountPoint() . '/' . $path, + 'source' => $this->getSourcePath($path), + ]; + \OCP\Util::emitHook('\OC\Files\Storage\Shared', 'file_get_contents', $info); + return parent::file_get_contents($path); + } + + public function file_put_contents($path, $data) { + $info = [ + 'target' => $this->getMountPoint() . '/' . $path, + 'source' => $this->getSourcePath($path), + ]; + \OCP\Util::emitHook('\OC\Files\Storage\Shared', 'file_put_contents', $info); + return parent::file_put_contents($path, $data); + } + }