Changeset 40 for www/share/update.php


Ignore:
Timestamp:
Feb 1, 2008, 7:57:51 AM (17 years ago)
Author:
george
Message:

Opraveno: Skripty ve složce share.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • www/share/update.php

    r1 r40  
    1 <?
     1<?php
    22include('../style.php');
    3 include('../db.php');
    4 DB_Init('localhost','root','','is');
    53
    6 //$Perioda = 3600*3;    // procházet po tøech hodinách
     4//$Perioda = 3600*3;    // prochazet po tech hodinach
    75
    86$Dnes = date('Y-m-d');
     
    119  $Hosts = array();
    1210  $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())
    1513  {
    1614    //echo('Host: '.$Host."...\n");
     
    2422      passthru('env browse_host='.$Row['name'].' browse_id='.$HostID.' php -q -c php.ini -f browse.php');
    2523    }
    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));
    3127  }
    3228  $Rozdil = GetMicrotime()-$StartTime+10;
    3329 
    34   // Oprav a zoptimaizuj tabulku
    35   DB_Init('localhost', 'root', '', 'share');
     30  // Oprav a zoptimalizuj tabulku
     31  $Database->select_db('share');
    3632  echo('Opravuji tabulku...');
    37   DB_Query('REPAIR TABLE items');
     33  $Database->query('REPAIR TABLE items');
    3834  echo("\nOptimalizuji tabulku...");
    39   DB_Query('OPTIMIZE TABLE items');
     35  $Database->query('OPTIMIZE TABLE items');
    4036 
    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");
    4238  //$Cekat = $Perioda-$Rozdil;
    4339  //echo("Cekam ".date("H:i:s",$Cekat-3600)." minut...\n");
Note: See TracChangeset for help on using the changeset viewer.