PHP library for VIZ
Today I've uploaded to GitHub the first version of viz-php-lib, which marks the possibility of "incorporating" a large layer of PHP programmers into the VIZ ecosystem. Offen we can hear disparaging attitudes towards this programming language, but wait a second. Weren't many projects like Facebook, VKontakt or Wikipedia (Avito come to mind) made on PHP? It's only in the modern era of cloud solutions that the microservices model began to evolve and some of the infrastructure moved to other solutions.
PHP has carved out a niche for itself. It's the basis of a sea of the most popular engines and services. From Wordpress to 1C-Bitrix (no matter how I feel about it, even with prejudice). I think it's important to give tools for integration with VIZ to all PHP programmers.
And if previously it was necessary to build an extension in php to work with bitcoin crypto, now there is a native solution, which uses a wrapper that supports one of two popular big number libraries. There are many hosting providers. And there are definitely a lot of them supporting, for example, the popular cPanel control panel, which allows you to enable both the php module gmp or bcmath.
The library contains 3 main classes and 1 auxiliary class. All dependencies are already loaded and implemented without the need to download them separately.
- JsonRPC class - using a standard socket for JsonRPC requests to a node (all API methods support, domain cache, ssl check switch, switch to get the full response in json format);
- Keys class - private keys (for signing), public keys (for signature verify), finding the shared key, support encoding keys (in wif format and in public key format with VIZ prefix);
- Transaction class - easy to use, multi-signature support, support for multi-operations in one transaction, execution via JsonRPC, support for 5 most used operations: transfer, transfer_to_vesting, withdraw_vesting, award, create_invite (other operations will be implemented later);
- Classes support PSR-4 standard, you only need to plug in autoloader.php and you can create instances of the required class immediately;
- Contains modified third-party crypto classes for better integration with VIZ blockchain (all-in-one approach);
- Native code with no additional installations (yes, no composer, as modifications to third-party solutions were required).
And, of course, MIT license of both the library and all connected dependencies.
This is a big step for our ecosystem. You'll find usage examples on the viz-php-lib GitHub page. More support for operations and AES-256 CBC encryption over a shared key is likely in the future (already implemented, please look at README and code examples). For now we should test the library with regular web-hosting providers and think about integration of simple sign-on, applied at control.viz.world as well.
May VIZ be with you.