定制 intervention/zodiac 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

intervention/zodiac

Composer 安装命令:

composer require intervention/zodiac

包简介

Zodiac Sign Calculator

README 文档

README

Latest Version Tests Monthly Downloads Support me on Ko-fi

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 我们能提供哪些服务?
定制开发 / 二次开发

基于 intervention/zodiac 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

  • Stars: 57
  • Watchers: 1
  • Forks: 16
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-01-02