-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Created IBM cloud object to connect with IBM
- Loading branch information
Showing
1 changed file
with
60 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
<?php | ||
|
||
namespace Utopia\Storage\Device; | ||
|
||
use Utopia\Storage\Storage; | ||
|
||
class IBMCloudObject extends S3 | ||
{ | ||
/** | ||
* Regions constants | ||
*/ | ||
const EU_CENTRAL_1 = 'eu-central-1'; | ||
|
||
const US_SOUTHEAST_1 = 'us-southeast-1'; | ||
|
||
const US_EAST_1 = 'us-east-1'; | ||
|
||
const AP_SOUTH_1 = 'ap-south-1'; | ||
|
||
/** | ||
* Object Storage Constructor | ||
* | ||
* @param string $root | ||
* @param string $accessKey | ||
* @param string $secretKey | ||
* @param string $bucket | ||
* @param string $region | ||
* @param string $acl | ||
*/ | ||
public function __construct(string $root, string $accessKey, string $secretKey, string $bucket, string $region = self::EU_CENTRAL_1, string $acl = self::ACL_PRIVATE) | ||
{ | ||
parent::__construct($root, $accessKey, $secretKey, $bucket, $region, $acl); | ||
$this->headers['host'] = $bucket.'.'.$region.'.'.'cloud.ibm.com'; | ||
} | ||
|
||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getName(): string | ||
{ | ||
return 'IBM Cloud Object Storage'; | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getDescription(): string | ||
{ | ||
return 'IBM Cloud Object'; | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getType(): string | ||
{ | ||
return Storage::DEVICE_IBM_CLOUD_OBJECT; | ||
} | ||
} |