Download the PHP package linkrobins/metronome without Composer

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

Link Robins Metronome

Latest Version Downloads License Backend

Keeps Flarum's scheduled tasks ticking on shared hosting. Many shared hosts disable PHP's proc_open function, and Flarum's scheduler depends on it: every scheduled task is launched as a separate process. Metronome adds a schedule:run-inline command that runs the exact same schedule inside the one PHP process your cron job already starts, so nothing needs proc_open at all.

The problem it solves

On hosting with proc_open disabled, php flarum schedule:run looks fine: it exits cleanly, and the admin dashboard even reports the scheduler as active. But no scheduled task ever actually runs. The only trace is a line buried in the log for every task, every minute:

So extensions that clean up, sync, or aggregate on a schedule quietly do nothing, and it looks like their bug.

Install

Enable Link Robins Metronome in the admin panel, then replace your existing scheduler cron line (or your host's "cron jobs" panel entry, which is exactly the environment this is for) with the new command, once per minute:

Replace, do not add. If schedule:run and schedule:run-inline both stay in cron, every scheduled task runs twice per minute, and withoutOverlapping() will not prevent that (it only stops overlapping runs, not two quick runs in a row). Metronome detects this and warns in its output and the Flarum log, but the fix is removing the old line. If you never had a scheduler cron line (which is likely why you are here), there is nothing to remove.

That is the whole setup. There are no settings.

What it runs, and how faithfully

schedule:run-inline walks the same schedule as schedule:run and keeps the same behaviour wherever that is possible without launching processes:

Two things cannot be identical without proc_open, and the command is upfront about both instead of skipping work silently:

One more behavioral difference, unrelated to proc_open: tasks scheduled at sub-minute rates (everyFifteenSeconds() and friends) fire once per invocation instead of repeating until the end of the minute the way the stock runner does. Since cron itself runs once per minute, that means once per minute. Nothing in the Flarum ecosystem schedules sub-minute today, but if your task does, know that it will tick at cron's pace.

If your hosting does have proc_open, keep using the stock schedule:run. This extension is for the hosts where that is not an option.

Flarum compatibility

Flarum 2.0 only. There is no build for Flarum 1.8.

Support

Found a bug or need help? Open an issue.


All versions of metronome with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
flarum/core Version ^2.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 linkrobins/metronome contains the following files

Loading the files please wait ...