PHP code example of azure-oss / storage-blob-flysystem

1. Go to this page and download the library: Download azure-oss/storage-blob-flysystem library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

azure-oss / storage-blob-flysystem example snippets


use AzureOss\FlysystemAzureBlobStorage\AzureBlobStorageAdapter;
use AzureOss\Storage\Blob\BlobServiceClient;
use League\Flysystem\Filesystem;

$blobServiceClient = BlobServiceClient::fromConnectionString('<connection-string>');
$containerClient = $blobServiceClient->getContainerClient('quickstart');

$adapter = new AzureBlobStorageAdapter($containerClient, "optional/prefix");
$filesystem = new Filesystem($adapter);

$filesystem->write('hello', 'world!');