Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * This class has been auto-generated by the Doctrine ORM Framework
- */
- class BandminTraffic extends BaseBandminTraffic
- {
- public function processLog($logfile = null)
- {
- $status = false;
- if (!is_null($logfile))
- {
- if (is_readable($logfile))
- {
- $file = file($logfile);
- foreach ($file as $line)
- {
- $boomline = explode(' ', $line);
- // set values for db
- $this->sethostone(trim($boomline[0]));
- $this->sethosttwo(trim($boomline[1]));
- $this->setprotocol(trim($boomline[2]));
- $this->setremoteport(trim($boomline[3]));
- $this->setlocalport(trim($boomline[4]));
- $this->sethostonebytesreceived(trim($boomline[6]));
- $this->sethosttwobytesreceived(trim($boomline[7]));
- $this->sethostonepacketsreceived(trim($boomline[8]));
- $this->sethosttwopacketsreceived(trim($boomline[9]));
- $this->setconnectionstart(trim($boomline[10]));
- $this->setconnectionend(trim($boomline[11]));
- $this->setsource(trim($boomline[12]));
- $this->setdestination(trim($boomline[13]));
- // add entry to db
- $this->save();
- }
- $status = true;
- }
- }
- return $status;
- }
- }
Add Comment
Please, Sign In to add comment