FOSSology  4.7.1
Open Source License Compliance by Open Source Software
exportLicenseRef Class Reference
Collaboration diagram for exportLicenseRef:
Collaboration graph

Public Member Functions

 startProcessingLicenseData ()
 
 getListSPDX ($type, $URL, $updateWithNew, $updateExisting, $addNewLicense, $existingLicenseRefData, $deleteDeprecated)
 get SPDX license or exception list and update licenseref.json More...
 

Public Attributes

const BOA_LIST_URL = 'https://blueoakcouncil.org/list.json'
 

Private Member Functions

 getLicenseType ($type, $licenseData, $boaIds)
 Classify a license into rf_licensetype using name, comments, and BOA membership. More...
 
 replaceUnicode ($text)
 
 sanitizeRefData (&$newLicenseRefData)
 
 fetchBoaList ($url)
 

Private Attributes

 $mapArrayData
 

Detailed Description

Definition at line 17 of file exportLicenseRefUsingSPDX.php.

Member Function Documentation

◆ fetchBoaList()

exportLicenseRef::fetchBoaList (   $url)
private

Pull/fetch data from BOA.

Parameters
string$urlInput text
Returns
JSON raw

Definition at line 459 of file exportLicenseRefUsingSPDX.php.

◆ getLicenseType()

exportLicenseRef::getLicenseType (   $type,
  $licenseData,
  $boaIds 
)
private

Classify a license into rf_licensetype using name, comments, and BOA membership.

Returns
string Exception|Public Domain|Permissive|Weak Copyleft|Strong Copyleft| Network Copyleft|Non-commercial|Source Available|Font|Data|Unknown

Definition at line 309 of file exportLicenseRefUsingSPDX.php.

◆ getListSPDX()

exportLicenseRef::getListSPDX (   $type,
  $URL,
  $updateWithNew,
  $updateExisting,
  $addNewLicense,
  $existingLicenseRefData,
  $deleteDeprecated 
)

get SPDX license or exception list and update licenseref.json

get SPDX license or exception list update the licenseref.json file with changes in existing license text or add a new license if licenseref.json doesn't contain it. Create a new licenserefnew.json file from where it is getting executed. user need to copy the additional license texts from licenserefnew.json to actual licenseref.json

Definition at line 146 of file exportLicenseRefUsingSPDX.php.

◆ replaceUnicode()

exportLicenseRef::replaceUnicode (   $text)
private

Replace common unicode characters with ASCII for consistent results.

Parameters
string$textInput text
Returns
string Input with characters replaced

Definition at line 410 of file exportLicenseRefUsingSPDX.php.

◆ sanitizeRefData()

exportLicenseRef::sanitizeRefData ( $newLicenseRefData)
private

Santize the license ref data before writing to JSON file

Parameters
[in,out]array$newLicenseRefDataLicense ref data to be sanitized

Definition at line 444 of file exportLicenseRefUsingSPDX.php.

Member Data Documentation

◆ $mapArrayData

array exportLicenseRef::$mapArrayData
private
Initial value:
= array(
'licenses' => array('licenseId', 'licenseText', 'name'),
'exceptions' => array('licenseExceptionId', 'licenseExceptionText', 'name')
)

actual names for license/exception in SPDX for text and licenseid

Definition at line 23 of file exportLicenseRefUsingSPDX.php.


The documentation for this class was generated from the following file: