dkvhin/ph-holidays

从菲律宾政府网站抓取假日信息

安装: 30

依赖: 0

建议者: 0

安全: 0

星标: 0

关注者: 1

分支: 0

开放问题: 0

语言:HTML

v1.0.6 2024-08-09 14:11 UTC

This package is auto-updated.

Last update: 2024-09-09 14:19:41 UTC


README

Latest Version on Packagist Tests Total Downloads

此包可以从官方网站https://www.officialgazette.gov.ph/nationwide-holidays/抓取常规假日和特别假日

注意:由于网站使用了机器人检测器(cloudflare),这可能在使用生产环境时导致错误,目前尚未完全100%正常工作。

use Dkvhin\PhHolidays\PhilippineHolidays;


// for the current year
$holidays = PhilippineHolidays::fetch();

// returns an array of regular holidays
$regular = $holidays->regular();

// returns an array of special holidays
$special = $holidays->special();

安装

您可以通过composer安装此包

composer require dkvhin/ph-holidays

用法

use Dkvhin\PhHolidays\PhilippineHolidays;

// for the current year
$holidays = PhilippineHolidays::fetch();


// you can also pass specific year
// NOTE that the website only provides the last 6 years worth of holidays
// Advance year are not always available from the website 
// eg. ( current year is 2024, holidays for 2025 might not be available yet until the end of the year)
$holidays = PhilippineHolidays::fetch(2022);

测试

composer test

致谢

许可证

MIT许可证(MIT)。更多信息请参阅许可证文件