retailcrm / geohelper-php-sdk
PHP client for Geohelper API
1.0.0
2024-07-30 11:35 UTC
Requires
- php: ^7.4|^8.1
- ext-json: *
- nyholm/psr7: ^1.4
- psr/http-client: ^1.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.59
- neur0toxine/pock: ^0.12.2
- phpmd/phpmd: ^2.15
- phpstan/phpstan: ^1.11
- phpunit/phpunit: ^9.6
- retailcrm/php-code-style: ^1.0
- squizlabs/php_codesniffer: ^3.10
This package is auto-updated.
Last update: 2024-11-30 12:53:06 UTC
README
PHP-client for Geohelper API.
Requirements
- PHP 7.4 and higher
Install
-
Get composer
-
Run into your project directory:
composer require retailcrm/geohelper-php-sdk ~1.0.0
If you have not used composer
before, include autoloader into your project.
require 'path/to/vendor/autoload.php';
Usage
Get countries
$clientInterface = new \GuzzleHttp\Client(); $client = new RetailCrm\Geohelper\ApiClient( $clientInterface, 'api_key' ); $response = $client->countriesList(); 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() ); }