use MediaWiki\Linker\LinkRendererFactory;
use MediaWiki\Services\SalvageableService;
use MediaWiki\Services\ServiceContainer;
+use MediaWiki\Services\NoSuchServiceException;
use MWException;
use ObjectCache;
+use ProxyLookup;
use SearchEngine;
use SearchEngineConfig;
use SearchEngineFactory;
*/
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( 'MediaHandlerFactory' );
}
+ /**
+ * @since 1.28
+ * @return ProxyLookup
+ */
+ public function getProxyLookup() {
+ return $this->getService( 'ProxyLookup' );
+ }
+
/**
* @since 1.28
* @return GenderCache
return $this->getService( 'TitleParser' );
}
+ /**
+ * @since 1.28
+ * @return \BagOStuff
+ */
+ public function getMainObjectStash() {
+ return $this->getService( 'MainObjectStash' );
+ }
+
+ /**
+ * @since 1.28
+ * @return \WANObjectCache
+ */
+ public function getMainWANObjectCache() {
+ return $this->getService( 'MainWANObjectCache' );
+ }
+
+ /**
+ * @since 1.28
+ * @return \BagOStuff
+ */
+ public function getLocalServerObjectCache() {
+ return $this->getService( 'LocalServerObjectCache' );
+ }
+
/**
* @since 1.28
* @return VirtualRESTServiceClient