How to run a CodeIgniter file through CRON?

后端 未结 6 1528
旧时难觅i
旧时难觅i 2021-01-31 00:16

I\'ve tried the following method in the past:



        
6条回答
  •  隐瞒了意图╮
    2021-01-31 00:52

    There is a wiki article about how to run CodeIgniter on the command line, but this is more useful for applications that need to interact with the user through terminal (there's a library for that too).

    http://codeigniter.com/wiki/CI_on_the_command_line/

    One benefit of doing it this way over using wget is you can protect your code from being run by users or bots with:

    if(!empty($_SERVER['HTTP_HOST']))
    {
         show_error('Shove off hax0r!');
    }
    

提交回复
热议问题