Download the PHP package phil/opening-hours without Composer

On this page you can find all versions of the php package phil/opening-hours. 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 opening-hours

phil/opening-hours

A place's opening hours, and whether it is open right now.

phil/opening-hours holds a place's hours as value objects. A week has its hours, with ranges that may close past midnight. Special hours replace them for a day or a period, such as a holiday when the place is closed or a summer with other hours. The library says whether the place is open at a moment and when it next opens, in the place's time zone. It groups the week in runs of days with the same hours, reads and writes a text form people type, gives schema.org's openingHoursSpecification, and turns hours into an array of texts for one JSON column. It does not name days or write times in a language, which phil/opening-hours-bundle does with ICU. It holds no public holidays either: special hours are the place's own.

It is for any application that lists places people visit: a shop, a library, a club, a venue. A visitor wants to know whether the door is open now, and a search engine wants the hours in a form it reads.

It is a plain PHP library, usable in any PHP code, with no dependency beyond ext-mbstring. In a Symfony application, reach for phil/opening-hours-bundle, which adds a form, a Doctrine column type and Twig functions.

The design rests on small immutable types: TimeOfDay, TimeRange, DayHours, SpecialHours and OpeningHours. A moment is turned to the place's time zone before it is read, so asking at 14:30 UTC in January about a shop in Toronto asks about 09:30 there.

Status

Part State
TimeOfDay, TimeRange, DayHours, SpecialHours, OpeningHours Implemented and tested
isOpenAt(), nextOpening(), groups() Implemented and tested
HoursText, OpeningHoursSchema, OpeningHoursArray Implemented and tested

Documentation

Document What it covers
Installation Requirements and installing.
Hours Times, ranges, days, special hours, and the time zone.
Asking Open now, next opening, the hours of a day, the week in runs.
Text, schema.org and storage The text form, the schema.org specifications, the array.
Extension points The ports, arguments and data an application chooses or replaces.
Testing The library's tests and mutation bar.
Reference Every type of the library, with its role.

Quick start

Requirements

PHP 8.5 or later with ext-mbstring.

Contributing

Contributions are welcome on the PHIL monorepo: read the contribution guide and the security policy explains, never in a public issue.

License

MIT, © Philippe Gamache, doing business as Le Gnome Archiviste; a Parler Haut Interagir Librement project. See LICENSE.


All versions of opening-hours with dependencies

PHP Build Version
Package Version
Requires php Version >=8.5
ext-mbstring 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 phil/opening-hours contains the following files

Loading the files please wait ...