https://github.com/phore/phore-objectstore
A datastore (bucket) storage with drivers for filesystem, google cloud, aws
https://github.com/phore/phore-objectstore
bucket cloud objectstore
Last synced: 5 months ago
JSON representation
A datastore (bucket) storage with drivers for filesystem, google cloud, aws
- Host: GitHub
- URL: https://github.com/phore/phore-objectstore
- Owner: phore
- License: mit
- Created: 2018-09-05T07:36:08.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2024-07-25T11:07:02.000Z (almost 2 years ago)
- Last Synced: 2025-10-21T17:48:02.274Z (8 months ago)
- Topics: bucket, cloud, objectstore
- Language: PHP
- Homepage: https://infracamp.org/phore/
- Size: 187 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ObjectStore - Wrapper for various cloud based buckets

## Install
```
composer requre phore/objectstore
```
## Basic usage
```php
$store = new ObjectStore(\Phore\ObjectStore\ObjectStoreDriverFactory::Build("gcs://?keyfile=/run/secrets/google-key-1"));
```
```php
$store = new ObjectStore(new GoogleCloudStoreDriver(__DIR__ . "/file/to/identity.json", "bucketName"));
$store->object("object/some.json")->put("Some Data");
if ($store->has("object/some.json"))
echo "Object existing";
echo $store->object("object/some.json")->get();
```
## Driver
The object store can be created with
```php
$objectStore = ObjectStore::Connect('gcs://some-bucket?keyfile=/run/secrets/xyz');
```
Available Drivers: [Configuration options](README_CONNECT_SETTINGS.md)
| driver | driver class | example |
|--------|-------------|---------|
| Google Bucket | `PhoreGoogleCloudStoreDriver` | `gcs://?keyfile=/run/secrets/google-key-1` |
| Google Bucket Native Driver (Requires `google/cloud-storage`) | `GoogleCloudStoreDriver` | `gcsnd://?keyfile=/run/secrets/google-key-1` |
| Azure Block Storage | `--` | `azbs://?account=&keyfile=/run/secrets/az-key-1` |
| Azure Block Storage Native Driver (Requires `microsoft/azure-storage-blob`) | `AzureObjectStoreDriver` | `azbsnd://?account=&keyfile=/run/secrets/az-key-1` |
| AWS S3 Block Storage Native Driver (Requires `aws/aws-sdk-php`) | `S3ObjectStoreDriver` | `s3nd://?account=&keyfile=/run/secrets/keyfile®ion=` |
| Filesystem driver | `FileSystemObjectStoreDriver` | `file://path/` |
See the [Configuration options page](README_CONNECT_SETTINGS.md) for full driver documentation
## Develop
The google native drivers require a secret as service account. Create the secret using
```
./kickstart.sh secrets edit google_test
```