How can a PHP script detect if it has been invoked as a script or from the shell?
- by George Edison
I have a PHP script on a webserver.
This file is invoked via the shell by another program but it could still be run by the webserver in response to an HTTP request.
How can the script determine the way it was invoked?