Download the PHP package evias/nem-php without Composer
On this page you can find all versions of the php package evias/nem-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download evias/nem-php
More information about evias/nem-php
Files in evias/nem-php
Package nem-php
Short Description Composer Package for PHP (Laravel or Pure PHP), Wrapper to use the NEM blockchain REST API and SDK with NIS compatibility.
License MIT
Informations about the package nem-php
This package aims to provide with an easy-to-use PHP Laravel Namespace helping developers to communicate with the NEM blockchain through its NIS API.
This package should be an aid to any developer working on Laravel/Lumen/Symfony applications with the NEM blockchain.
This package is currently still in development, please do not use in production.
The author of this package cannot be held responsible for any loss of money or any malintentioned usage forms of this package. Please use this package with caution.
Package licensed under MIT License.
Documentation
Reader-friendly Documentation will be added in development period and will be available on the Github Wiki at evias/nem-php Wiki.
Currently phpdocumentor is integrated to the project in order to automatically generate API documentation from the source code. You must run the phpdoc
and phpdocmd
command if you wish to generate the Documentation, the first stable release will include a generated Documentation version.
Pot de vin
If you like the initiative, and for the sake of good mood, I recommend you take a few minutes to Donate a beer or Three [because belgians like that] by sending some XEM (or whatever Mosaic you think pays me a few beers someday!) to my Wallet:
NB72EM6TTSX72O47T3GQFL345AB5WYKIDODKPPYW
Username | Role |
---|---|
eVias | Project Lead |
RobertoSnap | Developer |
Installation
You can install this package with Composer. You only need to require evias/nem-php.
The package can also be downloaded manually by cloning this repository or by downloading the packagist archive:
- nem-php at Packagist
- nem-php at Github
- ZIP Archive of master branch at Github
- nem-php Releases at Github
Once you have required the package in your composer.json
file (or using the command above), you can install
the dependencies of this package:
Unit Tests
The library provides with a Unit Test Suite for the implemented SDK features.
The unit test suite is also configured on Travis-CI with the current Build Status:
If you wish to run the unitary test suite, you can use the executable file provided by PHPUnit which is located
under vendor/bin/phpunit
.
Alernatively, you can create a symbolic link to this executable file in the nem-php
clone root folder.
Now you can simply run phpunit
in the terminal and it will launch the Rocket.. meh, the Unit Tests Suite.
Laravel advanced features
Modify your config/app.php
configuration file to include the NEM\ServiceProvider service provider. Look out
for the providers configuration array and add our class as shown below:
If you wish to make use of the Laravel Facades provided by this library, you will also need to list the alias
in your config/app.php
configuration file under the aliases configuration array as described below:
Usage / Examples
When you have installed the evias/nem-php package you will be able to use the API class to send API requests to the configured NIS. By default, the config/nem.php file defines the localhost NIS to be used, this can be changed.
If you are using Laravel or Lumen, you will need to register the Service Provider of this package into your app:
Example 1: Using the Service Provider (Laravel only)
Example 2: Using the API wrapper
Example 3: Sending GET/POST request to the NIS API and getting back JSON
Example 4: Custom Headers and response callback configurations
Example 5: Use the SDK to create NEM NIS compliant Objects
Example 6: Use the SDK NIS Web Service implementations
Example 7: Use the SDK to read an account's transactions
Example 8: Derive a Public Key with a hexadecimal or binary Private Key
Example 9: Create New KeyPair and Address (randomly)
Example 10: Sign Data with a NEM KeyPair
Troubleshoot / Issues Resolution
Installing dependencies with MacOS MAMP or MAMP Pro
It may happen that your PHP server is not installed in the correct version or does not load the right extensions so here is a little snippet that will provide you with the exact PHP version needed (you also need to compile httpd).
First you will need to rebuilt the httpd service :
The above step is only because MAMP does not include the Apache build/ folder (which you can now find under ~/httpd-2.2.34/
). Ok, next step is to recompile PHP as an Apache Module as required by MAMP. Following snippet will let you download and compile the PHP package with MacOS and MAMP, enabling GMP, GD, MySQL, XML, CURL, GETTEXT, MBSTRING and BCMATH modules.
After building the PHP source code you will also need to link to that file in your system. Following is an easy workaround, but please, make sure to backup any file before you overwrite executables.
The compilation of PHP will have installed a file: ~/httpd-2.2.34/modules/libphp7.so
, you must link your system to that file in order to use the correct PHP modules. Use following snippet to link both, the PHP apache module and the PHP executable in your MAMP installation.
Changelog
Important versions listed below. Refer to the Changelog for a full history of the project.
- 1.0.0 - revamp of the SDK
- 0.0.3 - ongoing development
- 0.0.2 - 2017-02-18
- 0.0.1 - 2017-02-04
License
This software is released under the MIT License.
© 2017-2018 Grégory Saive [email protected], All rights reserved.
All versions of nem-php with dependencies
illuminate/contracts Version 5.0.33|5.1.*|5.2.*|5.3.*|5.4.*|5.5.*|5.6.*|5.7.*|^8.0
illuminate/support Version 5.0.33|5.1.*|5.2.*|5.3.*|5.4.*|5.5.*|5.6.*|5.7.*|^8.0
guzzlehttp/guzzle Version 5.3.1|6.*
mdanter/ecc Version *
paragonie/sodium_compat Version ~1.4.0
christian-riesen/base32 Version ~1.3.1
kornrunner/keccak Version dev-master