league/period
Composer 安装命令:
composer require league/period
包简介
Time range API for PHP
关键字:
README 文档
README
Period is PHP's missing time range API. This package covers all basic operations regarding time ranges.
Highlights
- Represents Interval and Bounds as immutable value objects or enumeration
- Exposes named constructors to ease instantiation
- Covers all basic manipulations related to time range
- Enables working with simple or complex time ranges logic
- Fully documented
- Framework-agnostic
Documentation
Full documentation can be found at period.thephpleague.com.
System Requirements
You need PHP >= 8.1.0 but the latest stable version of PHP is recommended.
Install
Install Period using Composer.
$ composer require league/period
or download the library and:
- use any other PSR-4 compatible autoloader.
- use the bundle autoloader script as shown below:
require 'path/to/period/repo/autoload.php'; use League\Period\Datepoint; Datepoint::fromDateString('2012-05-23')->month()->toIso80000('Y-m-d'); //returns [2012-05-01, 2012-06-01)
where path/to/period/repo represents the path where the library was extracted.
Testing
Period has:
- a PHPUnit test suite
- a code analysis compliance test suite using PHPStan.
- a coding style compliance test suite using PHP CS Fixer.
To run the tests, run the following command from the project folder.
$ composer test
Contributing
Contributions are welcome and will be fully credited. Please see CONTRIBUTING and CONDUCT for details.
Security
If you discover any security related issues, please email nyamsprod@gmail.com instead of using the issue tracker.
Changelog
Please see CHANGELOG for more information on what has changed recently.
Credits
License
The MIT License (MIT). Please see LICENSE for more information.
league/period 适用场景与选型建议
league/period 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 5.75M 次下载、GitHub Stars 达 733, 最近一次更新时间为 2014 年 10 月 11 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「time」 「date」 「schedule」 「calendar」 「timeline」 「sequence」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 league/period 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 league/period 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 league/period 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Tools to convert between .NET and PHP date formats
Enables the creation of cron-jobs tasks to be consumed by symfony/messenger
Adds the EDTF data type to Wikibase
A Deployment/Change Log Schedule and Notes system for SilverStripe sites
A powerful event calendar Tool for Laravel's Nova 5.
Date component is a set of methods to help with the manipulation of dates.
统计信息
- 总下载量: 5.75M
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 753
- 点击次数: 36
- 依赖项目数: 26
- 推荐数: 1
其他信息
- 授权协议: MIT
- 更新时间: 2014-10-11