create_bucket() public method

Create an S3 bucket
public create_bucket ( string $bucket_name, null | string $region = null ) : boolean | WP_Error
$bucket_name string
$region null | string option location constraint
return boolean | WP_Error
 /**
  *
  */
 public function rooftop_add_s3_bucket(&$error = null)
 {
     $bucket = 'rooftop.site.' . get_current_blog_id();
     $bucket = apply_filters('as3cf_setting_bucket', $bucket);
     $amazon_webservices_path = ABSPATH . '../app/mu-plugins/amazon-web-services/amazon-web-services.php';
     $wp_s3_cloudfront_path = ABSPATH . '../app/mu-plugins/amazon-s3-and-cloudfront/wordpress-s3.php';
     $webservice = new Amazon_Web_Services($amazon_webservices_path);
     $aws = new Amazon_S3_And_CloudFront($wp_s3_cloudfront_path, $webservice);
     try {
         $aws->create_bucket($bucket, 'eu-west-1');
         return true;
     } catch (Exception $e) {
         error_log('Error creating bucket S3: ' . $e->getMessage());
         $error = $e;
         return;
     }
 }