定制 azure-oss/storage-blob 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

azure-oss/storage-blob

Composer 安装命令:

composer require azure-oss/storage-blob

包简介

Azure Blob Storage PHP SDK

README 文档

README

Latest Version on Packagist Packagist Downloads

Community-driven PHP SDKs for Azure, because Microsoft won't.

In November 2023, Microsoft officially archived their Azure SDK for PHP and stopped maintaining PHP integrations for most Azure services. No migration path, no replacement — just a repository marked read-only.

We picked up where they left off.

Screenshot

Our other packages:

Features

  • Authentication:
    • Connection strings (access keys)
    • Shared key credentials
    • Shared access signatures (SAS) for delegated, time-limited access
    • Microsoft Entra ID (token-based authentication) via azure-oss/azure-identity
  • Local development:
    • Supports the Azurite emulator
  • Containers:
    • Create, delete, and list (including filtering by prefix)
    • Configure public access when creating a container
    • Read properties and manage metadata
  • Blobs:
    • Upload from strings or streams, with transfer tuning for large uploads
    • Set common HTTP headers (content type, cache control, etc.)
    • Download via streaming and access response properties
    • Copy blobs (synchronous and asynchronous)
    • List blobs (flat, by prefix, and hierarchical listing) with page sizing
    • Delete blobs
    • Read properties and manage metadata
    • Blob index tags: set/get tags and query blobs by tags (account or container scope)
  • SAS:
    • Generate SAS for blobs, containers, and the account (when using credentials that can sign SAS)

Documentation

You can read the documentation here.

Install

composer require azure-oss/storage-blob

Quickstart

<?php

use AzureOss\Storage\Blob\BlobServiceClient;
use AzureOss\Storage\Blob\Models\UploadBlobOptions;

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

$container = $service->getContainerClient('quickstart');
$container->createIfNotExists();

$blob = $container->getBlobClient('hello.txt');

$blob->upload(
    'Hello from Azure-OSS',
    new UploadBlobOptions(contentType: 'text/plain')
);

$download = $blob->downloadStreaming();
$content = $download->content->getContents();

echo $content.PHP_EOL; // Hello from Azure-OSS

foreach ($container->getBlobs() as $item) {
    echo $item->name.PHP_EOL;
}

// Optional cleanup
$blob->deleteIfExists();
// $container->deleteIfExists();

License

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

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 2
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-06-25