Changeset 666 for trunk/Modules/Export/ProcessTask.php
- Timestamp:
- Dec 24, 2013, 3:04:01 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Export/ProcessTask.php
r558 r666 3 3 ini_set('memory_limit', '100M'); 4 4 5 include_once('../includes/global.php'); 6 include_once('../includes/zip.lib.php'); 5 include_once(dirname(__FILE__).'/../../includes/global.php'); 6 include_once(dirname(__FILE__).'/../../includes/zip.lib.php'); 7 7 8 include_once('Export.php'); 8 9 include_once('ExportOutput.php'); 9 10 10 11 //LoadCommandLineParameters(); 12 $System = new System(); 13 $System->DoNotShowPage = true; 14 $System->Run(); 11 15 12 16 while(1) 13 17 { 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'); 15 20 while($DbRow = $DbResult->fetch_assoc()) 16 21 { … … 55 60 } 56 61 } 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 } 57 78 sleep($Config['ExportTaskProcessPeriod']); 58 79 }
Note:
See TracChangeset
for help on using the changeset viewer.