Download the PHP package stevad/yii-cron-tasks without Composer

On this page you can find all versions of the php package stevad/yii-cron-tasks. 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 yii-cron-tasks

yii-cron-tasks

Simple extension to create and execute scheduled console commands in Yii Framework 1.x application.

It allows to create tasks with powerful cron syntax. Each task can be unique to disallow overlapping (with logging warning message if this happens). Also you can set output file for each task and get information about last start and stop time and current status of execution (with PID).

For license information check the LICENSE file.

Tested on Yii Framework v1.1.16+.

Installation

This extension is available at packagist.org and can be installed via composer by following command:

composer require --dev stevad/yii-cron-tasks.

If you want to install this extension manually - copy sources to /protected/extensions directory.

Example of default configuration (with using of ext.yii-cron-tasks alias, meaning that extension files are located here: /protected/extensions/yii-cron-tasks):

For component option tasksCallback you must specify valid PHP callback. First argument can be an array with object definition to create instance by Yii::createComponent() method.

In configuration example it was mentioned callback with Yii class definition application.models.AppCronTasks and getList action. Here is the example of class content with cron tasks definitions:

File: protected/models/AppCronTasks.php

In this class we have method witch returns two configured console tasks. To run them we need to make last step: manually add special console command to the server's crontab:

* * * * * php /path/to/yiic cron daemon >> /dev/null 2>&1

And now server will run our own cron daemon console command each minute and check if some of the specified tasks need to be executed.

CronTask class

By default each task instance is pre-configured to be executed each minute (cron schedule: * * * * *). To create own task you need to create CronTask instance and pass command, action names and optional params for it.

Command is the name of the available application console command. Action name can be omitted (will run default action: index or another by configuration options).

Params are represented as the key-valued list where key is the name of param (without -- at the beginning).

Available methods in CronTask class:

Methods to control schedule:

Each method support all features of cron syntax. Check this site for more information: crontab.guru

Also there is available some predefined "macro" methods:

You can combine methods in any way. For example, to set task to be executed at 18:00 every day you can use next code:

Author

Copyright (c) 2017 by Stevad.


All versions of yii-cron-tasks with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
yiisoft/yii Version >=1.1.16
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 stevad/yii-cron-tasks contains the following files

Loading the files please wait ....