composer requre phore/objectstore
$store = new ObjectStore(\Phore\ObjectStore\ObjectStoreDriverFactory::Build("gcs://<bucket-name>?keyfile=/run/secrets/google-key-1"));
$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();
The object store can be created with
$objectStore = ObjectStore::Connect('gcs://some-bucket?keyfile=/run/secrets/xyz');
Available Drivers: Configuration options
driver | driver class | example |
---|---|---|
Google Bucket | PhoreGoogleCloudStoreDriver |
gcs://<bucket-name>?keyfile=/run/secrets/google-key-1 |
Google Bucket Native Driver (Requires google/cloud-storage ) |
GoogleCloudStoreDriver |
gcsnd://<bucket-name>?keyfile=/run/secrets/google-key-1 |
Azure Block Storage | -- |
azbs://<bucket-name>?account=<account>&keyfile=/run/secrets/az-key-1 |
Azure Block Storage Native Driver (Requires microsoft/azure-storage-blob ) |
AzureObjectStoreDriver |
azbsnd://<bucket-name>?account=<account>&keyfile=/run/secrets/az-key-1 |
AWS S3 Block Storage Native Driver (Requires aws/aws-sdk-php ) |
S3ObjectStoreDriver |
s3nd://<bucket-name>?account=<accountId>&keyfile=/run/secrets/keyfile®ion=<region> |
Filesystem driver | FileSystemObjectStoreDriver |
file://path/ |
See the Configuration options page for full driver documentation
The google native drivers require a secret as service account. Create the secret using
./kickstart.sh secrets edit google_test