コード例 #1
0
 public function __construct($storage, $mountpoint, $arguments = null, $loader = null)
 {
     // first update the mount point before creating the parent
     $newMountPoint = $this->verifyMountPoint($arguments['share'], $arguments['user']);
     $absMountPoint = '/' . $arguments['user'] . '/files' . $newMountPoint;
     parent::__construct($storage, $absMountPoint, $arguments, $loader);
 }
コード例 #2
0
 /**
  * @param string $storage
  * @param string $mountpoint
  * @param array|null $arguments
  * @param \OCP\Files\Storage\IStorageFactory $loader
  */
 public function __construct($storage, $mountpoint, $arguments = null, $loader = null)
 {
     $this->user = $arguments['user'];
     $this->recipientView = new View('/' . $this->user . '/files');
     $newMountPoint = $this->verifyMountPoint($arguments['share']);
     $absMountPoint = '/' . $this->user . '/files' . $newMountPoint;
     $arguments['ownerView'] = new View('/' . $arguments['share']['uid_owner'] . '/files');
     parent::__construct($storage, $absMountPoint, $arguments, $loader);
 }
コード例 #3
0
ファイル: sharedmount.php プロジェクト: ninjasilicon/core
 public function __construct($storage, $mountpoint, $arguments = null, $loader = null)
 {
     // first update the mount point before creating the parent
     $this->ownerPropagator = $arguments['propagator'];
     $this->recipientView = new View('/' . $arguments['user'] . '/files');
     $newMountPoint = $this->verifyMountPoint($arguments['share']);
     $absMountPoint = '/' . $arguments['user'] . '/files' . $newMountPoint;
     $arguments['ownerView'] = new View('/' . $arguments['share']['uid_owner'] . '/files');
     parent::__construct($storage, $absMountPoint, $arguments, $loader);
 }
コード例 #4
0
ファイル: sharedmount.php プロジェクト: stweil/owncloud-core
 /**
  * @param string $storage
  * @param SharedMount[] $mountpoints
  * @param array|null $arguments
  * @param \OCP\Files\Storage\IStorageFactory $loader
  */
 public function __construct($storage, array $mountpoints, $arguments = null, $loader = null)
 {
     $this->user = $arguments['user'];
     $this->recipientView = new View('/' . $this->user . '/files');
     $this->share = $arguments['newShare'];
     $newMountPoint = $this->verifyMountPoint($this->share, $mountpoints);
     $absMountPoint = '/' . $this->user . '/files' . $newMountPoint;
     $arguments['ownerView'] = new View('/' . $this->share->getShareOwner() . '/files');
     parent::__construct($storage, $absMountPoint, $arguments, $loader);
 }
コード例 #5
0
ファイル: scanner.php プロジェクト: Kevin-ZK/vaneDisk
 /**
  * attach listeners to the scanner
  *
  * @param \OC\Files\Mount\MountPoint $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);
 }
コード例 #6
0
ファイル: storagefactory.php プロジェクト: evanjt/core
 public function testWrapperPriority()
 {
     $instance = new \OC\Files\Storage\StorageFactory();
     $mount = new MountPoint('\\OC\\Files\\Storage\\Temporary', '/foo', [[]], $instance);
     $instance->addStorageWrapper('dummy1', function ($mountPoint, IStorage $storage) {
         return new DummyWrapper(['storage' => $storage, 'data' => 1]);
     }, 1);
     $instance->addStorageWrapper('dummy2', function ($mountPoint, IStorage $storage) {
         return new DummyWrapper(['storage' => $storage, 'data' => 100]);
     }, 100);
     $instance->addStorageWrapper('dummy3', function ($mountPoint, IStorage $storage) {
         return new DummyWrapper(['storage' => $storage, 'data' => 50]);
     }, 50);
     /** @var \Test\Files\Storage\DummyWrapper $wrapped */
     $wrapped = $mount->getStorage();
     $this->assertInstanceOf('\\Test\\Files\\Storage\\DummyWrapper', $wrapped);
     $this->assertEquals(1, $wrapped->data);
     // lowest priority is applied last, called first
     $this->assertEquals(50, $wrapped->getWrapperStorage()->data);
     $this->assertEquals(100, $wrapped->getWrapperStorage()->getWrapperStorage()->data);
 }
コード例 #7
0
ファイル: scanner.php プロジェクト: gvde/core
 /**
  * attach listeners to the scanner
  *
  * @param \OC\Files\Mount\MountPoint $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));
     });
     $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));
     });
 }
コード例 #8
0
ファイル: mount.php プロジェクト: heldernl/owncloud8-extended
 /**
  * @param string|\OC\Files\Storage\Storage $storage
  * @param string $mountpoint
  * @param array $options
  * @param \OCA\Files_Sharing\External\Manager $manager
  * @param \OC\Files\Storage\StorageFactory $loader
  */
 public function __construct($storage, $mountpoint, $options, $manager, $loader = null)
 {
     parent::__construct($storage, $mountpoint, $options, $loader);
     $this->manager = $manager;
 }
コード例 #9
0
ファイル: personalmount.php プロジェクト: rosarion/core
 /**
  * @param UserStoragesService $storagesService
  * @param int $storageId
  * @param string|\OC\Files\Storage\Storage $storage
  * @param string $mountpoint
  * @param array $arguments (optional) configuration for the storage backend
  * @param \OCP\Files\Storage\IStorageFactory $loader
  * @param array $mountOptions mount specific options
  */
 public function __construct(UserStoragesService $storagesService, $storageId, $storage, $mountpoint, $arguments = null, $loader = null, $mountOptions = null)
 {
     parent::__construct($storage, $mountpoint, $arguments, $loader, $mountOptions);
     $this->storagesService = $storagesService;
     $this->storageId = $storageId;
 }
コード例 #10
0
ファイル: manager.php プロジェクト: samj1912/repo
 /**
  * @param MountPoint $mount
  */
 public function addMount(MountPoint $mount)
 {
     $this->mounts[$mount->getMountPoint()] = $mount;
 }