public function __construct($details) { parent::__construct($details); $this->file_path = 's3://' . $details['file_path']; $s3_config = PerchConfig::get('amazon_s3'); $this->Client = S3Client::factory(array('key' => $s3_config['access_key_id'], 'secret' => $s3_config['secret_access_key'])); $this->Client->registerStreamWrapper(); }
public function __construct($details) { parent::__construct($details); $this->file_path = 'dropbox://' . $details['file_path']; $dropbox_config = PerchConfig::get('dropbox'); if (in_array('dropbox', stream_get_wrappers())) { stream_wrapper_unregister('dropbox'); } stream_wrapper_register('dropbox', 'DropboxStream', STREAM_IS_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; } }