Recommend this page to a friend! |
Download .zip |
Info | Documentation | View files (8) | Download .zip | Reputation | Support forum (1) | Blog | Links |
Ratings | Unique User Downloads | Download Rankings | ||||
Not enough user ratings | Total: 154 This week: 1 | All time: 9,034 This week: 560 |
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 |
File | Role | Description | ||
---|---|---|---|---|
lib (1 directory) | ||||
composer.json | Data | Auxiliary data | ||
LICENSE | Lic. | License text | ||
README.md | Doc. | Documentation |
Files | / | lib | / | Geohelper |
File | Role | Description | ||
---|---|---|---|---|
Exception (2 files) | ||||
Http (1 file) | ||||
Response (1 file) | ||||
ApiClient.php | Class | Class source |
Files | / | lib | / | Geohelper | / | Exception |
File | Role | Description |
---|---|---|
CurlException.php | Class | Class source |
InvalidJsonException.php | Class | Class source |
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.