diff --git a/src/Storage/Device/Yandex.php b/src/Storage/Device/Yandex.php new file mode 100644 index 00000000..7dc00f07 --- /dev/null +++ b/src/Storage/Device/Yandex.php @@ -0,0 +1,56 @@ +headers['host'] = $bucket.'.storage.yandexcloud.net'; + } + + /** + * @return string + */ + public function getName(): string + { + return 'Yandex Storage'; + } + + /** + * @return string + */ + public function getDescription(): string + { + return 'Yandex Storage'; + } + + /** + * @return string + */ + public function getType(): string + { + return Storage::DEVICE_YANDEX; + } +} diff --git a/src/Storage/Storage.php b/src/Storage/Storage.php index cabd18c8..2765d515 100644 --- a/src/Storage/Storage.php +++ b/src/Storage/Storage.php @@ -17,6 +17,8 @@ class Storage const DEVICE_WASABI = 'wasabi'; + const DEVICE_YANDEX = 'yandex'; + const DEVICE_BACKBLAZE = 'backblaze'; const DEVICE_LINODE = 'linode'; diff --git a/tests/Storage/Device/YandexTest.php b/tests/Storage/Device/YandexTest.php new file mode 100644 index 00000000..89f29ec1 --- /dev/null +++ b/tests/Storage/Device/YandexTest.php @@ -0,0 +1,35 @@ +root = '/root'; + $key = $_SERVER['YANDEX_ACCESS_KEY'] ?? ''; + $secret = $_SERVER['YANDEX_SECRET'] ?? ''; + $bucket = 'utopia-storage-tests'; + $region = 'ru-central1-a'; + + $this->object = new Yandex($this->root, $key, $secret, $bucket, $region, Yandex::ACL_PRIVATE); + } + + protected function getAdapterName(): string + { + return 'Yandex Storage'; + } + + protected function getAdapterType(): string + { + return $this->object->getType(); + } + + protected function getAdapterDescription(): string + { + return 'Yandex Storage'; + } +}