38 require_once (TESTROOT .
'/testClasses/db.php');
40 define(
'SQL',
"SELECT * 42 INNER JOIN job ON jobqueue.jq_job_fk = job.job_pk 43 LEFT OUTER JOIN upload ON upload_pk = job.job_upload_fk 44 LEFT JOIN jobdepends ON jobqueue.jq_pk = jobdepends.jdep_jq_fk 45 WHERE (jobqueue.jq_starttime IS NULL OR jobqueue.jq_endtime IS 46 NULL OR jobqueue.jq_end_bits > 1) 47 ORDER BY upload_filename,upload.upload_pk,job.job_pk,jobqueue.jq_pk," .
48 "jobdepends.jdep_jq_fk;");
52 protected $jobCount=NULL;
55 function __construct() {
59 if(file_exists(
'/etc/fossology/Db.conf')) {
60 $options = file_get_contents(
'/etc/fossology/Db.conf');
62 else if (file_exists(
'/usr/local/etc/fossology/Db.conf')) {
63 $options = file_get_contents(
'/usr/local/etc/fossology/Db.conf');
68 $this->Db =
new db($options);
69 $connection = $this->Db->connect();
70 if (!(is_resource($connection))) {
71 print
"check4jobs:FATAL ERROR!, could not connect to the data-base\n";
78 public function Check() {
80 return($this->jobCount);
82 private function _ck4j() {
83 $results = $this->Db->dbQuery(
SQL);
84 $howMany = count($results);
85 $this->jobCount = $howMany;
89 public function getJobCount() {
90 return($this->jobCount);
char SQL[256]
SQL query to execute.