Page MenuHomePhabricator

Implement standard middleware interface in MediaWiki (PSR-15)
Open, Needs TriagePublic

Description

It would be really nice if we implemented PSR-15 which would allow standard middleware to be used within MediaWiki.

Use Cases

  • Using existing middlewares (examples) within MediaWiki
  • Add abstracted actions to the request/response pipeline (see T194396)
  • Abstract existing custom middlewares (like HTMLFileCache)

Event Timeline

dbarratt created this task.May 10 2018, 1:40 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMay 10 2018, 1:40 PM

What's the usecase here? Are we trying to reimplement fastcgi in PHP or something?

What's the usecase here? Are we trying to reimplement fastcgi in PHP or something?

  • Using existing middlewares (examples) within MediaWiki
  • Add abstracted actions to the request/response pipeline (see T194396)
  • Abstract existing custom middlewares (like HTMLFileCache)
dbarratt updated the task description. (Show Details)May 10 2018, 2:32 PM

It is quite likely that the pursuit of this task is mutually exclusive with T140664 and T106099.

From a quick glance, middleware-based services seems appropiate for web servers, not web applications. The main reason being that it opens up the ability to implement arbitrary new entry points in a way that isn't statically exportable in a stateless pure-data way, which may conflict with the desire to have a centralised registry that can be exported and used for knowing in advance what route and view template will respond to a particular user request.

There are an infinite number of specs and plugin models, but ultimately, we need to solve problems with solutions, and encourage consistency and re-use of solutions where possible. The easiest way to unblock this task would be to have a parent task that describes a particular product or developer need, for which this can be one of N possible solutions.

From a quick glance, middleware-based services seems appropiate for web servers, not web applications. The main reason being that it opens up the ability to implement arbitrary new entry points in a way that isn't statically exportable in a stateless pure-data way, which may conflict with the desire to have a centralised registry that can be exported and used for knowing in advance what route and view template will respond to a particular user request.

This is just within MediaWiki core, it wouldn't be outside of that (unless we exposed a hook to register middlewares, which I think we should).

There are an infinite number of specs and plugin models, but ultimately, we need to solve problems with solutions, and encourage consistency and re-use of solutions where possible.

I think implementing industry standards (where appropriate) is a step in that direction.

dbarratt renamed this task from Implement PSR-15 to Implement PSR-15 in MediaWiki.May 10 2018, 2:38 PM
Tgr added a subscriber: Tgr.May 10 2018, 2:59 PM

It is quite likely that the pursuit of this task is mutually exclusive with T140664 and T106099.

From a quick glance, middleware-based services seems appropiate for web servers, not web applications. The main reason being that it opens up the ability to implement arbitrary new entry points in a way that isn't statically exportable in a stateless pure-data way, which may conflict with the desire to have a centralised registry that can be exported and used for knowing in advance what route and view template will respond to a particular user request.

A middleware could technically define a new endpoint, but that's not typically how they are used; more typically they handle cross-cutting concerns and fulfill a similar role to e.g. request filters in RESTBase.

Also, nothing stops middleware that do define new endpoints from exporting them.

Vvjjkkii renamed this task from Implement PSR-15 in MediaWiki to i7caaaaaaa.Jul 1 2018, 1:10 AM
Vvjjkkii triaged this task as High priority.
Vvjjkkii updated the task description. (Show Details)
Vvjjkkii removed a subscriber: Aklapper.
Ankry renamed this task from i7caaaaaaa to Implement PSR-15 in MediaWiki.Jul 2 2018, 10:57 AM
Ankry raised the priority of this task from High to Needs Triage.
Ankry updated the task description. (Show Details)
Ankry added a subscriber: Aklapper.
Krinkle renamed this task from Implement PSR-15 in MediaWiki to Implement standard middleware interface in MediaWiki (PSR-15).Jul 28 2018, 8:45 PM