command line - Best practices in scheduling PHP scripts -
I need to schedule several PHP scripts for a project. Some scripts are a bit complex (i.e. send mail, database Make stuff, use many external webwares, use external files and classes etc). The problem is that these scripts need to be called from the browser, and they use some variables in the $ _ server /
array (including HTTP_HOST
).
Is there any way of doing this kind of scripts from the command line, or do I have to re-write them to make them commandline-compatible? Or is it better to use parameters than command line, which specify the variables that are not available?
We have a server running Windows Server 2008.
You should dump the part of the script that is normal in browser and command line environments. After that you can add it to two scripts, one of which will use $ _SERVER, one more command line argument variable to run the common part.
Comments
Post a Comment