27 require_once (TESTROOT .
'/testClasses/db.php');
29 define(
'SQL',
"SELECT *
31 INNER JOIN job ON jobqueue.jq_job_fk = job.job_pk
32 LEFT OUTER JOIN upload ON upload_pk = job.job_upload_fk
33 LEFT JOIN jobdepends ON jobqueue.jq_pk = jobdepends.jdep_jq_fk
34 WHERE (jobqueue.jq_starttime IS NULL OR jobqueue.jq_endtime IS
35 NULL OR jobqueue.jq_end_bits > 1)
36 ORDER BY upload_filename,upload.upload_pk,job.job_pk,jobqueue.jq_pk," .
37 "jobdepends.jdep_jq_fk;");
41 protected $jobCount=NULL;
44 function __construct() {
48 if(file_exists(
'/etc/fossology/Db.conf')) {
49 $options = file_get_contents(
'/etc/fossology/Db.conf');
51 else if (file_exists(
'/usr/local/etc/fossology/Db.conf')) {
52 $options = file_get_contents(
'/usr/local/etc/fossology/Db.conf');
57 $this->Db =
new db($options);
58 $connection = $this->Db->connect();
59 if (!(is_resource($connection))) {
60 print
"check4jobs:FATAL ERROR!, could not connect to the data-base\n";
67 public function Check() {
69 return($this->jobCount);
71 private function _ck4j() {
72 $results = $this->Db->dbQuery(
SQL);
73 $howMany = count($results);
74 $this->jobCount = $howMany;
78 public function getJobCount() {
79 return($this->jobCount);
char SQL[256]
SQL query to execute.