68 include_once(__DIR__ .
"/spdxutils.php");
70 include_once(__DIR__ .
"/version.php");
71 include_once(__DIR__ .
"/services.php");
172 function __construct()
175 $args = getopt(
"", array(self::OUTPUT_FORMAT_KEY.
'::'));
177 if (array_key_exists(self::OUTPUT_FORMAT_KEY,
$args)) {
184 parent::__construct(
$agentName, AGENT_VERSION, AGENT_REV);
186 $this->uploadDao = $this->container->get(
'dao.upload');
187 $this->clearingDao = $this->container->get(
'dao.clearing');
188 $this->licenseDao = $this->container->get(
'dao.license');
189 $this->
dbManager = $this->container->get(
'db.manager');
190 $this->renderer = $this->container->get(
'twig.environment');
191 $this->renderer->setCache(
false);
193 $this->agentSpecifLongOptions[] = self::UPLOAD_ADDS.
':';
194 $this->agentSpecifLongOptions[] = self::OUTPUT_FORMAT_KEY.
':';
209 if ((!array_key_exists(self::OUTPUT_FORMAT_KEY,
$args)
210 ||
$args[self::OUTPUT_FORMAT_KEY] ===
"")
211 && array_key_exists(self::UPLOAD_ADDS,
$args)) {
214 if (!array_key_exists(self::UPLOAD_ADDS,
$args) ||
$args[self::UPLOAD_ADDS] ===
"") {
229 if (array_key_exists(self::OUTPUT_FORMAT_KEY,
$args)) {
230 $possibleOutputFormat =
trim(
$args[self::OUTPUT_FORMAT_KEY]);
231 if (in_array($possibleOutputFormat, explode(
',',self::AVAILABLE_OUTPUT_FORMATS))) {
232 $this->outputFormat = $possibleOutputFormat;
235 $this->licenseMap =
new LicenseMap($this->
dbManager, $this->groupId, LicenseMap::REPORT,
true);
237 $docLicense = $this->licenseDao->getLicenseByShortName(self::DATA_LICENSE);
238 $docLicenseId = $docLicense->getId() .
"-" . md5($docLicense->getText());
240 ->setLicenseObj($docLicense)
241 ->setListedLicense(
true)
242 ->setCustomText(
false)
243 ->setTextPrinted(
true);
245 $additionalUploadIds = array_key_exists(self::UPLOAD_ADDS,
$args) ? explode(
',',
$args[self::UPLOAD_ADDS]) : array();
246 $packageIds = array($uploadId);
247 foreach ($additionalUploadIds as $additionalId) {
249 $packageIds[] = $additionalId;
251 $this->
writeReport($packageNodes, $packageIds, $uploadId);
262 $prefix = $this->outputFormat .
"-";
264 switch ($this->outputFormat) {
266 $postfix =
".xml" . $postfix;
272 $prefix .=
"copyright-";
277 $postfix =
".xml" . $postfix;
284 return $prefix . $partname . $postfix;
296 if ($this->filebasename ==
null) {
297 $fileName =
strtoupper($this->outputFormat).
"_".$packageName;
298 switch ($this->outputFormat) {
300 $fileName .=
".spdx.rdf";
303 $fileName .=
".spdx";
312 $fileName .=
".jsonld";
315 $fileName .=
".json";
318 $fileName .=
".spdx.rdf";
321 $fileName .=
".spdx";
324 $this->filebasename = $fileName;
337 $fileBase = $SysConf[
'FOSSOLOGY'][
'path'].
"/report/";
349 $url=$SysConf[
'SYSCONFIG'][
'FOSSologyURL'];
350 if (substr( $url, 0, 4 ) !==
"http") {
364 $uploadTreeTableName = $this->uploadDao->getUploadtreeTableName($uploadId);
366 $itemTreeBounds = $this->uploadDao->getParentItemBounds($uploadId,$uploadTreeTableName);
369 $filesWithLicenses = $this->reportutils
370 ->getFilesWithLicensesFromClearings($itemTreeBounds, $this->groupId,
371 $this, $this->licensesInDocument);
374 $this->reportutils->addClearingStatus($filesWithLicenses,$itemTreeBounds, $this->groupId);
377 $scannerIDs = $this->reportutils->addScannerResults($filesWithLicenses, $itemTreeBounds, $this->groupId, $this->licensesInDocument);
378 $licenseComment =
"";
379 if (!empty($scannerIDs)) {
382 if ($this->outputFormat ===
'dep5') {
383 $this->dep5LicenseComments = $licenseComment;
387 $this->reportutils->addCopyrightResults($filesWithLicenses, $uploadId);
390 $upload = $this->uploadDao->getUpload($uploadId);
391 $fileNodes = $this->
generateFileNodes($filesWithLicenses, $upload->getTreeTableName(), $uploadId);
393 $mainLicenseIds = $this->clearingDao->getMainLicenseIds($uploadId, $this->groupId);
394 $customMainLicenseTexts = $this->clearingDao->getMainLicenseReportInfos($uploadId, $this->groupId);
395 $mainLicenses = array();
396 foreach ($mainLicenseIds as $licId) {
397 $reportedLicenseId = $this->licenseMap->getProjectedId($licId);
398 $mainLicense = $this->licenseDao->getLicenseById($reportedLicenseId, $this->groupId);
399 if ($mainLicense ===
null) {
401 "spdx: Warning: main license ID {$reportedLicenseId} not found; skipping."
405 $customText = $customMainLicenseTexts[$licId] ??
null;
406 if (!empty($customText)) {
407 $reportLicId = $mainLicense->getId() .
"-" . md5($customText);
408 $prefix = $stateOsselot ? LicenseRef::SPDXREF_PREFIX : LicenseRef::SPDXREF_PREFIX_FOSSOLOGY;
409 $customShortName = $prefix . $mainLicense->getShortName() .
"-" . md5($customText);
411 $mainLicense->getId(),
413 $mainLicense->getFullName(),
414 $mainLicense->getRisk(),
416 $mainLicense->getUrl(),
417 $mainLicense->getDetectorType(),
421 ->setLicenseObj($customLicense)
422 ->setCustomText(
true)
423 ->setListedLicense(
false);
425 $reportLicId = $mainLicense->getId() .
"-" . md5($mainLicense->getText());
426 if (!array_key_exists($reportLicId, $this->licensesInDocument)) {
427 $listedLicense = stripos($mainLicense->getSpdxId(),
428 LicenseRef::SPDXREF_PREFIX) !== 0;
430 ->setLicenseObj($mainLicense)
431 ->setCustomText(
false)
432 ->setListedLicense($listedLicense);
435 $mainLicenses[] = $reportLicId;
437 $mainLicenseString = [];
438 if ($this->outputFormat ==
"spdx2tv" ||
439 $this->outputFormat ==
"spdx2csv" ||
440 $this->outputFormat ==
"spdx3tv" ||
441 $this->outputFormat ==
"dep5") {
442 foreach ($mainLicenses as $mainLicense) {
443 $shortName = $this->licensesInDocument[$mainLicense]
444 ->getLicenseObj()->getShortName();
446 LicenseRef::SPDXREF_PREFIX)) {
447 $mainLicenseString[] = $shortName;
449 $mainLicenseString[] = $this->licensesInDocument[$mainLicense]
450 ->getLicenseObj()->getSpdxId();
453 if ($this->outputFormat ==
"spdx2tv") {
456 foreach ($mainLicenseString as $i => $licId) {
461 $mainLicenseString[$i] =
"LicenseRef-$licId";
467 if ($this->outputFormat ==
"dep5") {
468 $this->dep5MainLicense = $mainLicenseString;
472 $hashes = $this->uploadDao->getUploadHashes($uploadId);
474 $reportInfo = $this->uploadDao->getReportInfo($uploadId);
475 $componentId = $reportInfo[
'ri_component_id'];
476 $componentType = $reportInfo[
'ri_component_type'];
477 $componentVersion = $reportInfo[
'ri_version'];
478 $generalAssessment = $reportInfo[
'ri_general_assesment'];
479 $releaseDate = $reportInfo[
'ri_release_date'];
480 if ($componentId ==
"NA") {
483 if ($componentVersion ==
"NA") {
484 $componentVersion =
"";
486 if ($generalAssessment ==
"NA") {
487 $generalAssessment =
"";
489 if ($releaseDate ==
"NA") {
492 $timeStamp = strtotime($releaseDate);
493 if ($timeStamp != -1) {
494 $releaseDate = date(
"Y-m-d\\T00:00:00\\Z", $timeStamp);
500 $componentType =
"maven-central";
502 $componentType =
"purl";
504 if (!empty($componentType)) {
513 'packageId' => $uploadId,
515 'packageName' => $upload->getFilename(),
516 'packageVersion' => $componentVersion,
517 'releaseDate' => $releaseDate,
518 'generalAssessment' => $generalAssessment,
519 'uploadName' => $upload->getFilename(),
520 'componentType' => $componentType,
521 'componentId' => htmlspecialchars($componentId),
522 'sha1' => $hashes[
'sha1'],
523 'md5' => $hashes[
'md5'],
524 'sha256' => $hashes[
'sha256'],
526 'mainLicenses' => $mainLicenses,
527 'mainLicenseString' => $mainLicenseString,
528 'licenseComments' => $licenseComment,
529 'fileNodes' => $fileNodes,
530 'obligations' => $obligations,
531 'licenseList' => $this->licensesInDocument,
532 'EnableOsselotExport' => $stateOsselot
543 $func =
function($scannerId) use (
$agentDao)
545 return $agentDao->getAgentName($scannerId).
" (".
$agentDao->getAgentRev($scannerId).
")";
547 $scannerNames = array_map($func, $scannerIds);
548 return "licenseInfoInFile determined by Scanners:\n - ".implode(
"\n - ",$scannerNames);
561 if (!array_key_exists($licenses, $filesWithLicenses)) {
562 $filesWithLicenses[$licenses][
'files']=array();
563 $filesWithLicenses[$licenses][
'copyrights']=array();
565 if (empty($copyrights)) {
566 $copyrights = array();
568 $filesWithLicenses[$licenses][
'files'][$file] = $fullPath;
569 foreach ($copyrights as $copyright) {
570 if (!in_array($copyright, $filesWithLicenses[$licenses][
'copyrights'])) {
571 $filesWithLicenses[$licenses][
'copyrights'][] = $copyright;
584 $licensesWithFiles = array();
585 $treeDao = $this->container->get(
'dao.tree');
587 foreach ($filesWithLicenses as $fileId => $fileNode) {
588 $filesProceeded += 1;
589 if (($filesProceeded&2047)==0) {
592 $fullPath = $treeDao->getFullPath($fileId, $treeTableName, 0);
593 if (! empty($fileNode->getConcludedLicenses())) {
595 foreach ($fileNode->getConcludedLicenses() as $license) {
596 $licenses[] = $this->licensesInDocument[$license]
597 ->getLicenseObj()->getSpdxId();
602 $licenses, $fileNode->getCopyrights(), $fileId, $fullPath);
604 if (! empty($fileNode->getScanners())) {
605 $implodedLicenses = [];
606 foreach ($fileNode->getScanners() as $license) {
607 $implodedLicenses[] = $this->licensesInDocument[$license]
608 ->getLicenseObj()->getSpdxId();
612 if ($fileNode->isCleared()) {
613 $msgLicense =
"None (scanners found: " . $implodedLicenses .
")";
615 $msgLicense =
"NoLicenseConcluded (scanners found: " . $implodedLicenses .
")";
618 if ($fileNode->isCleared()) {
619 $msgLicense =
"None";
621 $msgLicense =
"NoLicenseConcluded";
625 $fileNode->getCopyrights(), $fileId, $fullPath);
628 return $licensesWithFiles;
637 $upload = $this->uploadDao->getUpload($uploadId);
638 $packageName = $upload->getFilename();
640 $this->uri = $this->
getUri($packageName);
641 $this->filename = $this->
getFileName($packageName);
650 protected function writeReport(&$packageNodes, $packageIds, $uploadId)
654 $fileBase = dirname($this->filename);
656 if (!is_dir($fileBase)) {
657 mkdir($fileBase, 0777,
true);
661 $organizationName = $SysConf[
'SYSCONFIG'][
"ReportHeaderText"] ??
'FOSSology';
662 $version = $SysConf[
'BUILD'][
'VERSION'];
664 $uploadTreeTableName = $this->uploadDao->getUploadtreeTableName($uploadId);
665 $itemTreeBounds = $this->uploadDao->getParentItemBounds($uploadId,$uploadTreeTableName);
668 $filesWithLicenses = $this->reportutils
669 ->getFilesWithLicensesFromClearings($itemTreeBounds, $this->groupId,
670 $this, $this->licensesInDocument);
672 $upload = $this->uploadDao->getUpload($uploadId);
673 $this->
generateFileNodes($filesWithLicenses, $upload->getTreeTableName(), $uploadId);
674 $this->declaredLicenseFileIds = array_unique(array_diff($this->declaredLicenseFileIds, $this->concludedLicenseFileIds));
675 $this->concludedLicenseFileIds = array_unique($this->concludedLicenseFileIds);
676 $this->validateLicenseIdentifiers();
678 'documentName' => $upload->getFilename(),
680 'mainLicense' => $this->dep5MainLicense,
681 'licenseComments' => $this->dep5LicenseComments,
682 'userName' => $this->container->get(
'dao.user')->getUserName($this->userId) .
" (" . $this->container->get(
'dao.user')->getUserEmail($this->userId) .
")",
683 'organisation' => $organizationName,
684 'concludedLicenseFileIds'=>$this->concludedLicenseFileIds,
685 'declaredLicenseFileIds'=>$this->declaredLicenseFileIds,
686 'toolVersion' =>
'fossology-' . $version,
687 'packageNodes' => $packageNodes,
688 'packageIds' => $packageIds,
689 'dataLicense' => $this->getSPDXDataLicense(),
690 'licenseList' => $this->licensesInDocument,
691 'EnableOsselotExport' => $stateOsselot,
697 $message = preg_replace(
'/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F]/',
'?',$message);
699 file_put_contents($this->filename, $message);
711 $this->reportutils->updateOrInsertReportgenEntry($uploadId,
$jobId, $fileName);
714 protected function validateLicenseIdentifiers()
717 foreach ($this->licensesInDocument as $licenseInfo) {
718 $license = $licenseInfo->getLicenseObj();
719 $spdxId = $license->getSpdxId();
720 $shortName = $license->getShortName();
722 if (!SpdxLicenseValidator::isLicenseRef($spdxId)) {
725 if (preg_match(
'/[^a-zA-Z0-9.\-\s]/', $shortName)) {
726 $idstring = SpdxLicenseValidator::extractIdstring($spdxId);
727 $fossologyPrefix = substr(LicenseRef::SPDXREF_PREFIX_FOSSOLOGY,
728 strlen(LicenseRef::SPDXREF_PREFIX));
729 if (strpos($idstring, $fossologyPrefix) === 0) {
730 $idstring = substr($idstring, strlen($fossologyPrefix));
732 $issues[] = sprintf(
" \"%s\" -> sanitized to \"%s\"",
733 $shortName, $idstring);
737 if (!empty($issues)) {
738 error_log(
"spdx: License shortnames with invalid SPDX characters were sanitized:\n"
739 . implode(
"\n", $issues));
751 return $this->renderer->load($templateName)->render($vars);
764 if (strcmp($this->outputFormat,
"dep5") !== 0) {
781 $treeDao = $this->container->get(
'dao.tree');
785 $textToBePrinted = [];
786 foreach ($filesWithLicenses as $fileId => $fileData) {
787 $filesProceeded += 1;
788 if (($filesProceeded & 2047) == 0) {
789 $this->
heartbeat($filesProceeded - $lastValue);
790 $lastValue = $filesProceeded;
792 $hashes = $treeDao->getItemHashes($fileId);
793 $fileName = $treeDao->getFullPath($fileId, $treeTableName, 0);
797 foreach ($fileData->getConcludedLicenses() as $license) {
798 $this->concludedLicenseFileIds[] = $fileId;
799 if (! $this->licensesInDocument[$license]->isTextPrinted()) {
800 $textToBePrinted[] = $license;
803 foreach ($fileData->getScanners() as $license) {
804 $this->declaredLicenseFileIds[] = $fileId;
805 if (! $this->licensesInDocument[$license]->isTextPrinted()) {
806 $textToBePrinted[] = $license;
809 $concludedLicensesString = [];
810 if ($this->outputFormat ==
"spdx2tv" ||
811 $this->outputFormat ==
"spdx2csv" ||
812 $this->outputFormat ==
"spdx3tv") {
813 foreach ($fileData->getConcludedLicenses() as $license) {
814 $shortName = $this->licensesInDocument[$license]
815 ->getLicenseObj()->getShortName();
817 LicenseRef::SPDXREF_PREFIX)) {
818 $concludedLicensesString[] = $shortName;
820 $concludedLicensesString[] = $this->licensesInDocument[$license]
821 ->getLicenseObj()->getSpdxId();
824 if ($this->outputFormat ==
"spdx2tv") {
826 foreach ($concludedLicensesString as $j => $licId) {
831 $concludedLicensesString[$j] =
"LicenseRef-$licId";
842 if (!$stateWoInfos ||
843 ($stateWoInfos && (!empty($fileData->getConcludedLicenses()) ||
844 !empty($fileData->getScanners()) || !empty($fileData->getCopyrights())))) {
845 $fileData->setAcknowledgements(
847 $fileData->setComments(
849 $dataTemplate = array(
851 'sha1' => $hashes[
'sha1'],
852 'md5' => $hashes[
'md5'],
853 'sha256' => $hashes[
'sha256'],
855 'fileName' => $fileName,
856 'fileDirName' => dirname($fileName),
857 'fileBaseName' => basename($fileName),
858 'fileData' => $fileData,
859 'licenseList' => $this->licensesInDocument,
860 'concludedLicensesString' => $concludedLicensesString,
861 'licenseCommentState' => $stateComment,
862 'EnableOsselotExport' =>$stateOsselot,
867 foreach ($textToBePrinted as $license) {
868 $this->licensesInDocument[$license]->setTextPrinted(
true);
871 $this->
heartbeat($filesProceeded - $lastValue);
889 foreach ($licensesWithFiles as $licenseId=>$entry) {
890 $filesProceeded += count($entry[
'files']);
891 if ($filesProceeded&(~2047) > $lastStep) {
892 $this->
heartbeat($filesProceeded - $lastValue);
893 $lastStep = $filesProceeded&(~2047) + 2048;
894 $lastValue = $filesProceeded;
898 if (strrpos($licenseId,
"NoLicenseConcluded (scanners found: ", -strlen($licenseId)) !==
false) {
899 $comment = substr($licenseId,20,strlen($licenseId)-21);
900 $licenseId =
"NoLicenseConcluded";
901 } elseif (strrpos($licenseId,
"None (scanners found: ", -strlen($licenseId)) !==
false) {
902 $comment = substr($licenseId,6,strlen($licenseId)-7);
905 if ($this->outputFormat ===
'dep5' &&
906 ($licenseId ===
'NoLicenseConcluded' || $licenseId ===
'None')) {
907 $licenseId =
'UNKNOWN';
911 'fileNames'=>$entry[
'files'],
912 'license'=>$licenseId,
913 'copyrights'=>$entry[
'copyrights'],
914 'comment'=>$comment));
916 $this->
heartbeat($filesProceeded - $lastValue);
932 if ($upload->getTreeTableName()==
'uploadtree_a') {
933 $sql = $upload->getTreeTableName().
' WHERE upload_fk=$1 AND';
934 $param[] = $upload->getId();
936 $sql = $upload->getTreeTableName().
' WHERE';
937 $stmt .=
'.'.$upload->getTreeTableName();
940 $sql =
"SELECT STRING_AGG(lower_sha1,'') concat_sha1 FROM
941 (SELECT LOWER(pfile_sha1) lower_sha1 FROM pfile, $sql pfile_fk=pfile_pk AND parent IS NOT NULL ORDER BY pfile_sha1) templist";
942 $filelistPack = $this->
dbManager->getSingleRow($sql,$param,$stmt);
944 return sha1($filelistPack[
'concat_sha1']);
956 $sql =
"SELECT ri_spdx_selection FROM report_info WHERE upload_fk = $1";
957 $getCommentState = $this->
dbManager->getSingleRow($sql, array($uploadId), __METHOD__.
'.SPDX_license_comment');
958 if (!empty($getCommentState[
'ri_spdx_selection'])) {
959 $getCommentStateSingle = explode(
',', $getCommentState[
'ri_spdx_selection']);
960 if ($getCommentStateSingle[$key] ===
"checked") {
974 $licenses = $this->licenseClearedGetter->getCleared($uploadId, $this,
977 $licensesMain = $this->licenseMainGetter->getCleared($uploadId, $this,
980 list($obligations, $_) = $this->obligationsGetter->getObligations(
981 $licenses[
'statements'], $licensesMain[
'statements'], $uploadId,
983 if (empty($obligations)) {
986 return array_column($obligations,
"text");
996 $dataLic = $this->licenseDao->getLicenseByShortName(self::DATA_LICENSE);
997 return $dataLic->getId() .
"-" . md5($dataLic->getText());
1013 $localList = array_values($this->licensesInDocument);
1021 for ($i = 0; $i < count($localList) - 1; $i++) {
1022 if ((! $localList[$i]->isCustomText() && ! $localList[$i + 1]->isCustomText()) &&
1023 $localList[$i]->getLicenseObj()->getSpdxId() ===
1024 $localList[$i + 1]->getLicenseObj()->getSpdxId()) {
1025 $newShortName = $localList[$i + 1]->getLicenseObj()->getShortName();
1027 $localList[$i + 1]->getLicenseObj()->getShortName(),
1028 LicenseRef::SPDXREF_PREFIX)) {
1029 $newShortName = LicenseRef::SPDXREF_PREFIX .
1030 $localList[$i + 1]->getLicenseObj()->getShortName();
1031 $newShortName = preg_replace(
'/\+$/',
'-or-later', $newShortName);
1033 $md5 = md5($localList[$i + 1]->getLicenseObj()->getText());
1034 $reportedLicenseShortname =
"$newShortName-$md5";
1035 $licIndex = $localList[$i + 1]->getLicenseObj()->getId() .
"-$md5";
1036 $oldLicObj = $this->licensesInDocument[$licIndex]->getLicenseObj();
1037 $this->licensesInDocument[$licIndex]->setLicenseObj(
1038 new License($oldLicObj->getId(), $reportedLicenseShortname,
1039 $oldLicObj->getFullName(), $oldLicObj->getRisk(),
1040 $oldLicObj->getText(), $oldLicObj->getUrl(),
1041 $oldLicObj->getDetectorType(), $oldLicObj->getSpdxId()));
1047 $agent =
new SpdxAgent();
1048 $agent->scheduler_connect();
1049 $agent->run_scheduler_event_loop();
1050 $agent->scheduler_disconnect(0);
Structure of an Agent with all required parameters.
heartbeat($newProcessed)
Send hear beat to the scheduler.
Contains the constants and helpers for authentication of user.
Wrapper class for license map.
Validate and sanitize SPDX LicenseRef identifiers.
static stringStartsWith($haystack, $needle)
const DEFAULT_OUTPUT_FORMAT
Default output format.
getLicenseComment($scannerIds)
getFileName($packageName)
Get absolute path for report.
getVerificationCode(Upload $upload)
Get a unique identifier for a given upload.
getTemplateFile($partname)
Get TWIG template file based on output format.
const UPLOAD_ADDS
Argument for additional uploads.
getObligations(int $uploadId, int $groupId)
processUploadId($uploadId)
Given an upload ID, process the items in it.
const DATA_LICENSE
Data license for SPDX reports.
updateReportTable($uploadId, $jobId, $fileName)
Update the reportgen table with new report path.
preWorkOnArgs($args)
Parse arguments.
renderString($templateName, $vars)
Render a twig template.
const AVAILABLE_OUTPUT_FORMATS
Output formats available.
renderPackage($uploadId)
Given an upload id, render the report string.
getFileBasename($packageName)
Generate report basename based on upload name.
generateFileNodesByLicenses($filesWithLicenses, $treeTableName)
For each file, generate the nodes by licenses.
toLicensesWithFiles(&$filesWithLicenses, $treeTableName)
Map findings to the files.
generateFileNodes($filesWithLicenses, $treeTableName, $uploadId)
Generate report nodes for files.
getSPDXReportConf($uploadId, $key)
Get spdx license comment state for a given upload.
toLicensesWithFilesAdder(&$filesWithLicenses, $licenses, $copyrights, $file, $fullPath)
Map licenses, copyrights, files and full path to filesWithLicenses array.
generateFileNodesByFiles($filesWithLicenses, $treeTableName, $uploadId)
For each file, generate the nodes by files.
writeReport(&$packageNodes, $packageIds, $uploadId)
Write the report the file and update report table.
computeUri($uploadId)
For a given upload, compute the URI and filename for the report.
const OUTPUT_FORMAT_KEY
Argument key for output format.
getUri($packageName)
Get the URI for the given package.
deduplicateLicenseList()
De-duplicate license list by comparing licenses with the same SPDX ID.
static preWorkOnArgsFlp($args, $key1, $key2)
For a given set of arguments assign $args[$key1] and $args[$key2].
static implodeLicenses($licenses)
Implode licenses with "AND" or "OR".
static removeEmptyLicenses($licenses)
static cleanTextArray($texts)
char * trim(char *ptext)
Trimming whitespace.
int jobId
The id of the job.
fo_dbManager * dbManager
fo_dbManager object
FUNCTION char * strtoupper(char *s)
Helper function to upper case a string.
Namespace used by SPDX2 agent.