Keeps Flarum's scheduled tasks running on shared hosting where PHP's proc_open function is disabled.
The problem
Many shared hosts disable proc_open, and Flarum's scheduler depends on it: every scheduled task is launched as a separate process. On those hosts php flarum schedule:run looks fine. It exits cleanly, and the admin dashboard even reports the scheduler as active. But no task ever actually runs. The only trace is a line buried in the log for every task, every minute:
The Process class relies on proc_open, which is not available on your PHP installation.
So extensions that clean up, sync, or aggregate on a schedule quietly do nothing, and it looks like their bug.
What it does
Adds a schedule:run-inline command that walks the exact same schedule as schedule:run, but runs each due task inside the one PHP process your cron job already starts. Nothing needs proc_open at all.
- Due-time, environment and maintenance-mode checks work as before.
withoutOverlapping() locks are honored, and are compatible both ways with locks taken by the stock runner.
onOneServer() is honored.
- Before/after hooks, success/failure hooks and
sendOutputTo() / appendOutputTo() output capture all work.
- Closure-based tasks run through Flarum's own machinery untouched.
- Failures are reported to the Flarum log, and the admin dashboard's scheduler status is updated the same way the stock runner updates it.
Two things cannot be identical without proc_open, and the command is upfront about both instead of skipping work silently: a task that asks for runInBackground() runs in the foreground instead (with a warning, and it still runs), and a task scheduled as a raw shell command via exec() cannot run at all, so it is reported as a failed task rather than ignored.
If your hosting does have proc_open, keep using the stock schedule:run. This is for the hosts where that is not an option.
Requirements
There is no build for Flarum 1.8.
Installation
composer require linkrobins/metronome
Then enable the extension in admin → Extensions, and point your cron job (or your host's "cron jobs" panel) at the new command once per minute:
* * * * * php /path/to/flarum/flarum schedule:run-inline
That is the whole setup. There are no settings.
License
MIT.