Loading inc/class-s3-uploads.php +14 −3 Original line number Diff line number Diff line Loading @@ -17,7 +17,13 @@ class S3_Uploads { public static function get_instance() { if ( ! self::$instance ) { self::$instance = new S3_Uploads( S3_UPLOADS_BUCKET, S3_UPLOADS_KEY, S3_UPLOADS_SECRET, defined( 'S3_UPLOADS_BUCKET_URL' ) ? S3_UPLOADS_BUCKET_URL : null, defined( 'S3_UPLOADS_REGION' ) ? S3_UPLOADS_REGION : null ); $key = defined( 'S3_UPLOADS_KEY' ) ? S3_UPLOADS_KEY : null; $secret = defined( 'S3_UPLOADS_SECRET' ) ? S3_UPLOADS_SECRET : null; $url = defined( 'S3_UPLOADS_BUCKET_URL' ) ? S3_UPLOADS_BUCKET_URL : null; $region = defined( 'S3_UPLOADS_REGION' ) ? S3_UPLOADS_REGION : null; self::$instance = new S3_Uploads( S3_UPLOADS_BUCKET, $key, $secret, $url, $region ); } return self::$instance; Loading Loading @@ -100,7 +106,12 @@ class S3_Uploads { if ( ! empty( $this->s3 ) ) return $this->s3; $params = array( 'key' => $this->key, 'secret' => $this->secret ); $params = array(); if ( $this->key && $this->secret ) { $params['key'] = $this->key; $params['secret'] = $this->secret; } if ( $this->region ) { $params['signature'] = 'v4'; Loading s3-uploads.php +5 −1 Original line number Diff line number Diff line Loading @@ -17,7 +17,11 @@ if ( defined( 'WP_CLI' ) && WP_CLI ) { add_action( 'plugins_loaded', 's3_uploads_init' ); function s3_uploads_init() { if ( ! defined( 'S3_UPLOADS_BUCKET' ) || ! defined( 'S3_UPLOADS_KEY' ) || ! defined( 'S3_UPLOADS_SECRET' ) ) { if ( ! defined( 'S3_UPLOADS_BUCKET' ) ) { return; } if ( ( ! defined( 'S3_UPLOADS_KEY' ) || ! defined( 'S3_UPLOADS_SECRET' ) ) || ! defined( 'S3_UPLOADS_USE_INSTANCE_PROFILE' ) ) { return; } Loading Loading
inc/class-s3-uploads.php +14 −3 Original line number Diff line number Diff line Loading @@ -17,7 +17,13 @@ class S3_Uploads { public static function get_instance() { if ( ! self::$instance ) { self::$instance = new S3_Uploads( S3_UPLOADS_BUCKET, S3_UPLOADS_KEY, S3_UPLOADS_SECRET, defined( 'S3_UPLOADS_BUCKET_URL' ) ? S3_UPLOADS_BUCKET_URL : null, defined( 'S3_UPLOADS_REGION' ) ? S3_UPLOADS_REGION : null ); $key = defined( 'S3_UPLOADS_KEY' ) ? S3_UPLOADS_KEY : null; $secret = defined( 'S3_UPLOADS_SECRET' ) ? S3_UPLOADS_SECRET : null; $url = defined( 'S3_UPLOADS_BUCKET_URL' ) ? S3_UPLOADS_BUCKET_URL : null; $region = defined( 'S3_UPLOADS_REGION' ) ? S3_UPLOADS_REGION : null; self::$instance = new S3_Uploads( S3_UPLOADS_BUCKET, $key, $secret, $url, $region ); } return self::$instance; Loading Loading @@ -100,7 +106,12 @@ class S3_Uploads { if ( ! empty( $this->s3 ) ) return $this->s3; $params = array( 'key' => $this->key, 'secret' => $this->secret ); $params = array(); if ( $this->key && $this->secret ) { $params['key'] = $this->key; $params['secret'] = $this->secret; } if ( $this->region ) { $params['signature'] = 'v4'; Loading
s3-uploads.php +5 −1 Original line number Diff line number Diff line Loading @@ -17,7 +17,11 @@ if ( defined( 'WP_CLI' ) && WP_CLI ) { add_action( 'plugins_loaded', 's3_uploads_init' ); function s3_uploads_init() { if ( ! defined( 'S3_UPLOADS_BUCKET' ) || ! defined( 'S3_UPLOADS_KEY' ) || ! defined( 'S3_UPLOADS_SECRET' ) ) { if ( ! defined( 'S3_UPLOADS_BUCKET' ) ) { return; } if ( ( ! defined( 'S3_UPLOADS_KEY' ) || ! defined( 'S3_UPLOADS_SECRET' ) ) || ! defined( 'S3_UPLOADS_USE_INSTANCE_PROFILE' ) ) { return; } Loading