Download the PHP package ujamii/osm-opening-hours without Composer

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

Openstreetmap opening hours parser in PHP

Packagist Minimum PHP Version Continuous Integration

Parser for the Openstreetmap opening hours format as connector for the library spatie/opening-hours.

Installation

composer require ujamii/osm-opening-hours

Usage

There are a lot more methods on the $hours object, please check the docs of that library. Of course, you can also use some more complex input like (please also check the docs) and the list of missing features below to see what's actually possible:

If you also need to support the public holiday feature (like PH off in the example above), you have to pass in a filter like this:

The filter for German holidays is included already, so please take at look at this and the corresponding interface, if you want to implement something specific for you. The expected config array may look like ['PH' => new GermanPublicHolidayFilter()] where the key PH has to match the beginning of the ruleset in the given OSM string and the value is an instance of your filter class. Input values like PH 09:00-12:00 or PH off will be parsed and given to the filter in the setOpeningHours method. The spatie/opening-hours library will call the applyFilter(\DateTimeImmutable $date) method internally when something like isOpenAt is requested.

Running tests

You can run the tests with composer run phpunit or composer run testall for test and static analysis.

License and Contribution

MIT

As this is OpenSource, you are very welcome to contribute by reporting bugs, improve the code, write tests or whatever you are able to do to improve the project. Just fork and PR.

If you want to do me a favour, buy me something from my Amazon wishlist.

Known issues / missing features


All versions of osm-opening-hours with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2
ext-calendar Version *
spatie/opening-hours Version ^2.11 || ^3.0 || ^4.0
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 ujamii/osm-opening-hours contains the following files

Loading the files please wait ....