Download the PHP package selfworks/recurr without Composer

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

Recurr Build Status Latest Stable Version Total Downloads Latest Unstable Version License

Recurr is a PHP library for working with recurrence rules (RRULE) and converting them in to DateTime objects.

Recurr was developed as a precursor for a calendar with recurring events, and is heavily inspired by rrule.js.

Installing Recurr

The recommended way to install Recurr is through Composer.

composer require selfworks/recurr

Using Recurr

Creating RRULE rule objects

You can create a new Rule object by passing the (RRULE) string or an array with the rule parts, the start date, end date (optional) and timezone.

You can also use chained methods to build your rule programmatically and get the resulting RRULE.

RRULE to DateTime objects

  1. $transformer->transform(...) returns a RecurrenceCollection of Recurrence objects.
  2. Each Recurrence has getStart() and getEnd() methods that return a \DateTime object.
  3. If the transformed Rule lacks an end date, getEnd() will return a \DateTime object equal to that of getStart().

Note: The transformer has a "virtual" limit (default 732) on the number of objects it generates. This prevents the script from crashing on an infinitely recurring rule. You can change the virtual limit with an ArrayTransformerConfig object that you pass to ArrayTransformer.

Transformation Constraints

Constraints are used by the ArrayTransformer to allow or prevent certain dates from being added to a RecurrenceCollection. Recurr provides the following constraints:

$inc defines what happens if $after or $before are themselves recurrences. If $inc = true, they will be included in the collection. For example,

Note: If building your own constraint, it is important to know that dates which do not meet the constraint's requirements do not count toward the transformer's virtual limit. If you manually set your constraint's $stopsTransformer property to false, the transformer might crash via an infinite loop. See the BetweenConstraint for an example on how to prevent that.

Post-Transformation RecurrenceCollection Filters

RecurrenceCollection provides the following chainable helper methods to filter out recurrences:

$inc defines what happens if $after or $before are themselves recurrences. If $inc = true, they will be included in the filtered collection. For example,

pseudo...
2014-06-01 startsBetween(2014-06-01, 2014-06-20) // false
2014-06-01 startsBetween(2014-06-01, 2014-06-20, true) // true

Note: RecurrenceCollection extends the Doctrine project's ArrayCollection class.

RRULE to Text

Recurr supports transforming some recurrence rules into human readable text. This feature is still in beta and only supports yearly, monthly, weekly, and daily frequencies.

If you need more than English you can pass in a translator with one of the supported locales (see translations folder).

Warnings

This behavior is configurable:

Contribute

Feel free to comment or make pull requests. Please include tests with PRs.

License

Recurr is licensed under the MIT License. See the LICENSE file for details.


All versions of recurr with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6.3
doctrine/collections 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 selfworks/recurr contains the following files

Loading the files please wait ....