2020-08-12 15:05:06 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Vector;
|
|
|
|
|
|
|
|
use MediaWiki\MediaWikiServices;
|
|
|
|
use Vector\FeatureManagement\FeatureManager;
|
2021-06-30 12:51:04 +00:00
|
|
|
use Vector\Services\LanguageService;
|
2020-08-12 15:05:06 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* A service locator for services specific to Vector.
|
|
|
|
*
|
|
|
|
* @package Vector
|
|
|
|
* @internal
|
|
|
|
*/
|
|
|
|
final class VectorServices {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the feature manager service.
|
|
|
|
*
|
|
|
|
* Per its definition in ServiceWiring.php, the feature manager service is bound to the global
|
2022-04-05 13:54:23 +00:00
|
|
|
* request and user objects.
|
2020-08-12 15:05:06 +00:00
|
|
|
*
|
|
|
|
* @return FeatureManager
|
|
|
|
*/
|
|
|
|
public static function getFeatureManager(): FeatureManager {
|
|
|
|
return MediaWikiServices::getInstance()->getService( Constants::SERVICE_FEATURE_MANAGER );
|
|
|
|
}
|
2021-06-30 12:51:04 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the language service.
|
|
|
|
*
|
|
|
|
* @return LanguageService
|
|
|
|
*/
|
|
|
|
public static function getLanguageService(): LanguageService {
|
|
|
|
return new LanguageService();
|
|
|
|
}
|
2020-08-12 15:05:06 +00:00
|
|
|
}
|