Download the PHP package omnilight/yii2-scheduling without Composer

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

Schedule extension for Yii2

This extension is the port of Laravel's Schedule component (https://laravel.com/docs/master/scheduling#scheduling-artisan-commands)

Installation

The preferred way to install this extension is through composer.

Either run

or add

to the require section of your composer.json.

Description

This project is inspired by the Laravel's Schedule component and tries to bring it's simplicity to the Yii framework. Quote from Laravel's documentation:

After installation all you have to do is to put single line into crontab:

You can put your schedule into the schedule.php file, or add it withing bootstrapping of your extension or application

Schedule examples

This extension is support all features of Laravel's Schedule, except environments and maintance mode.

Scheduling Closures

Scheduling Terminal Commands

Running command of your application

Frequent Jobs

Daily Jobs

Daily Jobs At A Specific Time (24 Hour Time)

Twice Daily Jobs

Job That Runs Every Weekday

Weekly Jobs

Monthly Jobs

Job That Runs On Specific Days

Only Allow Job To Run When Callback Is True

E-mail The Output Of A Scheduled Job

Preventing Task Overlaps

Used by default yii\mutex\FileMutex or 'mutex' application component (http://www.yiiframework.com/doc-2.0/yii-mutex-mutex.html)

Running Tasks On One Server

To utilize this feature, you must config mutex in the application component, except the FileMutex: yii\mutex\MysqlMutex,yii\mutex\PgsqlMutex,yii\mutex\OracleMutex or yii\redis\Mutex. In addition, all servers must be communicating with the same central db/cache server.

Below shows the redis mutex demo:

How to use this extension in your application?

You should create the following file under @console/config/schedule.php (note: you can create file with any name and extension and anywere on your server, simpli ajust the name of the scheduleFile in the command below):

Next your should add the following command to your crontab:

That's all! Now all your cronjobs will be runned as configured in your schedule.php file.

How to use this extension in your own extension?

First of all, you should include dependency to the omnilight\yii2-scheduling into your composer.json:

Next you should create bootstrapping class for your extension, as described in the http://www.yiiframework.com/doc-2.0/guide-structure-extensions.html#bootstrapping-classes

Place into your bootstrapping method the following code:

Add to the README of your extension info for the user to register schedule component for the application and add schedule/run command to the crontab as described upper.

Using schedule component

You do not have to use schedule component directly or define it in your application if you use schedule only in your application (and do not want to give ability for extensions to register they own cron jobs). But if you what to give extensions ability to register cronjobs, you should define schedule component in the application config:

Using addition functions

If you want to use thenPing method of the Event, you should add the following string to the composer.json of your app:

Note about timezones

Please note, that this is PHP extension, so it use timezone defined in php config or in your Yii's configuration file, so set them correctly.


All versions of yii2-scheduling with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
yiisoft/yii2 Version 2.0.*
symfony/process Version 2.6.* || 3.* || 4.*
dragonmantank/cron-expression 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 omnilight/yii2-scheduling contains the following files

Loading the files please wait ....