| Recommend this page to a friend! | 
|  Download | 
| Info | Documentation |  Files |  Install with Composer |  Download | Reputation | Support forum | Blog | Links | 
| Ratings | Unique User Downloads | Download Rankings | ||||
| Not enough user ratings | Total: 154 | All time:  9,043 This week: 524  | ||||
| Version | License | PHP version | Categories | |||
| geohelper-api-client 1.0.0 | BSD License | 5 | PHP 5, Web services, Geography | 
PHP-client for Geohelper API.
1) Get composer
2) Run into your project directory:
composer require dmamontov/geohelper-api-client-php ~1.0.0
If you have not used composer before, include autoloader into your project.
require 'path/to/vendor/autoload.php';
$client = new \Geohelper\ApiClient(
    'api_key'
);
try {
    $response = $client->countriesList();
} catch (\Geohelper\Exception\CurlException $e) {
    echo "Connection error: " . $e->getMessage();
}
if ($response->isSuccessful()) {
    $countries = isset($response['result']) ? $response['result'] : array();
    foreach ($countries as $country) {
        echo $country['name'];
    }
} else {
    echo sprintf(
        "Error: [HTTP-code %s] %s",
        $response->getStatusCode(),
        $response->getErrorMsg()
    );
}
|  Files (8) | 
| File | Role | Description | ||
|---|---|---|---|---|
|  lib (1 directory) | ||||
|    composer.json | Data | Auxiliary data | ||
|    LICENSE | Lic. | License text | ||
|    README.md | Doc. | Documentation | ||
|  Files (8) | / | lib | / | Geohelper | 
| File | Role | Description | ||
|---|---|---|---|---|
|  Exception (2 files) | ||||
|  Http (1 file) | ||||
|  Response (1 file) | ||||
|  ApiClient.php | Class | Class source | ||
|  Files (8) | / | lib | / | Geohelper | / | Exception | 
| File | Role | Description | 
|---|---|---|
|  CurlException.php | Class | Class source | 
|  InvalidJsonException.php | Class | Class source | 
| The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page. | 
|  Install with Composer | 
|  | geohelper-api-client-2019-05-02.zip 4KB | 
|  | geohelper-api-client-2019-05-02.tar.gz 3KB | 
|  | Install with Composer | 
| Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
| 100% | 
 | 
 | 
| User Comments (1) | |||||
| 
 | |||||
| Applications that use this package | 
 If you know an application of this package, send a message to the author to add a link here.
 If you know an application of this package, send a message to the author to add a link here.