dbp/relay-blob-library
PHP helper library for interacting with dbp relay-blob-bundle. Provides BlobApi for HTTP mode with optional OIDC authentication to add, fetch, and remove files (blobs) in a bucket, using simple BlobFile objects and identifiers.
GitHub | Packagist | Changelog
PHP helper library for interaction with the relay-blob-bundle.
composer require dbp/relay-blob-library
Here is an example of how to use the library in HTTP mode, with OIDC authentication enabled:
// create the API
$blobApi = BlobApi::createHttpModeApi(
$bucketIdentifier, $bucketKey, $blobBaseUrl,
$oidcEnabled, $oidcProviderUrl, $oidcClientId, $oidcClientSecret);
$blobFile = new BlobFile();
$filePath = 'files/myFile.txt';
$blobFile->setFilename(basename($filePath));
$blobFile->setFile(new SplFileInfo($filePath));
$blobFile->setPrefix('my-prefix');
// add the file
$blobFile = $blobApi->addFile($blobFile);
// get the file
$blobFile = $blobApi->getFile($blobFile->getIdentifier());
// remove the file
$blobApi->removeFile($blobFile->getIdentifier());
Soon to come.
How can I help you explore Laravel packages today?