Posts

Introducing PHP HiveEngine Tools, your PHP companion to work with HiveEngine API

avatar of @bambukah
25
@bambukah
·
0 views
·
2 min read

As you know, my @superhive project is coded with PHP. I had a problem with the wallet page, I needed to interact with HiveEngine API, but no PHP library existed.

That's why I've started to develop a PHP lib for that : php-he-tools !

What is it?

PHP HiveEngine Tools is a collection of methods made to interact with HiveEngine API.

Of course, this lib is released under MIT license, and it's fully open-source. You can find it on the official Github repo.

Mainly inspired by @dragosroua work (for his php-hive-tools library), I want to create methods to use HiveEngine API easily, without compromise.

How to use it?

If you have a PHP project which need this, just install this lib with Composer :

composer require fkosmala/php-he-tools 

Next, just include the Composer's autoload in your PHP file and call the HiveEngine API :

require __DIR__ . '/vendor/autoload.php'; 
use FKosmala\PHPHeTools\HeApi as HeApi; 

You can create a configuration array if you want to change settings :

$config = [ 
"debug" => false, 
'throw_exception' => false, 
"heNode" => "api.hive-engine.com/rpc" 
]; 

Last step, initiate the lib :

$api = new HeApi($config); 

Mission successfully completed! You can use all the methods of this lib to your project! If you need a list, you can check the methods.md file.

If you need a small file to test, there is an example file in the example/ folder of the repo

Conclusion

This library is in development state and there are only few methods right now, so I will create methods over time. If you need to add something into this lib, you have three choices :

  • Ask me in comments
  • Fork the php-he-tools repo, add your feature or methods, and make a pull request
  • Add a ticket into the Issues page of the repo.

If you like my work, please upvote or reblog this post, consider to donate, Add a comment or join my Discord server to talk with me.

Have a nice day!