Bug fix for #26

Make sure debug log does not output integers, but only mysqli_result object in db_helper
Couple other fixes
This commit is contained in:
2018-09-26 10:39:38 -04:00
parent 881bf29ee5
commit dde7409f01
5 changed files with 116 additions and 92 deletions

View File

@ -104,7 +104,7 @@ class scan
/**
* Enum defining the type of script
*
* @var file_types
* @var string
*/
protected $type = null;
@ -419,7 +419,7 @@ class scan
/**
* Getter function for the scan type
*
* @return file_types
* @return string
*/
public function get_Type()
{
@ -429,7 +429,7 @@ class scan
/**
* Setter function for the scan type
*
* @param file_types $type_in
* @param string $type_in
*/
public function set_Type($type_in)
{
@ -512,6 +512,30 @@ class scan
$this->status = $status_in;
}
/**
* Method to check if the scan has been terminated by the user
*/
public function isTerminated()
{
global $db, $log;
$db->help->select("scans", ['status'], [
[
'field' => 'id',
'op' => '=',
'value' => $this->id
]
]);
$thread_status = $db->help->execute();
$this->status = $thread_status['status'];
if ($this->status == TERMINIATED) {
rename(realpath(TMP . "/{$this->file_name}"), TMP . "/terminated/{$this->file_name}");
$log->notice("File parsing terminated by user");
die();
}
}
/**
* Getter function for the percentage the script has completed
*