Skip to content

igorkosteski/flysystem-akamai-netstorage

Repository files navigation

Akamai NetStorage Adapter for Flysystem PHP (UNOFFICIAL)

I created this package because official akamai package is not longer maintained by akamai and there not way to update to Flysystem >= 2.

Requirement

  • PHP: ^8.1
  • Guzzle: ^7.5
  • Monolog: ^3.0
  • Flysystem: ^3.0

Installation

$ composer require "igorkgg/flysystem-akamai-netstorage" -vvv

Usage

use League\Flysystem\Filesystem;
use League\Flysystem\AkamaiNetStorage\AkamaiNetStorageAdapter;
use League\Flysystem\AkamaiNetStorage\AkamaiNetStorageClientFactory;

...

$clientConfig = [
    'signer' => [
        'key' => 'key',
        'name' => 'keyName',
    ],
    'edgegrid' => [
        'base_uri' => 'testing.akamaihd.net.example.org',
        'timeout' => 300,
    ],
];

$cpCode = '123456';
$pathPrefix = 'working-dir';
$baseUrl = 'company.akamaihd.net.example.org';

$client = (new AkamaiNetStorageClientFactory($clientConfig))->getClient();

$adapter = new AkamaiNetStorageAdapter(
    $client,
    $cpCode,
    $pathPrefix,
    $baseUrl
);

$filesystem = new Filesystem($adapter);

$file = 'example.txt';
$filesystem->write($file, 'test content');

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages