Download the PHP package zachweix/php-zmanim without Composer

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

PhpZmanim

A PHP port of the KosherJava Zmanim API from Eliyahu Hershfeld (code at the KosherJava Zmanim project). See Kosher Java documentation for comments for every class variable and method. See below for how to install and a more detailed list of what you can access and methods you can call. Once instantiated, you can ask for many Zmanim right out of the gate:

Installation (with Composer)

Setup

Instantiation

You can instantiate a new Zmanim object with the Zmanim::create() function. (If you want, you can instantiate by creating a GeoLocation object and a ComplexZmanimCalendar object like in KosherJava). There are currently two ways to calculate the Zmanim times, SunTimesCalculator and NoaaCalculator; the default calculator is NoaaCalculator.

Via Zmanim::create()

The expected arguments are: $year, $month, $day, $locationName, $latitude, $longitude, $elevation, $timeZone

All arguments are optional. The default values are today in Greenwich Mean Time at elevation 0. As you can see below, these are how you would set the location to either the default location, or a custom location. The location name is not used anywhere, and is only for your own internal reference (it can be null if you want).

If you give null as the year, month or day, today's UTC date will be used, which may be different than your current date (e.g. 9:00PM in New York on February 21 is 2:00AM in UTC on February 22).

Via GeoLocation and ComplexZmanimCalendar

GeoLocation's expected arguments are: $locationName, $latitude, $longitude, $elevation, $timeZone

ComplexZmanimCalendar's expected arguments are: $geoLocation, $year, $month, $day

If you give null as the year, month or day, today's UTC date will be used, which may be different than your current date (e.g. 9:00PM in New York on February 21 is 2:00AM in UTC on February 22).

Usage

Any parameter called like $zmanim->sunrise or a method name you see that is called like $zmanim->get("Sunrise") can be called by concatenating get to the zman and making sure to capitalize the first letter, so you would get $zmanim->getSunrise(); the following three will return identical results, all of which are a Carbon object.

If you want to factor elevation when calculating, make sure to set the elevation when instantiating the object. If you set an elevation other than 0 and want to ignore elevation, you can call $zmanim->setUseElevation(false) and then when you want to use it again, simply call $zmanim->setUseElevation(true).

Available Methods

List of Zmanim

Here is a list of many possible Zmanim you can request, all of them will return a Carbon object in the timezone set when creating the $zmanim object. If you don't find what you are looking for, see below for how to get more custom Zmanim.

Sunrise:

Sunset

Length of Shaah Zmanim (in minutes)

Alos Hashachar

Misheyakir

Sof Zman Shma

Sof Zman Tfila

Erev Pesach

Chatzos

Mincha Gedola

Mincha Ketana

Plag Hamincha

Candle Lighting

Start of Bain Hasmashos (According to Rabbeinu Tam)

Tzais

Chatzos Halayla (Midnight)

Molad Zmanim

Notes

  1. AteretTorah Zman is calculated based on a day being from Alos72Zmanis until 40 minutes after sunset. However, the exact time offset can be changed by calling $zmanim->setAteretTorahSunsetOffset($ateretTorahSunsetOffset).
  2. FixedLocalChatzos is based on a fixed time for Chatzos throughout the year, see KosherJava's documentation for more details.
  3. Baal Hatanya calculates Zmanim based on a zenith of 1.583 degrees below the 90 degree geometric zenith.

Alternative Zmanim

If you are looking for any Zman which is an offset from sunrise or sunset that is not listed in the list above, you can call one of the following methods with your offset.

You can use those times as parameters for custom calculations for the following functions:

Jewish Calendar Calculations

For the usage syntax you can look at the KosherJava documentation. (TODO: Add the methods here as well).

GeoLocation Mathematical Calculations

There are a few functions that can be run for calculations on GeoLocation objects:


All versions of php-zmanim with dependencies

PHP Build Version
Package Version
Requires nesbot/carbon Version ^2.0 || ^3.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 zachweix/php-zmanim contains the following files

Loading the files please wait ....