private function s3($S3_bucket = null) { if (isset($this->s3)) { if (isset($S3_bucket) && $this->s3->current_bucket() !== $S3_bucket) { $this->s3->set_current_bucket($S3_bucket); } return $this->s3; } if ($this->options) { $s3 = new S3_helper(isset($this->options['access_key']) ? $this->options['access_key'] : null, isset($this->options['secret_key']) ? $this->options['secret_key'] : null, isset($this->options['region']) ? $this->options['region'] : null); if ($s3 && isset($S3_bucket)) { $s3->set_current_bucket($S3_bucket); } $this->s3 = $s3; return $s3; } return false; }