FOSSology  4.5.1
Open Source License Compliance by Open Source Software
Fossology\Lib\Util\OsselotLookupHelper Class Reference
Collaboration diagram for Fossology\Lib\Util\OsselotLookupHelper:
Collaboration graph

Public Member Functions

 getVersions (string $pkgName)
 
 fetchSpdxFile (string $pkgName, string $version)
 
 clearCache ()
 

Private Member Functions

 isValidXml (string $content)
 

Private Attributes

Client $client
 
string $cacheDir
 
int $cacheTtl = 86400
 

Detailed Description

Definition at line 13 of file OsselotLookupHelper.php.

Member Function Documentation

◆ clearCache()

Fossology\Lib\Util\OsselotLookupHelper::clearCache ( )

Clears the cache directory.

Returns
bool True on success, false on failure.

Definition at line 215 of file OsselotLookupHelper.php.

◆ fetchSpdxFile()

Fossology\Lib\Util\OsselotLookupHelper::fetchSpdxFile ( string  $pkgName,
string  $version 
)

Downloads (or retrieves from cache) the SPDX RDF/XML file for a given package/version and returns the local cache pathname, or null if all attempts fail.

Parameters
string$pkgNamePackage identifier
string$versionVersion string
Returns
string|null Path to cached file or null on failure
Exceptions

Definition at line 109 of file OsselotLookupHelper.php.

◆ getVersions()

Fossology\Lib\Util\OsselotLookupHelper::getVersions ( string  $pkgName)

Fetches the list of versions for a given package from the OSSelot curated API.

Parameters
string$pkgNamePackage identifier to look up (e.g., "angular").
Returns
array List of version strings; empty if none found or on error.

Definition at line 40 of file OsselotLookupHelper.php.

◆ isValidXml()

Fossology\Lib\Util\OsselotLookupHelper::isValidXml ( string  $content)
private

Basic XML validation

Definition at line 196 of file OsselotLookupHelper.php.


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