Hackzilla.org

May 15, 2007

PHP: One Instance

Filed under: Languages, PHP, Software — Dan @ 11:30 pm

Suppose you have a script in PHP that you only ever want to only ever run one instance of.

For example:

  • Maintenance script (repair,optimise)
  • Update script (crawler)
  • Server

These types of scripts need only to be launched once, and more could be counter productive or even dangerous.

The simplest way to stop multiple instances is to check to see if the last running script is still running.

(more...)

Powered by WordPress

Ofdan Statistics Technology Blogs - Blog Top Sites