- Affected components: MediaWiki core (VirtualRESTService, libs/virtualrest) and thus VisualEditor, Citoid, Math, Flow, ContentTranslation, Collection, and other non-Wikimedia production extensions.
- Engineer for initial implementation: TBD.
- Code steward: TBD.
Motivation
VirtualRESTService was introduced to encourage the internal use of HTTP services. This is similar to the older mechanism for internal calls to the web API, which now have been deprecated by T169266: Clarify recommendations around using FauxRequest.
Since using VirtualRESTService has the same fundamental problems as using FauxRequest, it should also be deprecated and phased out. This should be simple enough, since it has never seen wide spread use.[citation needed]
Requirements
The interface between PHP code and a configurable service (e.g. one that can be in-process or over HTTP), should take the form of a service class obtained via MediaWikiServices.
Exploration
Note that VirtualRESTServiceClient (or a class with a similar interface) may still be useful for accessing the specific service known as RESTBase from inside MediaWiki. The intention of this RFC is to remove the generic framework for exposing internal services via VirtualRESTServiceClient. Instead, those would use the native approach of a service locator like MediaWikiServices, without pseudo urls and path/query strings.
Related classes of which the faith is to be determined:
- class VirtualRESTServiceClient
- abstract class VirtualRESTService
- class RestbaseVirtualRESTService extends VirtualRESTService
- class SwiftVirtualRESTService extends VirtualRESTService
- class ParsoidVirtualRESTService extends VirtualRESTService
- class ElectronVirtualRestService extends VirtualRESTService
RfC for creating the service
https://www.mediawiki.org/wiki/Requests_for_comment/PHP_Virtual_REST_Service - PHP Virtual REST Service