added command line check

If php-spider is not envoked from the command line, then the script will fail due to pcntl_signal not being available. I've simply wrapped that part in a conditional check to make sure we're using the command line.