Skip to content
This repository was archived by the owner on Jan 15, 2025. It is now read-only.

Commit 014afa3

Browse files
authored
Update README.md
1 parent 00f49ab commit 014afa3

File tree

1 file changed

+54
-31
lines changed

1 file changed

+54
-31
lines changed

README.md

Lines changed: 54 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,36 @@
1+
# perl-sdk / WebService::Hexonet::Connector
2+
3+
This module is a connector library for the insanely fast HEXONET Backend API. For further informations visit our [homepage](http://hexonet.net) and do not hesitate to [contact us](https://www.hexonet.net/contact).
4+
15
## Resources
26

3-
* [Usage Guide](https://github.com/hexonet/php-sdk/blob/master/README.md#how-to-use-this-module-in-your-project)
4-
* [SDK Documenation](https://rawgit.com/hexonet/php-sdk/master/build/api/index.html)
7+
* [Usage Guide](https://github.com/hexonet/perl-sdk/blob/master/README.md#how-to-use-this-module-in-your-project)
8+
* [SDK Documenation](https://rawgit.com/hexonet/perl-sdk/master/docs/hexonet.html)
59
* [HEXONET Backend API Documentation](https://github.com/hexonet/hexonet-api-documentation/tree/master/API)
6-
* [Release Notes](https://github.com/hexonet/php-sdk/releases)
7-
* [Development Guide](https://github.com/hexonet/php-sdk/wiki/Development-Guide)
10+
* [Release Notes](https://github.com/hexonet/perl-sdk/releases)
11+
* [Development Guide](https://github.com/hexonet/perl-sdk/wiki/Development-Guide)
812

913
## How to use this module in your project
1014

11-
We have also a demo app available showing how to integrate and use our SDK. See [here](https://github.com/hexonet/php-sdk-demo).
15+
We have also a demo app available showing how to integrate and use our SDK. See [here](https://github.com/hexonet/perl-sdk-demo).
1216

1317
### Requirements
1418

15-
* Installed php and php-curl
16-
* Installed [composer](https://getcomposer.org/download/).
19+
* Installed most current version of perl 5
20+
* Installed cpanm (App::cpanminus) as suggested alternative for cpan command
1721

18-
### Download from packagist
22+
### Install from CPAN
1923

20-
This module is available on the [PHP Package Registry](https://packagist.org/packages/hexonet/php-sdk).
24+
```bash
25+
# by Module ID (suggested!)
26+
cpanm WebService::Hexonet::Connector
2127

22-
Run `composer require "hexonet/php-sdk:*"` to get the latest version downloaded and added to composer.json.
23-
In your script simply use `require 'vendor/autoload.php';` or `require 'vendor/hexonet/php-sdk';`
28+
# or by filename
29+
cpanm HEXONET/WebSservice-Hexonet-Connector-1.03.tar.gz
30+
```
2431

25-
NOTE: The above will also set `"hexont/php-sdk": "*"` as dependency entry in your composer.json. When running `composer install` this would always install the latest release version. This is dangerous for production systems as major version upgrades may come with breaking changes and are then incompatible with your app. For production systems we suggest to use a version dependent syntax, e.g. `composer require "hexonet/php-sdk:v3.0.3"`.
26-
You can find the versions listed at packagist or at github in the release / tag overview.
32+
NOTE: I got this only working by sudo'ing these commands.
33+
In case you install by filename, please check the [release overview](https://github.com/hexonet/perl-sdk/releases) for the most current release and use that version instead.
2734

2835
### Usage Examples
2936

@@ -35,34 +42,50 @@ Not yet available, this needs a review of the SDK.
3542

3643
#### Sessionless API Communication
3744

38-
```php
39-
require __DIR__ . '/vendor/autoload.php';
40-
41-
// --- SESSIONLESS API COMMUNICATION ---
42-
$api = \HEXONET\Connection::connect(array(
43-
"url" => "https://coreapi.1api.net/api/call.cgi",
44-
"login" => "test.user",
45-
"password" => "test.passw0rd",
46-
"entity" => "1234",
47-
//"remoteaddr" => "1.2.3.4" //optional: use this in case of ip filter setting
48-
));
49-
50-
$r = $api->call(array(
51-
"COMMAND" => "StatusAccount"
52-
));
53-
echo "<pre>" . htmlspecialchars(print_r($r->asHash(), true)) . "</pre>";
45+
```perl
46+
use strict;
47+
use warnings;
48+
use WebService::Hexonet::Connector;
49+
50+
my $api = WebService::Hexonet::Connector::connect(
51+
{
52+
url => "https://coreapi.1api.net/api/call.cgi",
53+
entity => "1234",
54+
login => "test.user",
55+
password => "test.passw0rd"
56+
}
57+
);
58+
59+
# Call a command
60+
my $response = $api->call(
61+
{
62+
command => "QueryDomainList",
63+
limit => 5
64+
}
65+
);
66+
67+
# get the result in the format you want
68+
my $res = $response->as_list();
69+
$res = $response->as_list_hash();
70+
$res = $response->as_hash();
71+
72+
# get the response code and the response description
73+
my $code = $response->code();
74+
my $description = $response->description();
75+
76+
print "$code $description";
5477
```
5578

5679
## Contributing
5780

58-
Please read [our development guide](https://github.com/hexonet/java-sdk/wiki/Development-Guide) for details on our code of conduct, and the process for submitting pull requests to us.
81+
Please read [our development guide](https://github.com/hexonet/perl-sdk/wiki/Development-Guide) for details on our code of conduct, and the process for submitting pull requests to us.
5982

6083
## Authors
6184

6285
* **Anthony Schneider** - *development* - [ISharky](https://github.com/isharky)
6386
* **Kai Schwarz** - *development* - [PapaKai](https://github.com/papakai)
6487

65-
See also the list of [contributors](https://github.com/hexonet/php-sdk/graphs/contributors) who participated in this project.
88+
See also the list of [contributors](https://github.com/hexonet/perl-sdk/graphs/contributors) who participated in this project.
6689

6790
## License
6891

0 commit comments

Comments
 (0)