title: Can PHP detect if its run from a cron job or from the command line?
body: <p>I'm looking for way to PHP to detect if a script was run from a manual invocation on a shell (me logging in and running it), or if it was run from the crontab entry.</p>
  
  <p>I have various maintenance type scripts written in php that i have set to run in my crontab. Occasionally, and I need to run them manually ahead of schedule or if something failed/broken, i need to run them a couple times.</p>
  
  <p>The problem with this is that I also have some external notifications set into the tasks (posting to twitter, sending an email, etc) that I DONT want to happen everytime I run the script manually.</p>
  
  <p>I'm using php5 (if it matters), its a fairly standard linux server environment.</p>
  
  <p>Any ideas?</p>