Download the PHP package devhelp/calendar without Composer

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

Build Status

Credits

Plugin brought to you by : Devhelp.pl (http://devhelp.pl)

Purpose

Purpose of Devhelp/Calendar package is to help creating calendar with easy to define events that occur both on constant date as well as on date that is somehow referenced from another event (or calculated using custom logic)

Is also helps defining days off that are referenced to certain day, event or are calculated using custom logic

Is if for you ?

If one of the answer was "yes" then I hope you'll enjoy using this package

Installation

Composer

add package to composer.json

"require" : {
    "devhelp/calendar": "dev-master"
}

run update

composer update devhelp/calendar

Usage

Example calendar definition

$definition = array(
    Calendar::DAYS_OFF => array(
        new Day(3, 1),
        new Day(4, 1),
        new Day(5, 1),
        new DayRange(new Day(3, 1), new Day(10, 1)),
        new DayReference('national/constitution-day'),
    ),
    Calendar::EVENTS => array(
        'religion' => array(
            'easter' => function (Calendar $calendar, $year) {
                $a = $year % 19;
                $b = intval($year / 100);
                $c = $year % 100;
                $d = intval($b / 4);
                $e = $b % 4;
                $f = intval(($b + 8) / 25);
                $g = intval(($b - $f + 1) / 3);
                $h = (19 * $a + $b - $d - $g + 15) % 30;
                $i = intval($c / 4);
                $k = $c % 4;
                $l = (32 + 2 * $e + 2 * $i - $h - $k) % 7;
                $m = intval(($a + 11 * $h + 22 * $l) / 451);
                $p = ($h + $l - 7 * $m + 114) % 31;
                $day = $p + 1;
                $month = intval(($h + $l - 7 * $m + 114) / 31);

                return new Day($day, $month);
            },
            'divine-mercy-sunday' => new DayReference('religion/easter', '+7 day'),
        ),
        'national' => array(
            'independence-day' => new Day(11, 11),
            'constitution-day' => new Day(3, 5),
            'joining-european-union' => new DayReference('national/constitution-day')
        ),
        'birthday' => array(
            'joanne' => new Day(23, 3),
            'paul' => new Day(31, 8),
            'margaret' => new DayReference('birthday/paul', '+2 day'),
        ),
        'specific-day' => array(
            'first-day-of-march' => new Day(1, 3),
            'last-day-of-february' => new DayReference('specific-day/first-day-of-march', '-1 day'),
            '7-august' => new Day(7, 8),
            '7-september' => new DayReference('specific-day/7-august', '+1 month'),            
        )
    )
);

$calendar = new \Devhelp\Calendar\Calendar($definition);

Get Event Day

for events that are defined by reference (with value other than 0) or custom function you need to specify year to do the math

$calendar->getDay('religion/easter', 2013);

for events referenced with simple reference or defined as day just pass event name

$calendar->getDay('birthday/joanne');

$calendar->getDay('national/joining-european-union');

Get Days Off

you can get days off for defined in the calendar for certain year

$calendar->getDaysOff(2013);

do not worry about duplicated days. This function will only return unique ones

if no math needs to be done when calculating days off, then you do not have to pass year


All versions of calendar with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3
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 devhelp/calendar contains the following files

Loading the files please wait ....