/**
  * Register the package drivers.
  *
  * @return void
  */
 protected function registerDrivers()
 {
     $this->factory->extend('ftp', function ($app, $config) {
         return new Filesystem(new FtpAdapter($config));
     })->extend('sftp', function ($app, $config) {
         return new Filesystem(new SftpAdapter($config));
     })->extend('zip', function ($app, $config) {
         return new Filesystem(new ZipAdapter($config['path']));
     });
 }
Esempio n. 2
0
 public function registerGridfsFilesystem(FilesystemManager $filesystem)
 {
     $filesystem->extend('gridfs', function ($app, $config) {
         $fs_host = $config['host'];
         $fs_port = $config['port'];
         $fs_database = $config['database'];
         $mongo = new MongoClient('mongodb://' . $fs_host . ':' . $fs_port);
         $db = $mongo->selectDB($fs_database);
         $gridfs = $db->getGridFS();
         return new Filesystem(new GridFSAdapter($gridfs));
     });
 }