示例#1
0
 /**
  * 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));
     });
 }
示例#2
0
 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);
 }
示例#3
0
 /**
  * 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);
 }
示例#4
0
文件: manager.php 项目: Romua1d/core
 /**
  * @param Mount $mount
  */
 public function addMount(Mount $mount)
 {
     $this->mounts[$mount->getMountPoint()] = $mount;
 }
示例#5
0
 /**
  * @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;
 }