示例#1
0
文件: client.php 项目: nseps/core
 /**
  * Sets the default options to the client
  */
 private function setDefaultOptions()
 {
     // Either use user bundle or the system bundle if nothing is specified
     if ($this->certificateManager->listCertificates() !== []) {
         $this->client->setDefaultOption('verify', $this->certificateManager->getAbsoluteBundlePath());
     } else {
         $this->client->setDefaultOption('verify', $this->certificateManager->getAbsoluteBundlePath(null));
     }
     $this->client->setDefaultOption('headers/User-Agent', 'ownCloud Server Crawler');
     if ($this->getProxyUri() !== '') {
         $this->client->setDefaultOption('proxy', $this->getProxyUri());
     }
 }
示例#2
0
文件: client.php 项目: kenwi/core
 /**
  * Sets the default options to the client
  */
 private function setDefaultOptions()
 {
     // Either use user bundle or the system bundle if nothing is specified
     if ($this->certificateManager->listCertificates() !== []) {
         $this->client->setDefaultOption('verify', $this->certificateManager->getAbsoluteBundlePath());
     } else {
         // If the instance is not yet setup we need to use the static path as
         // $this->certificateManager->getAbsoluteBundlePath() tries to instantiiate
         // a view
         if ($this->config->getSystemValue('installed', false)) {
             $this->client->setDefaultOption('verify', $this->certificateManager->getAbsoluteBundlePath(null));
         } else {
             $this->client->setDefaultOption('verify', \OC::$SERVERROOT . '/resources/config/ca-bundle.crt');
         }
     }
     $this->client->setDefaultOption('headers/User-Agent', 'ownCloud Server Crawler');
     if ($this->getProxyUri() !== '') {
         $this->client->setDefaultOption('proxy', $this->getProxyUri());
     }
 }