Ignore:
Timestamp:
Dec 24, 2013, 3:04:01 PM (11 years ago)
Author:
maron
Message:
  • Fixed: dbc export task
  • Added: EXE file task
  • Moved: Instalace_CzechWoW.nsi
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/Export/ProcessTask.php

    r558 r666  
    33ini_set('memory_limit', '100M');
    44
    5 include_once('../includes/global.php');
    6 include_once('../includes/zip.lib.php');
     5include_once(dirname(__FILE__).'/../../includes/global.php');
     6include_once(dirname(__FILE__).'/../../includes/zip.lib.php');
     7
    78include_once('Export.php');   
    89include_once('ExportOutput.php');   
    910
    1011//LoadCommandLineParameters();
     12  $System = new System();
     13  $System->DoNotShowPage = true;
     14        $System->Run();
    1115
    1216while(1)
    1317{
    14   $DbResult = $System->Database->query('SELECT `ExportTask`.`Export`, `Export`.`Id` AS `ExportId` FROM `ExportTask` LEFT JOIN `Export` ON `Export`.`Id` = `ExportTask`.`Export` WHERE `ExportTask`.`TimeFinish` IS NULL');
     18  //DBC files
     19  $DbResult = $System->Database->query('SELECT `ExportTask`.`Export`, `Export`.`Id` AS `ExportId` FROM `ExportTask` LEFT JOIN `Export` ON `Export`.`Id` = `ExportTask`.`Export` WHERE `Export`.`OutputType` = 9 AND `ExportTask`.`TimeFinish` IS NULL');
    1520  while($DbRow = $DbResult->fetch_assoc())
    1621  {
     
    5560    }
    5661  }
     62
     63  //EXE files
     64  $DbResult = $System->Database->query('SELECT `ExportTask`.`Export`, `Export`.`Id` AS `ExportId` FROM `ExportTask` LEFT JOIN `Export` ON `Export`.`Id` = `ExportTask`.`Export` WHERE `Export`.`OutputType` = 10 AND `ExportTask`.`TimeFinish` IS NULL');
     65  while($DbRow = $DbResult->fetch_assoc())
     66  {
     67    echo(StrFTime("%d/%m/%Y %H:%M:%S", time()).': Generování EXE souboru pro export '.$DbRow['ExportId'].'.. '."\n");
     68    if($DbRow['ExportId'] != '')
     69    {     
     70      echo shell_exec('"'.dirname(__FILE__).'./client_cz_export.sh" '.$DbRow['ExportId'].'');
     71      $System->Database->query('UPDATE `ExportTask` SET `TimeFinish`=NOW() WHERE `Export`='.$DbRow['Export']);
     72    } else
     73    {
     74      $System->Database->query('DELETE FROM `ExportTask` WHERE `Export`='.$DbRow['Export']);
     75      echo('Export '.$DbRow['Export'].' nenalezen. Jeho úloha smazána.'."\n");
     76    }
     77  }
    5778  sleep($Config['ExportTaskProcessPeriod']);
    5879}
Note: See TracChangeset for help on using the changeset viewer.