/** * attach listeners to the scanner * * @param \OC\Files\Mount\Mount $mount */ protected function attachListener($mount) { $scanner = $mount->getStorage()->getScanner(); $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, $emitter) { $emitter->emit('\\OC\\Files\\Utils\\Scanner', 'scanFolder', array($mount->getMountPoint() . $path)); }); }
public function __construct($storage, $mountpoint, $arguments = null, $loader = null) { // first update the mount point before creating the parent $newMountPoint = self::verifyMountPoint($arguments['share']); $absMountPoint = '/' . \OCP\User::getUser() . '/files' . $newMountPoint; parent::__construct($storage, $absMountPoint, $arguments, $loader); }
/** * attach listeners to the scanner * * @param \OC\Files\Mount\Mount $mount */ protected function attachListener($mount) { $scanner = $mount->getStorage()->getScanner(); $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, $emitter) { $emitter->emit('\\OC\\Files\\Utils\\Scanner', 'scanFolder', array($mount->getMountPoint() . $path)); }); // propagate etag and mtimes when files are changed or removed $propagator = $this->propagator; $propagatorListener = function ($path) use($mount, $propagator) { $fullPath = Filesystem::normalizePath($mount->getMountPoint() . $path); $propagator->addChange($fullPath); }; $scanner->listen('\\OC\\Files\\Cache\\Scanner', 'addToCache', $propagatorListener); $scanner->listen('\\OC\\Files\\Cache\\Scanner', 'removeFromCache', $propagatorListener); }
/** * @param Mount $mount */ public function addMount(Mount $mount) { $this->mounts[$mount->getMountPoint()] = $mount; }
/** * @param string|\OC\Files\Storage\Storage $storage * @param string $mountpoint * @param array $options * @param \OCA\Files_Sharing\External\Manager $manager * @param \OC\Files\Storage\Loader $loader */ public function __construct($storage, $mountpoint, $options, $manager, $loader = null) { parent::__construct($storage, $mountpoint, $options, $loader); $this->manager = $manager; }