diff --git a/README.md b/README.md index e6ecb886..fa6456a0 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ ![Total Downloads](https://img.shields.io/packagist/dt/utopia-php/storage.svg) [![Discord](https://img.shields.io/discord/564160730845151244?label=discord)](https://appwrite.io/discord) -Utopia Storage library is simple and lite library for managing application storage. It supports multiple storage adapters. We already support AWS S3 storage, Digitalocean Spaces storage and Backblaze B2 Cloud storage. This library is aiming to be as simple and easy to learn and use. This library is maintained by the [Appwrite team](https://appwrite.io). +Utopia Storage library is simple and lite library for managing application storage. It supports multiple storage adapters. We already support AWS S3 storage, Digitalocean Spaces storage, Backblaze B2 Cloud storage, Linode Object storage and Wasabi Cloud storage. This library is aiming to be as simple and easy to learn and use. This library is maintained by the [Appwrite team](https://appwrite.io). This library is part of the [Utopia Framework](https://github.com/utopia-php/framework) project. diff --git a/composer.lock b/composer.lock index d475ac57..e6e499b5 100644 --- a/composer.lock +++ b/composer.lock @@ -305,12 +305,12 @@ "source": { "type": "git", "url": "https://github.com/composer/semver.git", - "reference": "a951f614bd64dcd26137bc9b7b2637ddcfc57649" + "reference": "5d8e574bb0e69188786b8ef77d43341222a41a71" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/a951f614bd64dcd26137bc9b7b2637ddcfc57649", - "reference": "a951f614bd64dcd26137bc9b7b2637ddcfc57649", + "url": "https://api.github.com/repos/composer/semver/zipball/5d8e574bb0e69188786b8ef77d43341222a41a71", + "reference": "5d8e574bb0e69188786b8ef77d43341222a41a71", "shasum": "" }, "require": { @@ -363,7 +363,7 @@ "support": { "irc": "irc://irc.freenode.org/composer", "issues": "https://github.com/composer/semver/issues", - "source": "https://github.com/composer/semver/tree/3.2.9" + "source": "https://github.com/composer/semver/tree/3.3.1" }, "funding": [ { @@ -379,7 +379,7 @@ "type": "tidelift" } ], - "time": "2022-02-04T13:58:43+00:00" + "time": "2022-03-16T11:22:07+00:00" }, { "name": "composer/xdebug-handler", diff --git a/src/Storage/Device/Linode.php b/src/Storage/Device/Linode.php new file mode 100644 index 00000000..affd723b --- /dev/null +++ b/src/Storage/Device/Linode.php @@ -0,0 +1,50 @@ +headers['host'] = $bucket.'.'.$region.'.'.'linodeobjects.com'; + } + + /** + * @return string + */ + public function getName(): string + { + return 'Linode Object Storage'; + } + + /** + * @return string + */ + public function getDescription(): string + { + return 'Linode Object Storage'; + } +} diff --git a/src/Storage/Storage.php b/src/Storage/Storage.php index ccf824e1..cc27a41e 100644 --- a/src/Storage/Storage.php +++ b/src/Storage/Storage.php @@ -14,6 +14,7 @@ class Storage const DEVICE_S3 = 'S3'; const DEVICE_DO_SPACES = 'DOSpaces'; const DEVICE_BACKBLAZE = 'BackBlaze'; + const DEVICE_LINODE= 'Linode'; /** * Devices. @@ -119,4 +120,4 @@ public static function human(int $bytes, $decimals = 2, $system = 'metric') return sprintf("%.{$decimals}f%s", $bytes / pow($mod, $factor), $units[$system][$factor]); } -} \ No newline at end of file +} diff --git a/tests/Storage/Device/LinodeTest.php b/tests/Storage/Device/LinodeTest.php new file mode 100644 index 00000000..e5808fe5 --- /dev/null +++ b/tests/Storage/Device/LinodeTest.php @@ -0,0 +1,30 @@ +root = 'root'; + $key = $_SERVER['LINODE_ACCESS_KEY'] ?? ''; + $secret = $_SERVER['LINODE_SECRET'] ?? ''; + $bucket = 'everly-test'; + + $this->object = new Linode($this->root, $key, $secret, $bucket, Linode::EU_CENTRAL_1, Linode::ACL_PRIVATE); + + } + + protected function getAdapterName(): string + { + return 'Linode Object Storage'; + } + + protected function getAdapterDescription(): string + { + return 'Linode Object Storage'; + } +}