From 59b78ae81cea54317d3a35976876d531d25286ce Mon Sep 17 00:00:00 2001 From: gabrieljenik Date: Fri, 24 Oct 2014 15:54:25 -0300 Subject: [PATCH] Update S3.php Added initialize method for initiliazing S3 from a config file. Usage: $this->load->library('s3'); $this->s3 = new s3(); $this->s3->initialize($config); Sample config file: (to be placed under config/s3.php) config->load('s3', TRUE); + $config = get_instance()->config->item('s3'); + } + + foreach ($config as $key => $val) { + if(!in_array($key, array('accessKey', 'secretKey'))) { + self::$$key = $val; + } + } + + if (isset($config["accessKey"]) && isset($config["secretKey"])) + self::setAuth($config["accessKey"], $config["secretKey"]); + } /** * Set the service endpoint