This package contains a Flysystem v2 adapter for IPFS. Under the hood, the IPFS API PHP wrapper is used.
You can install the package via composer:
composer require openwse/flysystem-ipfs
use League\Flysystem\Filesystem;
use Ipfs\Ipfs;
use Ipfs\Drivers\HttpClient;
use FlysystemIpfs\IpfsAdapter;
$client = new Ipfs(
new HttpClient('https://ipfs-host', 5001)
);
$adapter = new IpfsAdapter($client);
$filesystem = new Filesystem($adapter);
Note: that removing a file on IPFS will only affect your node if the file has been pinned.
Run PHPMD, PHPStan, and PHP-CS-Fixer
composer lint
It uses tests cases provided by Flysystem but override visibility & last modified settings because it's not supported by IPFS.
composer tests
The MIT License (MIT). Please see License File for more information.