donovanbroquin/flysystem-alfresco

Flysystem driver using Alfresco API

1.0.0 2024-09-08 09:11 UTC

This package is auto-updated.

Last update: 2025-08-08 11:07:05 UTC


README

indicate if the package pass tests

A flysystem v3 adapter to use Alfresco sites functionality.

Install

This package is in development stage and not registered in Composer for now

Usage

Laravel

This package can be used as a Laravel flysystem disk.

# app/Providers/AppServiceProvider.php

use Donovanbroquin\FlysystemAlfresco\AlfrescoAdapter;
use Illuminate\Support\Facades\Storage;
use Illuminate\Contracts\Foundation\Application;
use Illuminate\Filesystem\FilesystemAdapter;
use League\Flysystem\Filesystem;

public function boot(): void
{
    Storage::extend('alfresco', function (Application $app, array $config) {
        $adapter = new AlfrescoAdapter($config);
 
        return new FilesystemAdapter(
            new Filesystem($adapter, $config),
                $adapter,
                $config
        );
    });
}
# config/filesystems.php

return [
    'disks' => [
        // ...

        'alfresco' => [
            'driver' => 'alfresco',
            'url' => 'https://alfresco.xyz',
            'site' => 'internal',
            'username' => 'username',
            'password' => 'password'
        ]
    ]
]
Storage::disk('alfresco')->put('test.txt', 'Hello world');

Development

Test

This package uses Pest as test runner.

You can launch it with the following command

vendor/bin/pest

Environment

A development environment is present with the dockerfile and dev container with the package’s needs.

Dockerfile directly

docker build -t flysystem-alfresco:latest .
docker run -d -v $(pwd):/var/package -it flysystem-alfresco:latest

Remember that any PHP command, including Composer, must be run from the container.

Dev Container

Open the package with your editor. It should ask you to re-open it with Dev Container.

Works at least with Visual Studio Code and PHPStorm.