Tuesday, 15 January 2013

yii extensions - How to set cron job in yii -


I am quite new yii I am working on a project

I have automatic reminders A function is written to send

This function is on the URL:

http://somedomain.com/ Index.php / somecontroller / someaction < / P>

I want to set a cron for this URL.

One method is that I should write GET cron_job_url .

But I do not want to use the URL for my cron. I want to use only physical path controller and action is it possible yii ?

If you want to use cron jobs, instead of calling the URL one Yic Suggesting to type the command is very simple and you do not have to deal with url access permissions.

Create a new class that is extracted from CConsoleCommand and either apply a run () method or some actions such as you are in the controller We do. You can find more information on the console command. You must save the command in the protected / order directory and the class name must end in command .

If your command is called , DemoCommand then you can call it / path / to / your / webroot / protected / yiic demo from a cron job. Can call as

No comments:

Post a Comment