getObject($objects[$i]['TITLE'])->raiseEvent("onNewHour"); } } if ($dt!=$old_date) { echo "new day\n"; $old_date=$dt; } //updating RSS channels $to_update=SQLSelect("SELECT ID, TITLE FROM rss_channels WHERE NEXT_UPDATE<=NOW() LIMIT 1"); $total=count($to_update); for($i=0;$i<$total;$i++) { $rss_ch->updateChannel($to_update[$i]['ID']); } $pinghosts->checkAllHosts(1); // checking all hosts $webvars->checkAllVars(); // check all web vars $watchfolders->checkAllFolders(); // checking all watching folders if (defined('ONEWIRE_SERVER')) { $onw->updateStarred(); // check starred 1wire properties $onw->updateDevices(); // check all 1wire devices } if (file_exists('./reboot') || ((time()-$start_time)>7*24*60*60)) { $db->Disconnect(); @unlink('./reboot'); sleep(5);
<?php chdir(dirname(__FILE__) . '/../'); include_once "./config.php"; include_once "./lib/loader.php"; include_once "./lib/threads.php"; set_time_limit(0); // connecting to database $db = new mysql(DB_HOST, '', DB_USER, DB_PASSWORD, DB_NAME); include_once "./load_settings.php"; include_once DIR_MODULES . "control_modules/control_modules.class.php"; $ctl = new control_modules(); include_once DIR_MODULES . 'pinghosts/pinghosts.class.php'; $pinghosts = new pinghosts(); $checked_time = 0; echo date("H:i:s") . " running " . basename(__FILE__) . PHP_EOL; while (1) { if (time() - $checked_time > 10) { $checked_time = time(); setGlobal(str_replace('.php', '', basename(__FILE__)) . 'Run', time(), 1); // checking all hosts $pinghosts->checkAllHosts(1); } if (file_exists('./reboot') || $_GET['onetime']) { $db->Disconnect(); exit; } sleep(1); } DebMes("Unexpected close of cycle: " . basename(__FILE__));