public function detectStreamWrapper($register = false)
 {
     if ($register) {
         require_once $this->getBaseDir() . "/SFTPPSL_StreamWrapper.php";
     }
     return parent::detectStreamWrapper($register);
 }
Пример #2
0
 /**
  * @param bool $register
  * @return array|bool|void
  * Override parent to register underlying wrapper (s3) as well
  */
 public function detectStreamWrapper($register = false)
 {
     if (isset($this->repository)) {
         require_once "aws.phar";
         $options = array('key' => $this->repository->getOption("API_KEY"), 'secret' => $this->repository->getOption("SECRET_KEY"));
         $baseURL = $this->repository->getOption("STORAGE_URL");
         if (!empty($baseURL)) {
             $options["base_url"] = $baseURL;
         } else {
             $options["region"] = $this->repository->getOption("REGION");
         }
         $this->s3Client = S3Client::factory($options);
         $this->s3Client->registerStreamWrapper();
     }
     return parent::detectStreamWrapper($register);
 }
Пример #3
0
 /**
  * @param bool $register
  * @return array|bool|void
  * Override parent to register underlying wrapper (s3) as well
  */
 public function detectStreamWrapper($register = false)
 {
     if (isset($this->repository)) {
         require_once "aws.phar";
         $options = array('key' => $this->repository->getOption("API_KEY"), 'secret' => $this->repository->getOption("SECRET_KEY"));
         $signatureVersion = $this->repository->getOption("SIGNATURE_VERSION");
         if (!empty($signatureVersion) && $signatureVersion != "-1") {
             $options['signature'] = $signatureVersion;
         }
         $baseURL = $this->repository->getOption("STORAGE_URL");
         if (!empty($baseURL)) {
             $options["base_url"] = $baseURL;
         } else {
             $options["region"] = $this->repository->getOption("REGION");
         }
         $proxy = $this->repository->getOption("PROXY");
         if (!empty($proxy)) {
             $options['request.options'] = array('proxy' => $proxy);
         }
         $this->s3Client = S3Client::factory($options);
         $this->s3Client->registerStreamWrapper();
     }
     return parent::detectStreamWrapper($register);
 }
Пример #4
0
 /**
  * @param bool $register
  * @return array|bool|void
  * Override parent to register underlying wrapper (s3) as well
  */
 public function detectStreamWrapper($register = false)
 {
     /*
     if(isSet($this->repository)){
         require_once("aws.phar");
         $options = array(
             'key'    => $this->repository->getOption("API_KEY"),
             'secret' => $this->repository->getOption("SECRET_KEY"),
         );
         $signatureVersion = $this->repository->getOption("SIGNATURE_VERSION");
         if(!empty($signatureVersion) && $signatureVersion != "-1"){
             $options['signature'] = $signatureVersion;
         }
         $baseURL = $this->repository->getOption("STORAGE_URL");
         if(!empty($baseURL)){
             $options["base_url"] = $baseURL;
         }
         $region = $this->repository->getOption("REGION");
         if(!empty($region)){
             $options["region"] = $region;
         }
         $proxy = $this->repository->getOption("PROXY");
         if(!empty($proxy)){
             $options['request.options'] = array('proxy' => $proxy);
         }
         $apiVersion = $this->repository->getOption("API_VERSION");
         if ($apiVersion === "") {
             $apiVersion = "latest";
         }
         $sdkVersion = $this->getFilteredOption("SDK_VERSION");
         if ($sdkVersion === "v3") {
             require_once ("class.pydioS3Client.php");
             $this->s3Client = new AccessS3\S3Client([
                 "version" => $apiVersion,
                 "region"  => $region,
                 "credentials" => $options
             ]);
         } else {
             $this->s3Client = Aws\S3\S3Client::factory($options);
             if($this->repository->getOption("VHOST_NOT_SUPPORTED")){
                 // Use virtual hosted buckets when possible
                 require_once("ForcePathStyleListener.php");
                 $this->s3Client->addSubscriber(new \Aws\S3\ForcePathStyleStyleListener());
             }
         }
     
     
         $this->s3Client->registerStreamWrapper();
     }
     */
     return parent::detectStreamWrapper($register);
 }