Page MenuHomePhabricator

Create template PHP application for use on Tool Labs based on Slim, Twig and Wikimedia libraries
Closed, ResolvedPublic

Description

Make a template PHP application based on the same stack used for the Wikimania Scholarships and IEG Grant review applications that could be easily forked to use as the base for a new tool on Tool Labs. Template should show how to use templates, i18n, logging and OAuth.

The final deliverable for this project is a bash.org style quips application running on Tool Labs using OAuth authentication control who can add new quips that is based on the template application.

Event Timeline

bd808 raised the priority of this task from to Needs Triage.
bd808 updated the task description. (Show Details)
bd808 added a project: User-bd808.
bd808 subscribed.
bd808 set Security to None.
bd808 added a subscriber: Niharika.

A possible starting point or source of inspiration can be toollabs-base.

While I'm not proud of it and I'd rather use composer and more standard and better maintained libraries, at the moment it does feature the following:

  • Caching layers (Memory, Filesystem, Redis).
  • Simple database abstraction (to interact with Labs wiki databases).
  • Easily make http requests and interact with the current web request/response.
  • Localisation via Intuition and translatewiki.net.
  • Debug mode to inspect queries and cache handling.
  • Ships: MediaWiki's GitInfo, Html and Sanitizer classes.
  • Good amount of test coverage via Travis CI.
  • Bootstrap v3 front-end with flexible footer for version/author/license/repo/issue-tracker information.

Examples: OrphanTalkmwSnapshotsIntuitionWikiInfoScript usage

I'd love to work with others and take it apart. Things like templates, logging and OAuth are big needs indeed. Personally I haven't needed OAuth in most tools, but when you do, it's really nice to have it built-in.

I'd love to work with others and take it apart. Things like templates, logging and OAuth are big needs indeed. Personally I haven't needed OAuth in most tools, but when you do, it's really nice to have it built-in.

That would be very interesting indeed. The Wikimania Scholarships and IEG Grant review applications that I have worked on were my intended starting point at least for extraction of some custom components common to the two application stacks (T90086). These apps are based on the Slim framework, use Twig for HTML and other templating, Monolog for logging, and SimpleI18n for localization. My primary goal for the hackathon is really to get T90086 accomplished so that the two apps can share their various common abstract and utility classes directly via a library (or libraries) rather than the current practice of adding features in one or the other and then occasionally trying to sync the functionality of the two apps. The addition of this task seemed a nice way to validate that the extracted libraries had some usefulness outside of the existing applications.

Note that core now has Lightncandy built in, you may want to use it.

Note that core now has Lightncandy built in, you may want to use it.

These apps aren't built on MediaWiki so what is or isn't in core doesn't make much difference. For both the apps I built with Twig, converting to a logicless templating system like Lightncandy would be a big pain in the butt. There would be a large number of helper methods to write to manage list iteration and common display concerns that are currently handled with native Twig constructs.

Please confirm and promote this activity by assigning it to its owner, listing it or scheduling it at the Hackathon wiki page and by placing it in the right column at Wikimania-Hackathon-2015. Thank you!

@bd808, are you planning to work on this task at Wikimania?

@bd808, are you planning to work on this task at Wikimania?

@Qgil it's a strong "maybe" right now. I will either work on this (and it's blocker task T90086) or I will work on the never ending epic of T88649. Or I will get sucked into helping with some more urgent project.

What is the status of this task, now that Wikimania 2015 is over? As this task is in the "Backlog" column of the Wikimania-Hackathon-2015 project's workboard: Did this task take place and was successfully finished? If yes: Please provide an update (and if the task is not completely finished yet, please move the project to the "Work continues after Mexico City" column on the Wikimania-Hackathon-2015 workboard). If no: Please edit this task by removing the Wikimania-Hackathon-2015 project from this task. Thanks for your help and keeping this task updated!

I didn't get to this one during Wikimania-Hackathon-2015. I'm going to keep it around though because it will happen one day! :)

valhallasw subscribed.

(Minor drive-by comment) Why Twig? MediaWiki core settled on mustache for client- and server-side HTML templating. The same templates working in PHP and JS is a win. The lightncandy PHP implementation is fast, and if you enable more compile flags you can use fancier template features from handlebars.

(Minor drive-by comment) Why Twig? MediaWiki core settled on mustache for client- and server-side HTML templating. The same templates working in PHP and JS is a win. The lightncandy PHP implementation is fast, and if you enable more compile flags you can use fancier template features from handlebars.

Twig because that is the library used by Wikimedia-Wikimania-Scholarships, Wikimedia-IEG-grant-review, http://tools.wmflabs.org/sal/, and http://tools.wmflabs.org/bash/. Those are all apps I wrote or helped write and independent of any MediaWiki infrastructure decisions.

The original goal of this task has been completed in the form of the https://tools.wmflabs.org/bash/ tool which has its source available at https://github.com/bd808/quips. A nice followup would be an on-wiki write up about the application I built and various strengths and weaknesses of the slimapp framework.