starterlog.php 944 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. require_once(dirname(__FILE__).'/models/Logfile.php');
  3. require_once(dirname(__FILE__).'/mail.php');
  4. if (count($argv) < 1) {
  5. die("Aufruf: php statusbericht.php [csv] [controlling@autohaus.de]\r\n");
  6. }
  7. $config = parse_ini_file(dirname(__FILE__) . "/../../GAPS.ini");
  8. $protPath = $config['STARTER'] . "\\logs";
  9. $dirMatch = (count($argv) > 1) ? $argv[1] : "csv";
  10. if (count($argv) > 2) {
  11. $config['STATUSBERICHT'] = $argv[2];
  12. }
  13. $logs = checkStarterLogs($protPath, $dirMatch);
  14. if (count($logs) > 0) {
  15. sendUpdateMail($logs);
  16. $doc = @simplexml_load_file(dirname(__FILE__)."/../../logs/gcstarter.info.log");
  17. if ($doc && isset($doc->Status)) {
  18. foreach ($doc->Status->Meldung as $message) {
  19. echo $message->Text . "\r\n";
  20. }
  21. } else {
  22. echo " Kontenrahmen auf dem aktuellen Stand.\r\n";
  23. }
  24. $starter = checkStarter($config['STARTER']);
  25. file_put_contents(dirname(__FILE__)."/../../logs/gcstarter.json", json_encode($starter));
  26. }
  27. ?>