spacedealer/geonames-api 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

spacedealer/geonames-api

最新稳定版本:0.2.2

Composer 安装命令:

composer require spacedealer/geonames-api

包简介

Geonames.org api client library based on guzzle 5

README 文档

README

Attention: Please do not use in production environments. It‘s WIP.

This is a simple geonames API client based on Guzzle 5.

Build Status SensioLabsInsight Dependency Status

Requirements

  • php >= 5.4
  • guzzle 5
  • guzzle services 0.5
  • guzzle command 0.7

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist spacedealer/geonames-api "*"

or add

"spacedealer/geonames-api": "*"

to the require section of your composer.json file.

Usage

$client = new \spacedealer\geonames\api\Geonames('your_username');
try {
    $response = $client->postalCodeSearch([
        'postalcode' => '10997',
        'country' => 'de',
    ]);

    if ($response->isOk()) {
        $count = $response->count();
        echo "Found entries: $count" . PHP_EOL;
        $placeName = $response->getPath('0/placeName');
        echo "Place name   : " . $placeName . PHP_EOL;
    } else {
        echo $response->getPath('message') . PHP_EOL;
    }
} catch (\RuntimeException $e) {
    echo $e->getMessage() . PHP_EOL;
}

Todos

  • complete unit tests
  • improve response model handling
  • add support for xml only command: extendedFindNearby

Resources

统计信息

  • 总下载量: 924
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 0
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 3
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2014-12-03