Download the PHP package mluex/endless-cron-command without Composer

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

Endless Cron Commands for Symfony

This package is a small extension of wrep/daemonizable-command. If no Upstart or systemd are available to set up a daemon, a simple cronjob and Symfony Lock are sufficient to produce an almost similar result.

Detailed information on Daemonizable / Endless Commands

Check out the documentation of wrep/daemonizable-command for more information on how to create endless commands: wrep/daemonizable-command

Installation

composer require mluex/endless-cron-command

Which version to use?

Usage

1. Configuration

EndlessCronCommands require symfony/lock to ensure that only one instance is executed at a time. Please configure the bundle accordingly in your .env.local, e.g.

⚠️ Make sure to use a lock store that supports expiry! Check the Symfony Lock documentation for more information.

2. Implementation

Create a Symfony command that extends EndlessCronCommand and off you go. Here is a minimal example:

If your command includes Monolog's FingersCrossed Log Handlers, you may want to clear them after every iteration as wrep pointed out in his documentation. EndlessCronCommand provides a method for this:

3. Cronjob setup

Add a cronjob to your crontab to run the command every minute.

4. Advanced usage

It may make sense to limit the runtime of an instance and restart the command regularly. Use the runtime option for this:

In order to run the command's execute() method more often in the main loop (default is 5 sec), you can use the frequency option to set a lower timeout between iterations (1 sec in this example):

Every iteration will refresh the lock and push its expiry time further into the future. If the command crashes, the lock will expire after the lock-ttl time and the next cronjob will start a new instance. You can set the lock-ttl to a lower value to ensure that the command is restarted more quickly after a crash:

TODO


All versions of endless-cron-command with dependencies

PHP Build Version
Package Version
Requires symfony/lock Version ^7.0
wrep/daemonizable-command Version ^5.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 mluex/endless-cron-command contains the following files

Loading the files please wait ...