$checker = new ParanoidProxyCheckerImpl(); $framework = new ProxyFramework("framework.db", $checker, 7200, 5400, 1, 30, 20, PIDFILE); $atom = new AtomintersoftModule(); $samair = new SamairModule(); $freechecker = new FreeCheckerModule(); $nntime = new NNTimeModule(); $framework->addModule($atom); // since samair.ru is down most of the time, perform this check before adding the samair module to PF print "Checking Samair\n"; fw('samair.ru', 80, '-A'); $test = shell_exec('curl -f samair.ru -m 20 --connect-timeout 20'); //fw('samair.ru', 80, '-D'); if (trim($test) != '' && strpos($test, "connect() timed out") === false) { $framework->addModule($samair); } $framework->addModule($freechecker); print "Checking NNTime\n"; fw('nntime.com', 80, '-A'); $test = shell_exec('curl -f nntime.com -m 20 --connect-timeout 20'); //fw('nntime.com', 80, '-D'); if (trim($test) != '' && strpos($test, "connect() timed out") === false) { $framework->addModule($nntime); } print "Starting.\n"; $framework->start(); $framework->stop(); } } } catch (Exception $e) { Helper::logCritical("Exception occurred: " . $e); }