diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2015-09-30 15:03:50 +0200 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2015-09-30 15:03:50 +0200 |
commit | acd6c9b605c4d66ab2176bbb1f7b1952c4e7981d (patch) | |
tree | 99b5fd925a5864436bc3c0ca350c129523ea4f91 | |
parent | 1514c0a9c3e992f490cdc5189998f94b59c47d51 (diff) | |
parent | cc64c09ee531e3fe2aebecaeae236e9140df0eb1 (diff) | |
download | nextcloud-server-acd6c9b605c4d66ab2176bbb1f7b1952c4e7981d.tar.gz nextcloud-server-acd6c9b605c4d66ab2176bbb1f7b1952c4e7981d.zip |
Merge pull request #19460 from owncloud/fix-postScanFile-and-make-it-available-to-utils-scanner
Fix postScanFile event and make it available to utils scanner
-rw-r--r-- | lib/private/files/cache/scanner.php | 4 | ||||
-rw-r--r-- | lib/private/files/utils/scanner.php | 7 |
2 files changed, 8 insertions, 3 deletions
diff --git a/lib/private/files/cache/scanner.php b/lib/private/files/cache/scanner.php index fb60ee5aa53..bfdab16b645 100644 --- a/lib/private/files/cache/scanner.php +++ b/lib/private/files/cache/scanner.php @@ -186,9 +186,9 @@ class Scanner extends BasicEmitter { } if (!empty($newData)) { $data['fileid'] = $this->addToCache($file, $newData, $fileId); - $this->emit('\OC\Files\Cache\Scanner', 'postScanFile', array($file, $this->storageId)); - \OC_Hook::emit('\OC\Files\Cache\Scanner', 'post_scan_file', array('path' => $file, 'storage' => $this->storageId)); } + $this->emit('\OC\Files\Cache\Scanner', 'postScanFile', array($file, $this->storageId)); + \OC_Hook::emit('\OC\Files\Cache\Scanner', 'post_scan_file', array('path' => $file, 'storage' => $this->storageId)); } else { $this->removeFromCache($file); } diff --git a/lib/private/files/utils/scanner.php b/lib/private/files/utils/scanner.php index c70f4beb31d..558a1fba028 100644 --- a/lib/private/files/utils/scanner.php +++ b/lib/private/files/utils/scanner.php @@ -99,7 +99,12 @@ class Scanner extends PublicEmitter { $scanner->listen('\OC\Files\Cache\Scanner', 'scanFolder', function ($path) use ($mount, $emitter) { $emitter->emit('\OC\Files\Utils\Scanner', 'scanFolder', array($mount->getMountPoint() . $path)); }); - + $scanner->listen('\OC\Files\Cache\Scanner', 'postScanFile', function ($path) use ($mount, $emitter) { + $emitter->emit('\OC\Files\Utils\Scanner', 'postScanFile', array($mount->getMountPoint() . $path)); + }); + $scanner->listen('\OC\Files\Cache\Scanner', 'postScanFolder', function ($path) use ($mount, $emitter) { + $emitter->emit('\OC\Files\Utils\Scanner', 'postScanFolder', array($mount->getMountPoint() . $path)); + }); // propagate etag and mtimes when files are changed or removed $propagator = $this->propagator; $propagatorListener = function ($path) use ($mount, $propagator) { |