leuchtdiode / laminas-cron

Laminas cron module
MIT License
0 stars 0 forks source link

Licence & Install instructions #1

Open ronnil1 opened 1 year ago

ronnil1 commented 1 year ago

Hi @leuchtdiode

I have two questions

  1. Under which license is this project? MIT maybe?
  2. What steps are necessary to run the project within Laminas MVC?

Regarding question 2. here some background information

If I install the module with composer require leuchtdiode/laminas-cron --with-all-dependencies and then execute the command vendor/bin/laminas-cron help I get the message

Config array key "cron" and all mandatory data (cron.enabled, cron.jobs) has to be set

If I then open the file <LAMINAS_ROOT>/config/application.config.php and add this cron array:

return [
    // ...,
    'cron' => [
        'enabled' => true,
        'jobs' => [],
    ]
];

then I still get the same message as above.

Running composer dump-autoload and php8.1 bin/clear-config-cache.php do not change anything either.

If this project is under e.g. MIT license, then I would also be very grateful to learn how to configure the module and how the "jobs" must look like. For example, can I execute controller code of other (own) modules?

Many thanks in advance and best regards!

leuchtdiode commented 1 year ago

Hi @ronnil1

I don't mind if you are using it at your own risk :) We have it up and running in a few projects and it is working well thus far.

You should put the config not into the application.config.php, but in a config in config/autoload like global.php.

But be aware that you have to have a MySQL database in combination with Doctrine as the executions are stored there. If that is OK for you, I can provide you an example how to configure particular jobs.

You cannot execute controller, but CLI commands. We are using in in combination with my console module leuchtdiode/laminas-console where we are setting up console commands and then executing them via the laminas-cron module.

BR, Alex