Download the PHP package sw2eu/cron-command without Composer

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

CronCommand - automatized cron tasks

If you are familiar with Nette Framework and Symfony Console (especially implementation by Kdyby), you probably had idea to used it for cron operations. This tool will help you with maintenance of cron tasks.

Requirements

This library requires PHP 5.5 or higher. CronCommand library is designed for Nette Framework; however, it can be also used with other frameworks or pure PHP.

Installation

The best way to install this library is using Composer:

Documentation

Firstly, register extension Sw2\CronCommand\Bridges\Nette\DI\CronCommandExtension. For more information about configuration see the class definition. Some features would not work in version 0.8.x (simply - they are not yet been implemented), so please be patient and stay tuned.

Now define your first task. Here is full source code of my AwesomeTask:

Annotation @cron use the same syntax as you know from crontab. For the parsing of the cron expression is used library mtdowling/cron-expression where you can find more information about syntax. Syntax with @ is not yet supported (maybe in the future).

So now register your task to the cron runner:

This way you can create service and register it right to the runner. Tasks in CronCommandExtension works in the same way like services in Nette Framework. You can define just class name, or define the whole service with arguments, setup, etc. The other way how to register your task is much more automatic: Just create service and tag it with defined tag (default tag is sw2.cron.task but can be also configured) like this:

You need not define kdyby.console.command, it will be added automatically. So this mean, that every cron task is automatically also console command -- can be started manually if needed.

Now you can run your first cron task using console command cron:runner.

This library implements locking system. Every task can run only once at a time. If the task is running, you cannot start it manually and vice versa.

Advanced documentation will be added in the future. But if you look on my source codes, you will understand what you can do with this small (but powerful) library.


All versions of cron-command with dependencies

PHP Build Version
Package Version
Requires nette/di Version ~2.4
nette/reflection Version ~2.4
nette/safe-stream Version ~2.3
nette/utils Version ~2.4
kdyby/console Version ~2.6
mtdowling/cron-expression Version ~1.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 sw2eu/cron-command contains the following files

Loading the files please wait ....