Download the PHP package cossou/eventcron without Composer

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

Laravel 4 EventCRON

A Laravel 4 package that enables you to queue events and fire them in sequence, or at a specific time in the future.

Use Cases

Installation

Add the package to your composer.json and run composer update.

Add the service provider in app/config/app.php:

Optionally add the facade to your aliases:

If you are using Laravel 4.0 ,perform the migration to create the database tables:

Or if you are using Laravel 4.1, publish the package migration to your application

How to Use

To get started, there are three ways in which you can utilize this package.

Via the facade, if you added it to your configuration file (preferred way):

By using the Laravel IoC container:

Directly through the class:

Adding Events

First Steps

As shown, you can just queue your event and listen to it elsewhere.

Flushing the queue for this event will fire all of them at once, since no time has been set.

Using arguments

You can also pass some data to your event handler in the form of an array.

Laravel will then extract all of these variables and pass them to your event handler:

Timing Is Everything

Of course, the main idea of this package is to schedule your events. Just pass a Carbon instance as third parameter:

This event will only be triggered one hour from now.

Carbon is a nice extension to PHP's datetime class(es). For more info: https://github.com/briannesbitt/Carbon.

Flushing the Queue

Now that you've added all these events, you'd want them to be triggered so your whole setup actually does something.

To trigger the queue for a single event:

To trigger the queue of all events:

Please note: events with an execution time set will only be triggered if that moment is in the past. In addition, if the configuration file states enabled as false or run_only_from_cli as true (and you're flushing a queue from code), nothing will happen.

The CLI + Creating a CRON Job

The following commands are used to flush queues from the CLI:

On most occasions though, you'd trigger events in your queue with a CRON job instead of directly from code or the CLI.

Use crontab -e or sudo crontab -e to get into your CRON file and add the following line at the end to flush all queues every minute (because you never know when you've scheduled an event):

Configuration

Publish the package's configuration file with:

enabled (default true)

Simply enable or disable the package.

BOOLEAN true / false

run_only_from_cli (default true)

Allow the flushing of queues only from your command line interface (CLI).

BOOLEAN true / false

max_events_per_execution (default 50)

Maximum number of events to fire in one run (set it to a lower number if you don't want the server go slower).

INTEGER number

log_events (default false)

Whether or not to write debug messages your log.

BOOLEAN true / false

All versions of eventcron with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
illuminate/support Version ~4
nesbot/carbon Version 1.*
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 cossou/eventcron contains the following files

Loading the files please wait ....