grizzlyware/intl-zones 问题修复 & 功能扩展

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

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

grizzlyware/intl-zones

最新稳定版本:v1.2.1

Composer 安装命令:

composer require grizzlyware/intl-zones

包简介

Provides a list of zones for countries

README 文档

README

Latest Version on Packagist Tests Total Downloads

This package provides a list of zones for a particular country.

Installation

You can install the package via composer:

composer require grizzlyware/intl-zones

Usage

use Grizzlyware\Intl\Zones\Zones;

$zones = Zones::forAlpha2Code('GB');

foreach ($zones as $zone) {
    echo "The name is: {$zone->name}" . PHP_EOL;
    
    if (null !== $zone->code) {
        echo "The code is: {$zone->code}" . PHP_EOL;
    } else {
        echo "No code available" . PHP_EOL;
    }
}

// Setting the locale (right now, only en is supported, and the default).
Zones::setLocale('en');

Disclaimer

The data in this package is not guaranteed to be accurate or complete.

Generating new data

There is a generator script here: bin/generate

Running this script will pull in data from Stefan Gabos' World Countries repository, which itself pulls data from Wikipedia.

Overrides are defined in resources/overrides/zones/en.php - This was created to cater for the United Kingdom, which doesn't have its counties listed in the repository above.

Testing

composer test

Contributing

Please open a PR with the additional zones and supported countries to override data.

If the data should be re-generated, please fork the repository, run the generator and open a PR.

Tests should be added where appropriate.

Changelog

Please see CHANGELOG for more information on what has changed recently.

Security Vulnerabilities

Please do not publicly disclose any vulnerabilities - Report any vulnerabilities to contact@grizzlyware.com directly

Credits

License

The MIT License (MIT). Please see License File for more information.

See World Countries Repo for license of the source of the generated data.

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-03-16