keboola / php-file-storage-utils
Set of helpers and abstractions above file storage providers
Installs: 32 000
Dependents: 7
Suggesters: 0
Security: 0
Stars: 0
Watchers: 15
Forks: 0
Open Issues: 2
Requires
- php: >=7.1
- ext-fileinfo: *
- guzzlehttp/guzzle: ^6.5|^7.2
- guzzlehttp/psr7: ^1.7.0|^2.0
- microsoft/azure-storage-blob: ^1.5
- psr/log: ^1|^2|^3
- symfony/process: ^4.4|^5|^6
Requires (Dev)
- keboola/coding-standard: >=9.0
- php-parallel-lint/php-parallel-lint: ^1.2
- phpstan/extension-installer: ^1.0
- phpstan/phpstan: ^0.12.54|^1.0
- phpstan/phpstan-phpunit: ^0.12.16|^1.0
- phpunit/phpunit: ^7|^9.0
- dev-master
- v0.2.6
- v0.2.5
- v0.2.4
- v0.2.3
- v0.2.2
- v0.2.1
- v0.2.0
- v0.1.0
- dev-big-123-hide-other-ws-for-wip
- dev-big-123-hide-other-ws-for-ws
- dev-ujovlado-license-and-readme
- dev-odin-PST-598
- dev-GcsAbsolutePath
- dev-add-gcs-provider
- dev-KBC-1934-abs-timeout
- dev-zajca-kbc-1005-2
- dev-zajca-php-update73
- dev-zajca-kbc-1090
This package is auto-updated.
Last update: 2024-03-27 18:14:19 UTC
README
PHP utils around Azure blob storage and Amazon S3
Installation
composer require keboola/php-file-storage-utils
Usage
Azure Blob storage
Retry middleware
$blobClient = BlobRestProxy::createBlobService(...); $blobClient->pushMiddleware(Keboola\FileStorage\Abs\RetryMiddlewareFactory::create( (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
\Keboola\FileStorage\Abs\ClientFactory::createClientFromConnectionString( string $connectionString, ?LoggerInterface $logger = null );
Development
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