From the site folder, php cms39 list shows every command and php cms39 help <command> shows the options of one.
Built-in commands
cache:clear | clear the cache (all or per tag) |
cron | scheduled tasks of every plugin |
plugins:list | plugins and whether they are active |
docs:index | the generated index of functions, hooks and tables |
i18n:scan | translation keys that are missing or unused |
Cron
One scheduled task on the server (e.g. every 5 minutes) runs all periodic tasks:
*/5 * * * * /opt/plesk/php/8.5/bin/php /var/www/vhosts/site.gr/httpdocs/cms39 cron// from a plugin
add_action('cms39_cli_cron', function () {
booking_send_reminders();
});Your own command
add_filter('cms39_cli_commands', function (array $c) {
$c['booking:reminders'] = [
'description' => 'Sends reminders for tomorrow\'s bookings',
'usage' => '[--dry-run]',
'options' => ['dry-run' => 'Show only, do not send'],
];
return $c;
});
function cms39_cli_booking_reminders(array $args): int
{
cms39_cli_line('Sending…');
return 0; // 0 = success
}Commands run as "system", without login, and log to tmp/logs/cli.log.
E-MAIL or by phone at (+30) +30.2152151245-8