![]() |
CodeIgniter Tasks - Register Task from Module - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28) +--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30) +--- Thread: CodeIgniter Tasks - Register Task from Module (/showthread.php?tid=90866) |
CodeIgniter Tasks - Register Task from Module - ltarrant - 05-15-2024 Hi, Is it possible to add a scheduled task from a Module. I looked at the Modules Config Registrar class but this seems to only allow returning arrays of values. Any guidance would be appreciated. Thanks, Luke RE: CodeIgniter Tasks - Register Task from Module - kenjis - 05-15-2024 Why don't you use "app/Config/Tasks.php"? RE: CodeIgniter Tasks - Register Task from Module - ltarrant - 05-15-2024 I am attempting to move everything inside the module before I make it into a composer package to make it easier to roll out updates across multiple sites. RE: CodeIgniter Tasks - Register Task from Module - kenjis - 05-15-2024 Maybe if "Config/Tasks.php" is only in one module, it will be used. However, if "Config/Tasks.php" is in more than one module, only one of them will be loaded. If there is "app/Config/Tasks.php", only that will always be loaded. RE: CodeIgniter Tasks - Register Task from Module - ltarrant - 05-16-2024 So simple! Moved App/Config/Tasks.php to my Module Config folder and it works. I did try sticking a copy in the Module Config directory before but had not removed the copy in the App Config folder. As you suggested the trick must be just having one Task.php config file. |