use OC\Hooks\BasicEmitter;
use OC\Files\Filesystem;
+use OC\Hooks\PublicEmitter;
/**
* Class Scanner
*
* @package OC\Files\Utils
*/
-class Scanner extends BasicEmitter {
+class Scanner extends PublicEmitter {
/**
* @var string $user
*/
*/
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));
});
}