donovanbroquin / flysystem-alfresco
Flysystem driver using Alfresco API
1.0.0
2024-09-08 09:11 UTC
Requires
- php: ^8.2
- guzzlehttp/guzzle: ^7.0
- league/flysystem: ^3.7.0
- nesbot/carbon: ^3.7
- psr/http-message: ^2.0
Requires (Dev)
- laravel/pint: ^1.17
- mockery/mockery: ^1.6
- pestphp/pest: ^2.35
- rector/rector: *
- symfony/var-dumper: ^7.1
README
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.