use LinkCache;
use Liuggio\StatsdClient\Factory\StatsdDataFactory;
use LoadBalancer;
+use MediaHandlerFactory;
use MediaWiki\Linker\LinkRenderer;
use MediaWiki\Linker\LinkRendererFactory;
use MediaWiki\Services\SalvageableService;
use MediaWiki\Services\ServiceContainer;
+use MediaWiki\Services\NoSuchServiceException;
use MWException;
use ObjectCache;
use SearchEngine;
use SkinFactory;
use TitleFormatter;
use TitleParser;
+use VirtualRESTServiceClient;
use MediaWiki\Interwiki\InterwikiLookup;
/**
*/
private function salvage( self $other ) {
foreach ( $this->getServiceNames() as $name ) {
- $oldService = $other->peekService( $name );
+ // The service could be new in the new instance and not registered in the
+ // other instance (e.g. an extension that was loaded after the instantiation of
+ // the other instance. Skip this service in this case. See T143974
+ try {
+ $oldService = $other->peekService( $name );
+ } catch ( NoSuchServiceException $e ) {
+ continue;
+ }
if ( $oldService instanceof SalvageableService ) {
/** @var SalvageableService $newService */
return $this->getService( 'WatchedItemQueryService' );
}
+ /**
+ * @since 1.28
+ * @return MediaHandlerFactory
+ */
+ public function getMediaHandlerFactory() {
+ return $this->getService( 'MediaHandlerFactory' );
+ }
+
/**
* @since 1.28
* @return GenderCache
return $this->getService( 'TitleParser' );
}
+ /**
+ * @since 1.28
+ * @return VirtualRESTServiceClient
+ */
+ public function getVirtualRESTServiceClient() {
+ return $this->getService( 'VirtualRESTServiceClient' );
+ }
+
///////////////////////////////////////////////////////////////////////////
// NOTE: When adding a service getter here, don't forget to add a test
// case for it in MediaWikiServicesTest::provideGetters() and in