38 public function __construct($sourcePath, $logPath=NULL)
40 if(empty($sourcePath))
42 $this->srcPath = getcwd();
46 $this->srcPath = $sourcePath;
50 $this->logPath = getcwd() .
"/fo_integration.log";
54 $this->logPath = $logPath;
56 echo
"DB: logpath is:$this->logPath\n";
58 $this->LOGFD = fopen($this->logPath,
'a+');
59 if($this->LOGFD ===
false)
61 $error =
"Error! cannot open $this->logPath" .
" File: " . __FILE__ .
62 " on line: " . __LINE__;
63 throw new exception($error);
78 protected function log($message)
80 if(fwrite($this->LOGFD, $message) ===
false)
83 echo
"WARNING! cannot write to log file, there may be no log messages\n";
124 parent::__construct($srcPath,$logPath);
125 if (!chdir($this->srcPath))
127 throw new exception(
"FATAL! can't cd to $this->srcPath\n");
129 $this->
log(
"Executing Make Clean\n");
130 $mcLast = exec(
'make clean > make-clean.out 2>&1', $results, $rtn);
132 $this->
log(
"Executing Make all\n");
133 $makeLast = exec(
'make > make.out 2>&1', $results, $rtn);
138 if (array_search(
'Error', $results))
142 throw new exception(
"Errors in make, inspect make.out for details\n");
147 throw new exception(
"Errors in make, inspect make.out for details\n");
make fossology, check for warnings and errors
__construct($srcPath, $logPath=NULL)
make fossology
base class for fossology integration.
log($message)
log a message in a file