MediaWiki master
MediaWiki\ResourceLoader\ForeignResourceManager Class Reference

Manage foreign resources registered with ResourceLoader. More...

Public Member Functions

 __construct (private readonly string $registryFile, private readonly string $libDir, ?callable $infoPrinter=null, ?callable $errorPrinter=null, ?callable $verbosePrinter=null)
 
 generateCdx ()
 Returns a JSON string describing the foreign resources in a CycloneDX format.
 
 generateCdxData ()
 Returns an array describing the foreign resources in the CycloneDX format.
 
 getCdxFileLocation ()
 Get the path to the CycloneDX file that describes the foreign resources.
 
 run (string $action, string $module)
 

Detailed Description

Manage foreign resources registered with ResourceLoader.

Since
1.32
See also
https://www.mediawiki.org/wiki/Foreign_resources

Definition at line 29 of file ForeignResourceManager.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\ResourceLoader\ForeignResourceManager::__construct ( private readonly string $registryFile,
private readonly string $libDir,
?callable $infoPrinter = null,
?callable $errorPrinter = null,
?callable $verbosePrinter = null )
Parameters
string$registryFilePath to YAML file
string$libDirPath to a modules directory
callable | null$infoPrinterCallback for printing info about the run.
callable | null$errorPrinterCallback for printing errors from the run.
callable | null$verbosePrinterCallback for printing extra verbose progress information from the run.

Definition at line 71 of file ForeignResourceManager.php.

References MediaWiki\MainConfigNames\CacheDirectory, and MediaWiki\MediaWikiServices\getInstance().

Member Function Documentation

◆ generateCdx()

MediaWiki\ResourceLoader\ForeignResourceManager::generateCdx ( )

Returns a JSON string describing the foreign resources in a CycloneDX format.

Definition at line 213 of file ForeignResourceManager.php.

◆ generateCdxData()

MediaWiki\ResourceLoader\ForeignResourceManager::generateCdxData ( )

Returns an array describing the foreign resources in the CycloneDX format.

Since
1.46

Definition at line 224 of file ForeignResourceManager.php.

◆ getCdxFileLocation()

MediaWiki\ResourceLoader\ForeignResourceManager::getCdxFileLocation ( )

Get the path to the CycloneDX file that describes the foreign resources.

Definition at line 232 of file ForeignResourceManager.php.

◆ run()

MediaWiki\ResourceLoader\ForeignResourceManager::run ( string $action,
string $module )
Exceptions
LogicException

Definition at line 103 of file ForeignResourceManager.php.


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