8 namespace Fossology\Lib\Report;
19 private $DNUFilesOnly;
21 public function __construct($DNUFilesOnly=
true)
23 $this->clearingDao = $GLOBALS[
'container']->get(
'dao.clearing');
24 $this->DNUFilesOnly = $DNUFilesOnly;
25 parent::__construct($groupBy =
'text');
34 protected function getStatements($uploadId, $uploadTreeTableName, $groupId=
null)
36 $itemTreeBounds = $this->uploadDao->getParentItemBounds($uploadId,$uploadTreeTableName);
37 return $this->clearingDao->getFilesForDecisionTypeFolderLevel($itemTreeBounds, $groupId,
true,
'doNotUse');
45 protected function groupStatements($ungrupedStatements, $extended, $agentcall, $isUnifiedReport, $objectAgent)
47 $statements = array();
48 foreach ($ungrupedStatements as $statement) {
49 $fileName = $statement[
'fileName'];
50 $dirName = dirname($statement[
'fileName']);
51 $baseName = basename($statement[
'fileName']);
52 $comment = $statement[
'comment'];
54 $statement[
'spdx_id']);
55 if ($this->DNUFilesOnly) {
56 if (array_key_exists($fileName, $statements)) {
57 $currentLics = &$statements[$fileName][
"licenses"];
58 if (! in_array($licenseName, $currentLics)) {
59 $currentLics[] = $licenseName;
62 $statements[$fileName] = array(
64 "fileName" => $baseName,
66 "licenses" => array($licenseName)
71 $statements[] = array(
72 "content" => $licenseName,
74 "files" => array($fileName)
78 $objectAgent->heartbeat(1);
80 return array(
"statements" => array_values($statements));
static convertToSpdxId($shortname, $spdxId)
Given a license's shortname and spdx id, give out spdx id to use in reports.
groupStatements($ungrupedStatements, $extended, $agentcall, $isUnifiedReport, $objectAgent)
getStatements($uploadId, $uploadTreeTableName, $groupId=null)
if(! defined('ENT_SUBSTITUTE')) convertToUTF8($content, $toHTML=true)