PHPackages                             nil-2008/phalapi-weekday - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. nil-2008/phalapi-weekday

ActiveLibrary

nil-2008/phalapi-weekday
========================

PhalApi 2.x 扩展库 - 用于判断当天是否是工作日。

0.1.0(7y ago)021GPL-3.0-or-laterPHPPHP &gt;=5.3.3

Since Jun 26Pushed 7y agoCompare

[ Source](https://github.com/nil-2008/weekday)[ Packagist](https://packagist.org/packages/nil-2008/phalapi-weekday)[ Docs](https://www.phalapi.net/)[ RSS](/packages/nil-2008-phalapi-weekday/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (1)Versions (2)Used By (0)

基于PhalApi2的工作日是否上班判断拓展
======================

[](#基于phalapi2的工作日是否上班判断拓展)

[![](https://camo.githubusercontent.com/d17444d1c116ba8de47ca5f2d1550a5076c737e97beff214dca622d75b668533/687474703a2f2f776562746f6f6c732e71696e6975646e2e636f6d2f6d61737465722d4c4f474f2d32303135303431305f35302e6a7067)](https://camo.githubusercontent.com/d17444d1c116ba8de47ca5f2d1550a5076c737e97beff214dca622d75b668533/687474703a2f2f776562746f6f6c732e71696e6975646e2e636f6d2f6d61737465722d4c4f474f2d32303135303431305f35302e6a7067)

前言
--

[](#前言)

节假日判断在PHP开发中运用场景已经无处不在,本扩展就是为了解决此问题而生的.

附上:

官网地址:[http://www.phalapi.net/](http://www.phalapi.net/ "PhalApi官网")

项目GitHub地址:[https://github.com/nil-2008/weekday](https://github.com/nil-2008/weekday "项目Git地址")

安装PhalApi2-Weekday
------------------

[](#安装phalapi2-weekday)

在项目的composer.json文件中，添加：

```
{
    "require": {
        "nil-2008/phalapi-weekday": "dev-master"
     }
}

```

配置好后，执行composer update更新操作即可。

配置文件
----

[](#配置文件)

我们需要在 **./config/app.php** 配置文件中追加以下配置：

```
/**
 * 请在下面放置任何您需要的应用配置
 */

return array(

    'on_holidays_list' => array(
        //中秋
        mktime(0, 0, 0, 9, 24, 2018),
        //国庆
        mktime(0, 0, 0, 10, 1, 2018),
        mktime(0, 0, 0, 10, 2, 2018),
        mktime(0, 0, 0, 10, 3, 2018),
        mktime(0, 0, 0, 10, 4, 2018),
        mktime(0, 0, 0, 10, 5, 2018),
    ),

);

```

入门使用
----

[](#入门使用)

初始化PhalApi2-Weekday,入口文件index.php加入如下代码

```

// 惰性加载Weekday
$di->weekday = function () {
    return new \PhalApi\Weekday\Lite(\PhalApi\DI()->config->get("app.on_holidays_list"));
}

```

常用基础操作(具体API可以查阅代码中src/Lite.php)

```
echo  \PhalApi\DI()->weekday->isWeekday();

```

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

2874d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/39a4648e85bd6086a1c08fd8d0329c10c4014c0e6bddc36c34461e2616873721?d=identicon)[ofzt](/maintainers/ofzt)

---

Top Contributors

[![nil-2008](https://avatars.githubusercontent.com/u/22513136?v=4)](https://github.com/nil-2008 "nil-2008 (5 commits)")

---

Tags

phalapiweekdayphalapi-weekday

### Embed Badge

![Health badge](/badges/nil-2008-phalapi-weekday/health.svg)

```
[![Health](https://phpackages.com/badges/nil-2008-phalapi-weekday/health.svg)](https://phpackages.com/packages/nil-2008-phalapi-weekday)
```

###  Alternatives

[phalapi/phalapi

PhalApi v2.x，一个PHP轻量级开源接口框架，致力于快速开发接口服务。

1.6k12.2k](/packages/phalapi-phalapi)[phalapi/kernal

PhalApi 2.x 框架核心部分。

1220.7k4](/packages/phalapi-kernal)[phalapi/redis

PhalApi 2.x 扩展类库 - Redis 丰富基础redisCache类功能,更贴切复杂场景下的redis使用。

122.6k](/packages/phalapi-redis)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
