MediaWiki master
MediaWiki\Rest\Module\ModuleManager Class Reference

Manages information related to REST modules, such as routes and specs. More...

Public Member Functions

 __construct (ServiceOptions $options, array $extensionModuleFiles, BagOStuff $srvCache, ResponseFactory $responseFactory)
 
 getApiSpecs ()
 Returns the available choices for APIs to explore.
 
 getDisabledRouteFiles ()
 Useful for testing or error status.
 
 getModuleMode (string $moduleId)
 Gets the module mode for a given module id.
 
 getRouteFiles ()
 
 hasApiSpecs ()
 Returns true if any api specs are available, or false otherwise.
 

Public Attributes

const CONSTRUCTOR_OPTIONS
 

Detailed Description

Manages information related to REST modules, such as routes and specs.

TODO: consider whether some code in Router or SpecBasedModule might be better placed here. TODO: consider whether ModuleManager and Router can share caching.

Since
1.46

Definition at line 19 of file ModuleManager.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Rest\Module\ModuleManager::__construct ( ServiceOptions $options,
array $extensionModuleFiles,
BagOStuff $srvCache,
ResponseFactory $responseFactory )

Member Function Documentation

◆ getApiSpecs()

MediaWiki\Rest\Module\ModuleManager::getApiSpecs ( )

Returns the available choices for APIs to explore.

Returns
array<string,array<string,string>>

Definition at line 220 of file ModuleManager.php.

◆ getDisabledRouteFiles()

MediaWiki\Rest\Module\ModuleManager::getDisabledRouteFiles ( )

Useful for testing or error status.

The return value will include route files that were disabled by either audience designation or configuration.

Since
1.47
Returns
string[]

Definition at line 153 of file ModuleManager.php.

◆ getModuleMode()

MediaWiki\Rest\Module\ModuleManager::getModuleMode ( string $moduleId)

Gets the module mode for a given module id.

Parameters
string$moduleIdThe module id
Returns
ModuleMode
Since
1.47

Definition at line 108 of file ModuleManager.php.

◆ getRouteFiles()

MediaWiki\Rest\Module\ModuleManager::getRouteFiles ( )
Returns
string[]

Definition at line 138 of file ModuleManager.php.

Referenced by MediaWiki\Rest\Router\__construct().

◆ hasApiSpecs()

MediaWiki\Rest\Module\ModuleManager::hasApiSpecs ( )

Returns true if any api specs are available, or false otherwise.

Returns
bool

Definition at line 207 of file ModuleManager.php.

Member Data Documentation

◆ CONSTRUCTOR_OPTIONS

const MediaWiki\Rest\Module\ModuleManager::CONSTRUCTOR_OPTIONS
Initial value:
= [
]
const ExtensionDirectory
Name constant for the ExtensionDirectory setting, for use with Config::get()
const RestModuleOverrides
Name constant for the RestModuleOverrides setting, for use with Config::get()
const ScriptPath
Name constant for the ScriptPath setting, for use with Config::get()
const RestSandboxSpecs
Name constant for the RestSandboxSpecs setting, for use with Config::get()
const RestExternalModules
Name constant for the RestExternalModules setting, for use with Config::get()
const RestAPIAdditionalRouteFiles
Name constant for the RestAPIAdditionalRouteFiles setting, for use with Config::get()
Access: internal

Definition at line 66 of file ModuleManager.php.


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