phonetworks / ipfs-php
IPFS library in PHP
Installs: 3
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 5
pkg:composer/phonetworks/ipfs-php
Requires
- php: >=7.1
- ext-curl: *
- guzzlehttp/guzzle: ^6.3.0
This package is auto-updated.
Last update: 2025-09-26 00:54:57 UTC
README
Install:
composer require nebulaprotocol/ipfs-php
Examples:
use IPFSPHP\IPFS; include 'vendor/autoload.php'; $ipfs = new IPFS('127.0.0.1', 8080, 5001);
API
add
Adds content to IPFS.
Usage
$hash = $ipfs->add($filePath);
cat
Retrieves the contents of a single hash.
Usage
$ipfs->cat($hash);
ls
Gets the node structure of a hash.
Usage
$obj = $ipfs->ls($hash); foreach ($obj as $e) { echo $e['Hash']; echo $e['Size']; echo $e['Name']; }
Object size
Returns object size.
Usage
$size = $ipfs->size($hash);
Pin
Pins a hash.
Usage
$ipfs->pinAdd($hash);
CREDITS
Initially forked from https://github.com/cloutier/php-ipfs-api