Download the PHP package 10quality/scheduler without Composer

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

Scheduler

Latest Stable Version Total Downloads License

PHP job scheduler. (Cronjob tasker)

Installing

Via composer:

Usage

Scheduler

Create a php file that will be called by cronjob, Sample, and include the following code lines:

Init scheduler with the required configuration:

NOTE: Scheduler requires a defined jobs path (where jobs are located) and the session driver/settings to use to handle intervals (the package only supports file atm).

Register your jobs and execution interval.

Start scheduler:

Then setup a cronjob task to run scheduler, as follows:

Jobs

Scheduler runs jobs written in PHP. A job is a PHP class extended from Scheduler\Base\Job class. Once a job is registered in the scheduler, it will call to the execute() function in runtime, Sample.

Create a job mimicking the following example:

For the example above, the job file must be named MyJob.php and must be stored in the jobs path.

Intervals

Execution intervals are defined when registering a job:

Available intervals:

Events

You can define callable event handlers when configuring the scheduler, like in the following example:

List of events (parameters can be used optionally):

Event key Parameters Description
on_init Triggered before session is validated.
on_start int $microtime Triggered before executing any job.
on_finish int $microtime Triggered after executing all jobs and saving session.
on_job_start string $jobName, int $microtime Triggered before executing of a job.
on_job_finish string $jobName, int $microtime Triggered after executing of job.

Handling Exceptions

Scheduler will run continuously without interruption. You can handle exceptions individually per job or globally to log them as needed.

Global Exception Handling

Add a on_exception callable handler in the scheduler's events configuration, like in the following example:

Job Exceptions

Add a exception handling callable when defining the job task, like this:

To reset the job when an exception occurs and force it to be executed on the next run, indicate it on the task:

Session

File

Indicate the folder where session file will be stored. Make sure this folder has the proper permissions.

Callable

You can create your own session driver by extending from the Session interface:

Then, when initializing the scheduler, set the driver to callable and add the callable as second parameter, like the following example:

Requirements

Coding guidelines

PSR-4.

LICENSE

The MIT License (MIT)

Copyright (c) 2016-2019 10Quality.


All versions of scheduler with dependencies

PHP Build Version
Package Version
Requires amostajo/php-json-array Version ^1.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 10quality/scheduler contains the following files

Loading the files please wait ....