Example #1
0
<?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 . 'webvars/webvars.class.php';
$webvars = new webvars();
$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);
        // check all web vars
        $webvars->checkAllVars();
    }
    if (file_exists('./reboot') || isset($_GET['onetime'])) {
        $db->Disconnect();
        exit;
    }
    sleep(1);
}
DebMes("Unexpected close of cycle: " . basename(__FILE__));
Example #2
0
 $long_delay_limit=1*60; //1 minute delay (sleeped ?)
 $tm=getObject("ThisComputer")->getProperty("checked"); // should be taken from database instead
 if (!$tm) {
  $tm=time();
 }
 $start_time=time();

 include_once(DIR_MODULES.'rss_channels/rss_channels.class.php');
 $rss_ch=new rss_channels();

 include_once(DIR_MODULES.'pinghosts/pinghosts.class.php');
 $pinghosts=new pinghosts();

 include_once(DIR_MODULES.'webvars/webvars.class.php');
 $webvars=new webvars();


 include_once(DIR_MODULES.'watchfolders/watchfolders.class.php');
 $watchfolders=new watchfolders();

 if (defined('ONEWIRE_SERVER')) {
  include_once(DIR_MODULES.'onewire/onewire.class.php');
  $onw=new onewire();
 }



 while (1) {
  if ((time()-$tm)>$long_delay_limit) {
   // where am I ?