fix scanner hooks, cant use inside closures in php 5.3
This commit is contained in:
parent
98e76b8978
commit
59bdba9bac
|
@ -10,6 +10,7 @@ namespace OC\Files\Utils;
|
||||||
|
|
||||||
use OC\Hooks\BasicEmitter;
|
use OC\Hooks\BasicEmitter;
|
||||||
use OC\Files\Filesystem;
|
use OC\Files\Filesystem;
|
||||||
|
use OC\Hooks\PublicEmitter;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class Scanner
|
* Class Scanner
|
||||||
|
@ -20,7 +21,7 @@ use OC\Files\Filesystem;
|
||||||
*
|
*
|
||||||
* @package OC\Files\Utils
|
* @package OC\Files\Utils
|
||||||
*/
|
*/
|
||||||
class Scanner extends BasicEmitter {
|
class Scanner extends PublicEmitter {
|
||||||
/**
|
/**
|
||||||
* @var string $user
|
* @var string $user
|
||||||
*/
|
*/
|
||||||
|
@ -60,11 +61,12 @@ class Scanner extends BasicEmitter {
|
||||||
*/
|
*/
|
||||||
protected function attachListener($mount) {
|
protected function attachListener($mount) {
|
||||||
$scanner = $mount->getStorage()->getScanner();
|
$scanner = $mount->getStorage()->getScanner();
|
||||||
$scanner->listen('\OC\Files\Cache\Scanner', 'scanFile', function ($path) use ($mount) {
|
$emitter = $this;
|
||||||
$this->emit('\OC\Files\Utils\Scanner', 'scanFile', array($mount->getMountPoint() . $path));
|
$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) {
|
$scanner->listen('\OC\Files\Cache\Scanner', 'scanFolder', function ($path) use ($mount, &$emitter) {
|
||||||
$this->emit('\OC\Files\Utils\Scanner', 'scanFolder', array($mount->getMountPoint() . $path));
|
$emitter->emit('\OC\Files\Utils\Scanner', 'scanFolder', array($mount->getMountPoint() . $path));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue