Page MenuHomePhabricator

Add script_path to database
Open, LowPublic


Toolserver used to provide script_path as part of its meta database (T50626). I'd like the meta_p database to provide this as well.

Perhaps we can do it better by making it a full url (including protocol and domain) to discourage any string manipulation. For now it would default to {url}/w. (Note, no trailing slash - per MediaWiki convention).

Alternatively, we could go one step further and also discourage creation of other entry points by tools and instead encourage them to always query the API, by adding api_url instead (e.g. they shouldn't use script_path for other urls).

By only maintaining dbname, slice, api_url tools can boostrap everything they need. Fields lang and project would be good to keep for better discovery of related wikis without having to query 800 API endpoints. Everything else can be queried from the API endpoint (or, if not, should be added to the siteinfo API).

Even just auto-populating it with a meaningless {url}/w/api.php would make the separation of concerns closer to where it should be, so that at least it isn't duplicated in every single tool.

Event Timeline

Krinkle raised the priority of this task from to Needs Triage.
Krinkle updated the task description. (Show Details)
Krinkle added a project: Toolforge.
Krinkle added a subscriber: Krinkle.
scfc triaged this task as Low priority.Apr 6 2015, 7:28 AM
scfc added a subscriber: scfc.

Bytes are cheap; is it useful from a MediaWiki perspective to promote: "To reach the API, take $url and append $script_path and /api.php", or does it make more sense to say: "To reach the API, take $api_url, and for the REST API, take $restapi_url", etc.?

This comment was removed by Krinkle.
Krinkle renamed this task from Add script_path to database to Add api_url to database.Dec 22 2016, 11:51 PM
Krinkle updated the task description. (Show Details)

The place to add this would be

The schema change would be needed there plus new logic to populate the column(s) added. The script would probably also need to be extended to allow forcing the schema update by dropping the existing table.

I agree that it should be script_path and not api_url

Krinkle renamed this task from Add api_url to database to Add script_path to database.Sep 21 2017, 8:27 PM
Krinkle updated the task description. (Show Details)