intervention/zodiac
Composer 安装命令:
composer require intervention/zodiac
包简介
Zodiac Sign Calculator
README 文档
README
Intervention Zodiac is a astrological calculator for PHP 8.2+ that resolves Western and Chinese zodiac signs from various data types.
- Fluent interface to calculate zodiac signs
- Support for western and chinese astrology
- Framework-agnostic
Installation
The installation works with Composer by running the following command.
composer require intervention/zodiac
Although the library is framework agnostic it comes with a service provider for the Laravel Framework. Which will be discovered automatically and registers the calculator into your installation.
Getting Started
Read the full documentation for this library.
Code Examples
Calculator
use Intervention\Zodiac\Calculator; use Intervention\Zodiac\Astrology; use DateTime; // create calculator with astrology $calculator = new Calculator(Astrology::WESTERN); // calculate various date formats $sign = $calculator->calculate('2001-01-01'); $sign = $calculator->calculate('first day of june 2014'); $sign = $calculator->calculate('2018-06-15 12:34:00'); $sign = $calculator->calculate(new DateTime('2001-01-01')); $sign = $calculator->calculate(228268800); $sign = $calculator->calculate('228268800'); // override the default astrology $sign = $calculator->calculate('2001-01-01', Astrology::CHINESE);
Sign
use Intervention\Zodiac\Sign; use Intervention\Zodiac\Chinese\Sign as ChineseSign; use Intervention\Zodiac\Western\Sign as WesternSign; use DateTime; // parse signs directly $sign = Sign::fromString('2000-01-01'); $sign = Sign::fromString('first day of june 2014'); $sign = Sign::fromDate(new DateTime('2001-01-01')); $sign = Sign::fromUnix(228268800); $sign = Sign::fromUnix('228268800'); // parse western signs directly $sign = WesternSign::fromString('2000-01-01'); // parse chinese signs directly $sign = ChineseSign::fromString('2000-01-01'); // sign methods $name = $sign->name(); // 'gemini' $html = $sign->html(); // '♊︎' $localized = $sign->localize('fr')->name(); // Gémeaux $compatibility = $sign->compatibility($sign); // .6
Authors
This library is developed and maintained by Oliver Vogel
Thanks to the community of contributors who have helped to improve this project.
License
Intervention Zodiac is licensed under the MIT License.
intervention/zodiac 适用场景与选型建议
intervention/zodiac 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 202.01k 次下载、GitHub Stars 达 57, 最近一次更新时间为 2016 年 01 月 02 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「zodiac」 「horoscope」 「birthday」 「sun sign」 「star sign」 「astrology」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 intervention/zodiac 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 intervention/zodiac 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 intervention/zodiac 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A Bundle for displaying the zodiac for a Date
Calculates the zodiac sign for a given day and month.
Custom horoscope module
中国日历,通过天文计算和民间推算方法,准确计算出公历-1000年至3000年的农历、干支、节气等,同时支持多配置、多语言、多时区。
Happyr birthday bundle gives you a nicer way to render birthday widgets
Complete 100% 1:1 PHP FFI Wrapper for the Swiss Ephemeris C Library - Direct C function calls with zero abstraction for maximum astronomical precision
统计信息
- 总下载量: 202.01k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 59
- 点击次数: 33
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-01-02