diff options
author | Morris Jobke <morris.jobke@gmail.com> | 2013-08-01 00:05:56 -0700 |
---|---|---|
committer | Morris Jobke <morris.jobke@gmail.com> | 2013-08-01 00:05:56 -0700 |
commit | 0d69feb12e7dd4d970ac6c02f3ff375afa0baa95 (patch) | |
tree | dcb13c04d16babaeba9afe4ead60d005d3c75423 /lib | |
parent | b037f2dc6e333482d0c0fba663769049bc275446 (diff) | |
parent | dea3472ad77a5ba1941a8d3a636f0cf17257734a (diff) | |
download | nextcloud-server-0d69feb12e7dd4d970ac6c02f3ff375afa0baa95.tar.gz nextcloud-server-0d69feb12e7dd4d970ac6c02f3ff375afa0baa95.zip |
Merge pull request #4208 from owncloud/scanner-php53
Fix scanner hooks throwing errors
Diffstat (limited to 'lib')
-rw-r--r-- | lib/files/utils/scanner.php | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/files/utils/scanner.php b/lib/files/utils/scanner.php index 800bb649934..f0dc41ffad3 100644 --- a/lib/files/utils/scanner.php +++ b/lib/files/utils/scanner.php @@ -8,8 +8,8 @@ namespace OC\Files\Utils; -use OC\Hooks\BasicEmitter; use OC\Files\Filesystem; +use OC\Hooks\PublicEmitter; /** * Class Scanner @@ -20,7 +20,7 @@ use OC\Files\Filesystem; * * @package OC\Files\Utils */ -class Scanner extends BasicEmitter { +class Scanner extends PublicEmitter { /** * @var string $user */ @@ -60,11 +60,12 @@ class Scanner extends BasicEmitter { */ protected function attachListener($mount) { $scanner = $mount->getStorage()->getScanner(); - $scanner->listen('\OC\Files\Cache\Scanner', 'scanFile', function ($path) use ($mount) { - $this->emit('\OC\Files\Utils\Scanner', 'scanFile', array($mount->getMountPoint() . $path)); + $emitter = $this; + $scanner->listen('\OC\Files\Cache\Scanner', 'scanFile', function ($path) use ($mount, $emitter) { + $emitter->emit('\OC\Files\Utils\Scanner', 'scanFile', array($mount->getMountPoint() . $path)); }); - $scanner->listen('\OC\Files\Cache\Scanner', 'scanFolder', function ($path) use ($mount) { - $this->emit('\OC\Files\Utils\Scanner', 'scanFolder', array($mount->getMountPoint() . $path)); + $scanner->listen('\OC\Files\Cache\Scanner', 'scanFolder', function ($path) use ($mount, $emitter) { + $emitter->emit('\OC\Files\Utils\Scanner', 'scanFolder', array($mount->getMountPoint() . $path)); }); } |