Download the PHP package jrbarnard/recurrence without Composer

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

Recurrence

Build Status StyleCI

This library allows you to create recurring DateTimes based on intervals, e.g every last wednesday of the month for the next 2 years.

It comes with some core Intervals, but it's built to allow you to create and use your own for your own project requirements.

It acts much like the DatePeriod PHP iterator in that it accepts a start date, end date and an interval object, however it gives us some more functionality also.

Contents

  1. Requirements
  2. Installation
  3. Usage
  4. Contributing
  5. License

Requirements

The only requirement currently is a minimum PHP version of 5.6.

CURRENTLY HACK / HHVM IS NOT SUPPORTED

Installation

Composer is the recommended installation method:

However you can also download this repo, unzip it and include it in your project.

Usage

The package comprises of three class types, these can be used separately or all together.

Occurrences

The occurrences class is a container to store DateTimes. It's basically just a wrapper around an array, but allows us a bit more flexibility in the future if we want to deal with a collection of DateTimes / the stored occurrences from the iterator.

Occurrences also implements the ArrayAccess interface meaning we can use the occurrences object just like an array:

Currently it doesn't have any internal validation, fancier methods for filtering etc. These are things we may add in the future.

Intervals

Intervals are the classes that define how we get the next occurrence within the iterator. They mirror the functionality of PHP's core DateIntervals where their purpose is to take a datetime and return back a datetime after applying their interval to it.

E.g Datetime of 2012-01-01, interval of 1 day, we would expect to get back a datetime of 2012-01-02.

Intervals can be as simple or as complex as you want, we provide a few, however you can make and use your own, they just must implement the IntervalInterface.

E.g:

The above example would apply the interval of 12 minutes to the date time, you can see this very basic interval is at it's core utilising a PHP DateInterval. This works well for simple Intervals, however may not be suitable for more complex ones.

Intervals also accept a direction, forwards or backwards, you can use the constants defined within the IntervalInterface.

The intervals that come with the package as standard are:

Iterator

The Iterator is the class you can use to apply your intervals over a set DateTime / Occurrence range.

For example it lets you do things like:

This allows us to calculate dates for things like recurring events easily.

As mentioned above, you can create your own intervals, so you should be able to create an interval / iterator to fit your own needs.

Iterators also have a few extra features:

Contributing

Please look at the contributing file

License

MIT License


All versions of recurrence with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6
ext-intl 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 jrbarnard/recurrence contains the following files

Loading the files please wait ....