omisai/php-continents
Composer 安装命令:
composer require omisai/php-continents
包简介
PHP package to provide continents
关键字:
README 文档
README
PHP Continents Package
The PHP Continents Package provides a convenient and object-oriented approach to working with continent data. Designed to integrate continent information into any PHP applications with ease. This package offers easy access to continent names, non-standardized alpha-2 codes and UN M.49 numeric codes. Eventually, more detailed geographical data is coming like subregions and extra locales.
Features
- Easy retrieval of continent names and codes.
- Object-Oriented Programming (OOP) approach for better data management and integration.
- Lightweight and simple to integrate into any PHP project. (8.1+)
- Currently supporting English, Hungarian, German, Spanish, Italian and French languages.
- Future support for subregions and multiple locales, making it versatile for international applications.
Installation
The PHP Continents Package can be easily installed via Composer.
composer require omisai/php-continents
Usage
After installing the package, you can begin to work with continent data. You can work with any continent model or access all of them through a Collection.
/** * Access through the Collection * * Consider using the Collection class, if you * plan to register it to a service container. * It eagerly loads all the continents. */ use Omisai\Continents\Collection; $collection = new Collection(); $continents = $collection->getContinents(); /** * Shorthand to use the default english locale */ $continents[0]->name; // "Asia" /** * Or using different locale */ $continents[0]->getName('fr'); // "Asie" /** * Search for continent based on alpha-2 code */ $collection->getContinentByCode('OC'); // Omisai\Continents\Models\Oceania /** * Search for continent based on UN M.49 numeric code */ $collection->getContinentByNumeric('010'); // Omisai\Continents\Models\Antarctica /** * Use any continent directly */ use Omisai\Continents\Models\Europe; $europe = new Europe(); $europe->numeric; // "150" $europe->code; // "EU"
Changelog
Please see CHANGELOG for more information on what has changed recently.
Testing
./vendor/bin/pest # or composer test
Contributing
Please see CONTRIBUTING.md for details on how to contribute to this project.
Security
Please see SECURITY.md for details on reporting security vulnerabilities.
License
This package is open-sourced software licensed under the MIT license.
Sponsoring
If you find this package useful, please consider sponsoring the development: Sponsoring on GitHub
Your support helps us maintain and improve this open-source project!
omisai/php-continents 适用场景与选型建议
omisai/php-continents 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 6 次下载、GitHub Stars 达 1, 最近一次更新时间为 2024 年 03 月 27 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「continent」 「continents」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 omisai/php-continents 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 omisai/php-continents 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 omisai/php-continents 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
PHP class to get array of countries names with ISO_3166-1 alpha-2, alpha-3, numeric codes, ISD codes and continent
Continents & countries: ISO 3166-1 alpha-2 code, name, ISO 639-1 languages, capital, ISO 4217 currencies (symbols & numeric codes), native name, phone. JSON, CSV and SQL.
GeoLocation package for Laravel.
Intl extension data in comfortable format.
Laravel - Countries[States/Cities, Currency, Phone Code, Languages, Capital] & Continents & Timezones.
Country data for Yii2 using Intl extension and more.
统计信息
- 总下载量: 6
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 17
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-03-27