How to create method which be executed by cron (Yii) -
I'm completely lost I followed many tutorials about Cron and Y but all failed (,).
In addition, this project is not mine and the protected folder is not present.
I want to execute one in my DB, after control, update every 10 minutes .
I already know how to make a cron, but ... in fact it does not know how to deal with this.
I need the connection to the DB and access to the model ..
Thank you for your help
Renewed:
Thanks for the @ crafter response I am able to execute 'Yiic AutoCron but I get an error:
"PHP error [2]: Include (User. Php): Failed to open the stream: No such file or directory "
I can not use config / console.php because the project's standard architecture Does not respect.
How can I import all the models to avoid this error?
I have the same problem as this post !!
I also have a cronconfig.php (in which I import the model) No response yet.
Refer to WIKI Post
> Class TestComConsoleCommand Extended {Public Function Run ($ ARG) {// You can use your Yii Library here, for example $ userModel = User :: model () - & gt; FindByPK (1); $ UserModel- & gt; Active = 'n'; $ UserModel- & gt; Save (); }}
You can run using yiic tools, for example protected / command / myCronJobCommand.php file.
$ cd $ protected ./yiic myCronJob
Comments
Post a Comment