Skip to content

Cron top-level directory with named scripts #20

@g105b

Description

@g105b

It would be nice to be able to treat cron scripts in the same way as we do Page Logic files, almost as if (or maybe completely as if) the scripts are being routed.

Inside the crontab file, we could have something like the following:

0 5 * * * /cache?type=db&mode=daily

This would be triggered at 0500 every day, and it makes sense to store this script in the cron/cache.php file.

Inside the file, it can behave completely like any other go function:

<?php
use Gt\Input\Input;

function go(Input $input, Database $db):void {
  if($input->getString("type") === "db") {
    $db->clean(); // or whatever...
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions