Set of helpers and abstractions above file storage providers

v0.2.5 2022-09-13 10:27 UTC


PHP utils around Azure blob storage and Amazon S3


composer require keboola/php-file-storage-utils


Azure Blob storage

Retry middleware

$blobClient = BlobRestProxy::createBlobService(...);
        (optional) RetryMiddlewareFactory::DEFAULT_NUMBER_OF_RETRIES,
        (optional) RetryMiddlewareFactory::DEFAULT_RETRY_INTERVAL,
        (optional) RetryMiddlewareFactory::EXPONENTIAL_INTERVAL_ACCUMULATION

Best practice

use ClientFactory to preset client and middlewares

        string $connectionString,
        ?LoggerInterface $logger = null


Run tests with:

docker-compose run --rm testsXX

where XX is PHP version (71 - 74), e.g.:

docker-compose run --rm tests71

Resources Setup

Azure blob storage

export PHP_FS_UTILS_RG=testing-php-file-storage-utils

Create a resource group:

az group create --name $PHP_FS_UTILS_RG --location "northeurope"

Deploy the storage account

az group deployment create --resource-group $PHP_FS_UTILS_RG --template-file arm-template.json

command will output ABS_ACCOUNT_NAME, ABS_ACCOUNT_KEY which has to be added to .env file