Welcome Guest, Not a member yet? Register   Sign In
Cronjob via HTTP
#5

A cron job can either, as you mentioned, execute a PHP script over HTTP using a URL or by the command line using a file path. If you use the latter, command line file path, the is_cli_request() will be TRUE. Any script executed by the command line is a CLI request.

CLI here does not mean it you specifically have access to the command line (SSH). It is used to let your script know if it was executed by a command line command, like cron.

It sounds like you use some type of hosting control panel like cPanel, Plesk or such. You should be just fine to use a local path to the script and then use is_cli_request() in your script to block any execution over HTTP.

Also, as a note. When executing over command line, you should set your path to
Code:
path/to/ci/index.php <controller> <function>
where <controller> = the name of your script controller, and <function> = The function in that controller.
Reply


Messages In This Thread
Cronjob via HTTP - by Urastor - 05-06-2015, 10:01 AM
RE: Cronjob via HTTP - by ivantcholakov - 05-06-2015, 11:24 AM
RE: Cronjob via HTTP - by Urastor - 05-06-2015, 11:53 AM
RE: Cronjob via HTTP - by CroNiX - 05-06-2015, 02:38 PM
RE: Cronjob via HTTP - by silentium - 05-06-2015, 02:42 PM
RE: Cronjob via HTTP - by CroNiX - 05-06-2015, 02:44 PM
RE: Cronjob via HTTP - by Urastor - 05-06-2015, 03:13 PM
RE: Cronjob via HTTP - by CroNiX - 05-06-2015, 03:31 PM
RE: Cronjob via HTTP - by Urastor - 05-06-2015, 03:51 PM
RE: Cronjob via HTTP - by Lolivaress - 05-06-2015, 07:42 PM
RE: Cronjob via HTTP - by Lolivaress - 05-07-2015, 11:05 AM
RE: Cronjob via HTTP - by Nash - 05-11-2015, 11:54 PM



Theme © iAndrew 2016 - Forum software by © MyBB