Guest User

Untitled

a guest
Jun 18th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.31 KB | None | 0 0
  1. <?php
  2.  
  3. /**
  4. * This class has been auto-generated by the Doctrine ORM Framework
  5. */
  6. class BandminTraffic extends BaseBandminTraffic
  7. {
  8. public function processLog($logfile = null)
  9. {
  10. $status = false;
  11. if (!is_null($logfile))
  12. {
  13. if (is_readable($logfile))
  14. {
  15. $file = file($logfile);
  16. foreach ($file as $line)
  17. {
  18. $boomline = explode(' ', $line);
  19.  
  20. // set values for db
  21. $this->sethostone(trim($boomline[0]));
  22. $this->sethosttwo(trim($boomline[1]));
  23. $this->setprotocol(trim($boomline[2]));
  24. $this->setremoteport(trim($boomline[3]));
  25. $this->setlocalport(trim($boomline[4]));
  26. $this->sethostonebytesreceived(trim($boomline[6]));
  27. $this->sethosttwobytesreceived(trim($boomline[7]));
  28. $this->sethostonepacketsreceived(trim($boomline[8]));
  29. $this->sethosttwopacketsreceived(trim($boomline[9]));
  30. $this->setconnectionstart(trim($boomline[10]));
  31. $this->setconnectionend(trim($boomline[11]));
  32. $this->setsource(trim($boomline[12]));
  33. $this->setdestination(trim($boomline[13]));
  34.  
  35. // add entry to db
  36. $this->save();
  37. }
  38. $status = true;
  39. }
  40. }
  41. return $status;
  42. }
  43. }
Add Comment
Please, Sign In to add comment