keven / flysystem-concatenate
Concatenation plugin for league/flysystem
Installs: 13 766
Dependents: 0
Suggesters: 0
Security: 0
Stars: 4
Watchers: 1
Forks: 1
Open Issues: 1
Requires
- keven/append-stream: ^1.0
- league/flysystem: ^1.0
Requires (Dev)
- league/flysystem-vfs: ^1.0
- phpunit/phpunit: ^7.0
This package is auto-updated.
Last update: 2024-12-23 08:26:58 UTC
README
Concatenate files and append content to existing files in league/flysystem.
This plugin is compatible with any adapter.
It relies on streams so manipulating big files does not fill the memory.
Install
composer require keven/flysystem-concatenate
Usage
Concatenate files into a new one:
<?php use Keven\Flysystem\Concatenate\Concatenate; $filesystem->addPlugin(new Concatenate); $filesystem->write('/file1', 'file1'); $filesystem->write('/file2', 'file2'); $filesystem->concatenate('/file3', '/file1', '/file2'); echo $this->filesystem->read('/file3'); // file1file2
Append content to an existing file:
<?php use Keven\Flysystem\Concatenate\Append; $filesystem->addPlugin(new Append); $this->filesystem->write('/file1', 'file1'); $this->filesystem->append('/file1', 'more'); echo $this->filesystem->read('/file1'); // file1more