Reading/Web

This page is for notes about rewriting the mobile site (e.g., http://en.m.wikipedia.org) in PHP. Patrick Reilly is currently leading the porting project.

Current implementation

 * Ruby!
 * http://github.com/hcatlin/wikimedia-mobile/

Rewrite rationale

 * Puts the code in our code repo rather than on github
 * Easier to review code in a language that most Wikimedia/MediaWiki developers are already using (PHP, instead of Ruby)
 * Easier on the ops team to maintain servers (most infrastructure is already built for PHP web apps, not Ruby web apps)
 * Allows for third parties to easily create mobile sites

Rewrite specifications

 * Written in PHP
 * Extensible for any MediaWiki installation
 * Support current Ruby-implemented API (mentioned on bug; where is this?)

Future implementation

 * Extension
 * A "mobile" skin

Possible Roadmap
A General Primer

With all of the different formats we have to support, there is a fairly simple system for correlating a Device with a Format with some specific actions to take based on that Format.

Process:
 * A request comes in from a mobile browser
 * The request generates a Device object
 * - Any method_missing that Device receives is looked up in the format specification


 * - The formats are specified in config/formats


 * An Article is fetched for that device
 * - First, the article figures out what kind of parser needed to be run on the page


 * - It then generates a key with that parser type.


 * - It then checks to see if that has been cached


 * - If it is not cached, it grabs scrapes the Wikipedia page and processes it with some parsers/* class


 * - If it is cached, it returns that cached object


 * The layout is generated with the returned Article#html
 * - The device format is used heavily here (aka, "= current_device.stylesheet_name")


 * - An "app/views/layouts/_search_#{format}.html" file is rendered in the search area


 * - Changes in the search box and CSS fields are the most different between formats


 * Port WikiMedia Mobile Project (from Ruby to PHP)


 * * Implement (html, json, wml) views for (file, home, image, show)


 * — Time Estimate: 12 Hours


 * * Implement (footer menu, search, basic application) layouts


 * — Time Estimate: 10 Hours


 * * Implement (image, wml, xhtml) parsers for content


 * — Time Estimate: 20 Hours


 * * Create models for (article, device, image, [other resource])


 * — Time Estimate: 10 Hours


 * * Create articles controller or equivalent [if not MVC] (including helpers, etc.)


 * — Time Estimate: 12 Hours


 * * Implement server resource retrieval and caching support


 * — Time Estimate: 8 Hours


 * * Implement formats list (view format e.g., html, etc., javascript support, layout)


 * — Time Estimate: 8 Hours


 * * Convert translation support for various global strings


 * — Time Estimate: 8 Hours


 * * Create global exception handling support


 * — Time Estimate: 4 Hours


 * * Implement basic logging and statistics support


 * — Time Estimate: 6 Hours


 * * Create device and format based css (e.g., iphone, nokia, firefox, blackberry, etc.)


 * — Time Estimate: 8 Hours


 * Current Total Time Estimate: 106 Hours