diff --git a/php-ext-brotli b/php-ext-brotli new file mode 160000 index 00000000..58c0c92d --- /dev/null +++ b/php-ext-brotli @@ -0,0 +1 @@ +Subproject commit 58c0c92d416b3d7e39e442b6123bde2252a84d3d diff --git a/src/Storage/Device/Ceph.php b/src/Storage/Device/Ceph.php new file mode 100644 index 00000000..861f8883 --- /dev/null +++ b/src/Storage/Device/Ceph.php @@ -0,0 +1,32 @@ +headers['host'] = $cephHost; + } + + public function getName(): string + { + return 'Ceph Storage'; + } + + public function getDescription(): string + { + return 'Ceph Storage'; + } + + public function getType(): string + { + return Storage::DEVICE_CEPH; + } +} diff --git a/src/Storage/Storage.php b/src/Storage/Storage.php index cabd18c8..b4696eed 100644 --- a/src/Storage/Storage.php +++ b/src/Storage/Storage.php @@ -21,6 +21,8 @@ class Storage const DEVICE_LINODE = 'linode'; + const DEVICE_CEPH = 'ceph'; + /** * Devices. * @@ -36,7 +38,7 @@ class Storage * Add device by name * * @param string $name - * @param Device $device + * @param Device $device * @return void * * @throws Exception @@ -83,7 +85,7 @@ public static function exists($name) * * Based on: https://stackoverflow.com/a/38659168/2299554 * - * @param int $bytes + * @param int $bytes * @param int $decimals * @param string $system * @return string diff --git a/tests/Storage/Device/CephTest.php b/tests/Storage/Device/CephTest.php new file mode 100644 index 00000000..d167c68f --- /dev/null +++ b/tests/Storage/Device/CephTest.php @@ -0,0 +1,34 @@ +root = '/root'; + $key = $_SERVER['CEPH_ACCESS_KEY'] ?? ''; + $secret = $_SERVER['CEPH_SECRET'] ?? ''; + $bucket = 'utopia-storage-test'; + + $this->object = new Ceph($this->root, $key, $secret, $bucket, Ceph::US_EAST_1, Ceph::ACL_PRIVATE); + } + + protected function getAdapterName(): string + { + return 'Ceph Storage'; + } + + protected function getAdapterType(): string + { + return $this->object->getType(); + } + + protected function getAdapterDescription(): string + { + return 'Ceph Storage'; + } +}