Download the PHP package nyg/holiday without Composer

On this page you can find all versions of the php package nyg/holiday. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package holiday

这是一个查询节假日和农历扩展包

准确度说明

1,目前包里已包含2001年至2050年的节假日信息,农历节气可查询1970年-2050年的,节假日可查询2011年-2050年(自动跟随政府公布的信息更新)

2,查询当前时间和之前的节假日信息,会走缓存的数据信息,因为已经过去的假期是已经固定的

3,查询未来的节假日,如果缓存的数据超过3天(即使是临时性放假,也至少会提前3天公布吧),会自动从百度拉取最新的假期信息,如果拉取失败会继续走缓存

4,查询未来的节假日,如果没有缓存,会自动从百度拉取最新的假期信息,如果拉取失败会抛出异常

5,对于要求比较高的,可以先强制刷新数据再查询

使用方法

安装扩展

composer require nyg/holiday

使用方法

1,判断当前日期是否是节假日

返回结果 true 或 false,此函数有第二个参数type,可选值为
TYPE_ALL = 1; //全部节假日 包括周末 默认
TYPE_WEENEND = 2; //普通的周末,2倍工资的那种
TYPE_HOLIDAY = 3; //只包含节日,3倍工资的那种,节日当天
TYPE_VACATION = 4; //节假日,节日+节日前后调休的部分

如果只判断节假日,不考虑周末

2,获取时间段内假期天数
3,获取时间段内假期列表
4,节假日名称
5,获取农历日历
6,获取节气
7,刷新数据

All versions of holiday with dependencies

PHP Build Version
Package Version
Requires php Version ^5.6|7.*
ext-curl Version *
ext-json Version *
ext-iconv Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package nyg/holiday contains the following files

Loading the files please wait ....