imelgrat/google-time-zone
Composer 安装命令:
composer require imelgrat/google-time-zone
包简介
A PHP wrapper for the Google Maps TimeZone API.
README 文档
README
A PHP wrapper for the Google Maps TimeZone API.
The Google Maps Time Zone API provides a simple interface to request the time zone for a location on the earth, as well as that location's time offset from UTC.
The API provides time offset data for any locations on Earch. Requests for the time zone information are made for a specific latitude/longitude pair and timestamp.
The class automates the query process and returns the name of that time zone (in different languages), the time offset from UTC, and the daylight savings offset in a user-selectable format (XML or JSON).
Developed by Ivan Melgrati
======= A PHP wrapper for the Google Maps Time Zone API.
Developed by Ivan Melgrati
Requirements
- PHP >= 5.3.0
- In order to be able to use this class, it's necessary to provide an API key or, for business clients, Client ID and signing key.
Installation
Composer
The recommended installation method is through
Composer, a dependency manager for PHP. Just add
imelgrat/google-time-zone to your project's composer.json file:
{
"require": {
"imelgrat/google-time-zone": "*"
}
}
More details can be found over at Packagist.
Manually
- Copy
src/GoogleMapsTimeZone.phpto your codebase, perhaps to thevendordirectory. - Add the
GoogleMapsTimeZoneclass to your autoloader orrequirethe file directly.
Then, in order to use the GoogleMapsTimeZone class, you need to invoke the "use" operator to bring the class into skope.
<?php use imelgrat\GoogleMapsTimeZone\GoogleMapsTimeZone; require_once ('../src/GoogleMapsTimeZone.php'); /** * All queries require an API key from Google * @link https://developers.google.com/maps/documentation/timezone/get-api-key * */ define('API_KEY', 'YOUR API KEY HERE'); // Initialize GoogleMapsTimeZone object (New York City coordinates) $timezone_object = new GoogleMapsTimeZone(40.730610, -73.935242, 0, GoogleMapsTimeZone::FORMAT_JSON); // Set Google API key $timezone_object->setApiKey(API_KEY); // Perform query $timezone_data = $timezone_object->queryTimeZone(); echo '<pre>'; print_r($timezone_data); echo '</pre>'; ?>
Feedback
Please open an issue to request a feature or submit a bug report. Or even if you just want to provide some feedback, I'd love to hear. I'm also available on Twitter as @imelgrat.
Contributing
- Fork it.
- Create your feature branch (
git checkout -b my-new-feature). - Commit your changes (
git commit -am 'Added some feature'). - Push to the branch (
git push origin my-new-feature). - Create a new Pull Request.
imelgrat/google-time-zone 适用场景与选型建议
imelgrat/google-time-zone 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 974.38k 次下载、GitHub Stars 达 8, 最近一次更新时间为 2016 年 09 月 05 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「map」 「google」 「maps」 「gmap」 「location」 「timezone」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 imelgrat/google-time-zone 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 imelgrat/google-time-zone 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 imelgrat/google-time-zone 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Maps in minutes. Powered by the Google Maps API.
A Laravel Nova Google Maps Field.
Yii2 map input widget. Allows you to select geographcal coordinates via a human-friendly inteface.
Google Maps PHP SDK.
Magento 2 Social Login extension is designed for quick login to your Magento 2 store without procesing complex register steps
The enumeration type for PHP
统计信息
- 总下载量: 974.38k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 10
- 点击次数: 36
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-09-05