Пример #1
0
 /**
  * @param string | \OC\Files\Storage\Storage $storage
  * @param string $mountpoint
  * @param array $arguments (optional)\
  * @param \OC\Files\Storage\Loader $loader
  */
 public function __construct($storage, $mountpoint, $arguments = null, $loader = null)
 {
     if (is_null($arguments)) {
         $arguments = array();
     }
     if (is_null($loader)) {
         $this->loader = new Loader();
     } else {
         $this->loader = $loader;
     }
     $mountpoint = $this->formatPath($mountpoint);
     if ($storage instanceof Storage) {
         $this->class = get_class($storage);
         $this->storage = $this->loader->wrap($mountpoint, $storage);
     } else {
         // Update old classes to new namespace
         if (strpos($storage, 'OC_Filestorage_') !== false) {
             $storage = '\\OC\\Files\\Storage\\' . substr($storage, 15);
         }
         $this->class = $storage;
         $this->arguments = $arguments;
     }
     $this->mountPoint = $mountpoint;
 }