问题
I'm following this tutorial (http://amitdhamu.com/blog/automating-php-using-task-scheduler/) to schedule a task in PHP Codeignitre, however in step 1 of the mentioned tutorial I dont know how I can pass the controller method instead of a whole php file?! Could you please help me in this regard?
Also I need to provide the option of scheduling for the admin of my web application as well in a way that they can change the scheduleer; is there any way that I can pass the task manager options with PHP?
Please if my question is not clear, please let me know which part you need more clarification
PS: I have a windows server!
Thanks
回答1:
If you want to execute CodeIgniter code from schedule, replace the call, in .bat:
from:
php C:\Apache\htdocs\automatic.php
to:
php C:\Apache\htdocs\index.php myController <myMethod> <arg1> <arg2>
sample:
php C:\Apache\htdocs\index.php users update
来源:https://stackoverflow.com/questions/19479494/scheduling-a-controller-method-by-windows-task-scheduller