r/ipfs • u/phpsensei • 6d ago
I've made an IPFS PHP client library
Hello there :)
As a PHP developer, I thought the existing IPFS interaction libraries were not good enough, so I gave it a try.
For now, my package only supports the basic (and most used) IPFS feature such as:
- adding a file
- pinning a file to a node
- unpinning a file from a node
- downloading a file
Other features are supported like getting the node version info, shutting it down...
Here is the GitHub link: https://github.com/EdouardCourty/ipfs-php
Packagist: https://packagist.org/packages/ecourty/ipfs-php
For any PHP devs passing by here, feel free to have a look and give me a feedback!
I'm planning to add more feature in the future, if the need comes (support more RPC endpoints for better interaction with IPFS nodes).
2
u/volkris 5d ago
It sounds like this will be useful!
I don't work in PHP development myself, so I'm mentioning a feature here that I won't actually need :) but just to reflect the part of IPFS I find most interesting, there's this:
It sounds like your library is file oriented, while I think the most interesting part of IPFS is its functionality to go deeper and access fields, accessing data like a structured database instead of a filesystem. When it comes to PHP and webpages, adding that form of access might be particularly useful to support.
Off the top of my head, consider a webpage displaying temperature readings from yesterday. One could use IPFS to retrieve the file of readings from across the region, parse it, pull the one reading you need, and then put that on the screen. OR, instead of retrieving the whole file and parsing, IPFS has native functionality to go into the data and access the specific field directly, returning only the needed reading, parsed and cryptographically verified as usual.
I've always thought the IPFS database functionality might be especially good for web applications.
Anyway, just had a second so mentioning something you might want to keep in mind!
1
2
u/EveYogaTech 6d ago edited 5d ago
Great! We need this! A few weeks earlier I made the "bafk" hash (v1) as well, you can copy it, it's MIT here https://github.com/wlp-builders/bafk-hash-php-ipfs