Changeset 522 for trunk/Modules/NetworkConfig/Generate.php
- Timestamp:
- Apr 15, 2013, 11:08:49 PM (12 years ago)
- Location:
- trunk/Modules/NetworkConfig
- Files:
-
- 1 added
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/NetworkConfig/Generate.php
r521 r522 2 2 3 3 if(isset($_SERVER['REMOTE_ADDR'])) die(); 4 include('../../Common/Global.php'); 5 $Database = &$System->Database; 4 include_once(dirname(__FILE__).'/../../Common/Global.php'); 6 5 7 6 $Now = time(); 8 $DbResult = $ Database->select('NetworkConfiguration', '*, UNIX_TIMESTAMP(LastTime)', '(Changed = 1) AND (Enabled = 1)');7 $DbResult = $System->Database->select('NetworkConfiguration', '*, UNIX_TIMESTAMP(LastTime)', '(Changed = 1) AND (Enabled = 1)'); 9 8 while($Service = $DbResult->fetch_assoc()) 10 9 { 11 10 if($Service['UNIX_TIMESTAMP(LastTime)'] < (time() - $Service['Period'])) 12 11 { 13 $ Database->update('NetworkConfiguration', 'Id='.$Service['Id'], array('Changed' => 2));12 $System->Database->update('NetworkConfiguration', 'Id='.$Service['Id'], array('Changed' => 2)); 14 13 $ExecutionStart = time(); 15 14 //echo($Service['Caption'].'...'); … … 25 24 //echo("Done\n"); 26 25 $ExecutionTime = time() - $ExecutionStart; 27 $ Database->update('NetworkConfiguration', 'Id='.$Service['Id'], array('Changed' => 0, 'LastTime' => 'NOW()', 'ExecutionTime' => $ExecutionTime));28 $ Database->update('NetworkConfiguration', 'Id='.$Service['Id'], array('Log' => implode("\n", $Output)));26 $System->Database->update('NetworkConfiguration', 'Id='.$Service['Id'], array('Changed' => 0, 'LastTime' => 'NOW()', 'ExecutionTime' => $ExecutionTime)); 27 $System->Database->update('NetworkConfiguration', 'Id='.$Service['Id'], array('Log' => implode("\n", $Output))); 29 28 } 30 29 }
Note:
See TracChangeset
for help on using the changeset viewer.