示例#1
0
 function __construct()
 {
     parent::__construct();
     // Make sure we have amazon keys.
     if (empty($this->_config['s3_access_key']) || empty($this->_config['s3_secret_key'])) {
         show_error('Storage: In order to load the Amazon S3 Driver you must have an access and secret key set.');
     }
     // Load libraries
     $this->_CI->load->library('s3');
     $this->_CI->s3->start($this->_config['s3_access_key'], $this->_config['s3_secret_key'], true);
     // S3 made no good way to change this properly so here ya go...
     S3::$host = preg_replace('@http(.*?)\\/\\/@', '', rtrim(Settings::get('files_s3_url'), '/'));
     S3::$geographic_location = Settings::get('files_s3_geographic_location') === 'EU' ? 'EU' : false;
 }