Changeset 40 for www/share/update.php
- Timestamp:
- Feb 1, 2008, 7:57:51 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
www/share/update.php
r1 r40 1 <? 1 <?php 2 2 include('../style.php'); 3 include('../db.php');4 DB_Init('localhost','root','','is');5 3 6 //$Perioda = 3600*3; // proch ázet po tøech hodinách4 //$Perioda = 3600*3; // prochazet po tech hodinach 7 5 8 6 $Dnes = date('Y-m-d'); … … 11 9 $Hosts = array(); 12 10 $StartTime = GetMicrotime(); 13 DB_Query("SELECT * FROM hosts WHERE online=1 AND (block=0 OR name='centrala') AND (name!='GATE') AND user>0");14 while($Row = DB_Row())11 $DbResult = $Database->query("SELECT * FROM hosts WHERE online=1 AND (block=0 OR name='centrala') AND (name!='GATE') AND user>0"); 12 while($Row = $DbResult->fetch_array()) 15 13 { 16 14 //echo('Host: '.$Host."...\n"); … … 24 22 passthru('env browse_host='.$Row['name'].' browse_id='.$HostID.' php -q -c php.ini -f browse.php'); 25 23 } 26 else echo("Vynechávám ".$Row['name']."...\n"); 27 // Aktualizuj datum procházení 28 DB_Save(); 29 DB_Update('hosts',"name='".$Row['name']."'",array('last_share_check' => $Dnes)); 30 DB_Load(); 24 else echo("Vynechavam ".$Row['name']."...\n"); 25 // Aktualizuj datum prochazeni 26 $Database->update('hosts',"name='".$Row['name']."'",array('last_share_check' => $Dnes)); 31 27 } 32 28 $Rozdil = GetMicrotime()-$StartTime+10; 33 29 34 // Oprav a zoptima izuj tabulku35 DB_Init('localhost', 'root', '','share');30 // Oprav a zoptimalizuj tabulku 31 $Database->select_db('share'); 36 32 echo('Opravuji tabulku...'); 37 DB_Query('REPAIR TABLE items');33 $Database->query('REPAIR TABLE items'); 38 34 echo("\nOptimalizuji tabulku..."); 39 DB_Query('OPTIMIZE TABLE items');35 $Database->query('OPTIMIZE TABLE items'); 40 36 41 echo("\nDoba prochá zení:".date("H:i:s",$Rozdil-3600)."\n\n");37 echo("\nDoba procháení ".date("H:i:s",$Rozdil-3600)."\n\n"); 42 38 //$Cekat = $Perioda-$Rozdil; 43 39 //echo("Cekam ".date("H:i:s",$Cekat-3600)." minut...\n");
Note:
See TracChangeset
for help on using the changeset viewer.