Passing in URL as parameter in CLI - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Development (https://forum.codeigniter.com/forumdisplay.php?fid=6) +--- Forum: CodeIgniter 3.x (https://forum.codeigniter.com/forumdisplay.php?fid=17) +--- Thread: Passing in URL as parameter in CLI (/showthread.php?tid=61266) |
Passing in URL as parameter in CLI - albertleao - 04-05-2015 Hello. I'm using CI 3.0 as a backend only system to handle some tasks. I'd like to run a few controllers with the CLI via cronjobs but I'm having an issue passing in a URL as a parameter. So my controller function looks something like this: PHP Code: runProcess($url) { Any ideas on how to pass in a full URL? RE: Passing in URL as parameter in CLI - gadelat - 04-06-2015 That's because CodeIgniter in CLI mode also allows slashes as parameters separator. Use url encoding/decoding RE: Passing in URL as parameter in CLI - albertleao - 04-07-2015 (04-06-2015, 12:26 AM)gadelat Wrote: That's because CodeIgniter in CLI mode also allows slashes as parameters separator. Use url encoding/decoding Perfect. I must have missed where it said that in the docs. Have it working perfectly now. RE: Passing in URL as parameter in CLI - Wouter60 - 07-21-2015 I'm having trouble executing cronjobs even with a very basic setup of controller and method. Like this: Code: /bin/php ./index.php cronjobs cleanup Code: /bin/php ./cronjobs/cleanup.php Would it do any good if I formatted my CI cronjob like this: Code: /bin/php ./index.php/cronjobs/cleanup |