Date: 12/29/2022 - Upvotes : 729 - Words : 575
NEW: HIVE PHP Lib, the "Enterprise-class" PHP library to create projects.
Ladies and gentlemen, please welcome the best PHP way to interact with our favorite blockchain!
When you code on PHP, it's most difficult to work with blockchains. For Hive, there are 3 libs for that:
- Hive-php, by @mahdiyari, with which you can interact only in "Raw mode" (and you need another external library),
- Php-hive-tools, made by @dragosroua, which is not up to date,
- Php-he-tools, by me, to only interact with HiveEngine layer.
All these libs are without good documentation, with no standardized code and have some defects. That's why I wish to develop a library which can be used with Hive and HiveEngine. This lib need to have a really readable code, many comments, some examples, and have the "Enterprise-class" standards.
Now, it's over, and only one library will be used for that: Hive-php-lib
How can I do that?
First of all, the code of Hive-php-lib is fully readable by a beginner. We need to attract more developers into HIVE blockchain and the lib is easy to understand. I use the well-known PSR-1 & PSR-12 coding standards for that. The code is written to be clear and easy to use.
If the code is not understandable, I made DocBlocks for every function. Just execute phpdoc in the lib folder to have a full featured developer documentation.
Hive-php-lib is also upgradeable in the easiest way:
composer update give you the last version of this awesome library.
All these things made Hive-php-lib ready to use in any big project in production mode. Of course, all is fully open-source (MIT Licence).
How can you use this lib?
If you to go futher without waiting for other tutorials, you'll find the entire list of methods for HIVE and HiveEngine in the methods.md file in
Some examples are in
/resources/examples/ folder too and the other ones will be added very soon.
For Hive-php-lib, it's just the beginning. I want to include some shortcuts functions to have data in an easier way. (e.g.
getPublicKeys("bambukah") to have an array with all my public keys.)
I also want to add all keys & transactions functions, but without any external library (like ext-gmp). Many users cannot install this type of lib on their PHP instances and I want to use this lib everywhere.
After that, I will write more tutorials that will be included into the official HIVE Developer Portal (Go check this site and the AppBase API in Condenser chapter to discover the very powerful Hive API).
To finish, I want to write some units tests to have the best quality library. Updates will take place soon for each new HardFork or for any fix.
Of course, if you have any feedback or question, feel free to ask in comments section! As usual, If you like my work, please up-vote and re-blog this post, it helps me a lot.
Thank you very much and have a nice day!