#!/usr/local/bin/php5 -f checkRun() ){ exit($sigHandler->getExitCode()); } do{ if ( !getDB('slave')->Ping() || !getDB('master')->Ping() ){ writeError('[ERROR] Could not ping DB server(s)!'); exit(1); } foreach( array_keys($enquire) as $sku ){ if ( pcntl_fork() > 0 ){ continue; } else { posix_setsid(); if ( pcntl_fork() ){ exit(0); } processInventoryEnquire($sku, $enquire); exit(0); } } sleep(MAX_CHILDREN_LIMIT/2); } while ($sigHandler->checkRun()); exit($sigHandler->getExitCode()); ?>