GitHub - php-oss-for-azure/azure-storage-file-share-php: [READ ONLY] Subtree split of the AzureOss\Storage\File\Share component · GitHub
Skip to content

About

[READ ONLY] Subtree split of the AzureOss\Storage\File\Share component

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Azure Storage File Share PHP SDK

Latest Version on Packagist Packagist Downloads

PHP OSS for Azure logo

A PHP SDK for Azure Files service operations and SAS generation.

Important

This package is community-maintained and is not affiliated with, endorsed by, or supported by Microsoft.

Install

composer require azure-oss/storage-file-share

Documentation

Read the File Share docs at php-oss-for-azure.github.io/storage-file-share/core.

Migration Guide

Migrating from microsoft/azure-storage-file? Migrate from microsoft/azure-storage-file.

Quickstart

<?php

use AzureOss\Storage\File\Share\Sas\ShareFileSasPermissions;
use AzureOss\Storage\File\Share\Sas\ShareSasBuilder;
use AzureOss\Storage\File\Share\ShareServiceClient;

$service = ShareServiceClient::fromConnectionString(
    getenv('AZURE_STORAGE_CONNECTION_STRING')
);

$file = $service
    ->getShareClient('documents')
    ->getDirectoryClient('reports')
    ->getFileClient('summary.txt');

$sasUri = $file->generateSasUri(
    ShareSasBuilder::new()
        ->setPermissions(new ShareFileSasPermissions(read: true))
        ->setExpiresOn(new DateTimeImmutable('+15 minutes')),
);

echo $sasUri.PHP_EOL;

Related packages

Maintenance

This package is part of the community-maintained PHP OSS for Azure project. It is an independent project and is not affiliated with or endorsed by Microsoft.

License

This project is released under the MIT License. See LICENSE for details.

About

[READ ONLY] Subtree split of the AzureOss\Storage\File\Share component

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages