public function setUp() { Bootstrap::useStreamWrappers(); $this->url = $this->createNewUrl(); $this->context = $this->createStreamContext(); $this->resource = $this->createNewResource($this->url); }
public function __construct($details) { parent::__construct($details); $this->file_path = 'swift://' . $details['file_path']; if (!self::$init) { $config = PerchConfig::get('openstack_object_storage'); Bootstrap::useStreamWrappers(); Bootstrap::setConfiguration(['account' => isset($config['account']) ? $config['account'] : null, 'key' => isset($config['key']) ? $config['key'] : null, 'username' => isset($config['username']) ? $config['username'] : null, 'password' => isset($config['password']) ? $config['password'] : null, 'tenantname' => isset($config['tenantname']) ? $config['tenantname'] : null, 'tenantid' => isset($config['tenantid']) ? $config['tenantid'] : null, 'endpoint' => $config['endpoint'], 'openstack.swift.region' => $config['region']]); self::$init = true; } }
public function initRepository() { if (is_array($this->pluginConf)) { $this->driverConf = $this->pluginConf; } else { $this->driverConf = array(); } require_once $this->getBaseDir() . "/openstack-sdk-php/vendor/autoload.php"; Bootstrap::useStreamWrappers(); Bootstrap::setConfiguration(array('username' => $this->repository->getOption("USERNAME"), 'password' => $this->repository->getOption("PASSWORD"), 'tenantid' => $this->repository->getOption("TENANT_ID"), 'endpoint' => $this->repository->getOption("ENDPOINT"), 'openstack.swift.region' => $this->repository->getOption("REGION"), 'transport.ssl.verify' => false)); $path = $this->repository->getOption("PATH"); $recycle = $this->repository->getOption("RECYCLE_BIN"); ConfService::setConf("PROBE_REAL_SIZE", false); $this->detectStreamWrapper(true); $this->urlBase = "pydio://" . $this->repository->getId(); if ($recycle != "") { RecycleBinManager::init($this->urlBase, "/" . $recycle); } }
<?php require_once $this->getBaseDir() . "/openstack-sdk-php/vendor/autoload.php"; use OpenStack\Bootstrap; Bootstrap::useStreamWrappers(); Bootstrap::setConfiguration(array('username' => $this->repository->getOption("USERNAME"), 'password' => $this->repository->getOption("PASSWORD"), 'tenantid' => $this->repository->getOption("TENANT_ID"), 'endpoint' => $this->repository->getOption("ENDPOINT"), 'openstack.swift.region' => $this->repository->getOption("REGION"), 'transport.ssl.verify' => false));