
 John Haywood - 2014-01-07 13:04:10
First off, great Class, thank you! I'm integrating it into a CMS to help detect unauthorised file changes.
I notice in public function scan() you have this code;
$query = "SELECT MAX(scan_id ) as lastscan FROM `".$this->config['dbtable']."_scan`";
        $data = $this->query($query, __LINE__);
        $lastscan = $data['0']['lastscan'];
        $query = "INSERT INTO `".$this->config['dbtable']."_scan` VALUES (NULL, NULL)";
        $scan = $this->query($query, __LINE__);
        $query = "SELECT MAX(scan_id ) as lastscan FROM `".$this->config['dbtable']."_scan`";
        $data = $this->query($query, __LINE__);
        $currentscan = $data['0']['lastscan'];
I can see you are inserting a NULL row to increment the table fileds scan_id and scantime but as scan_id is an autonumber field, I'm not sure the second SQL call to assign $currentscan is even needed since you could probably just do;
//$query = "SELECT MAX(scan_id ) as lastscan FROM `" . //$this->dbconfig['dbtable'] . "_scan`";
//		$data = $this->query($query, __LINE__);
//		$currentscan = $data['0']['lastscan']; // int
$currentscan = (int) $lastscan +1;