Hi, I have been researching how to implement
m.wikipedia.org landing page.
It should show the same output as
en.m.wikipedia.org/wiki/Special:Zero page,
except that it should be localized based on the carrier's default language.
Possible solutions:
* <VirtualHost> - map to docroot that contains the same mediawiki as
en.m.wikipedia.org. There should be a Rewrite rule that allows only ^/$ ->
wiki/Special:Zero; but all other paths will return 404.
* Magic hack - something similar to extract2.php that will first load zero
configuration, configure the language to use, then somehow execute the
whole mediawiki rendering for the special page, and lastly output the
rendered content.
Also, it might be needed to set proper MW_LANG before loading, but that
means some other code need to access memcached and make API call
I think #1 is better, please advise on how to switch the language and if we
should put up any defenses (like removing headers, rejecting non-GET
requests, etc).
Thanks.
On Tue, Nov 5, 2013 at 1:58 AM, Brion Vibber <bvibber(a)wikimedia.org> wrote:
Generally I agree that #1 is the way to go --
extract2.php is a nasty hack
and I'd hate for us to have to replicate it. :D
re: changing the language.... something within Zero extension should be
able to do that if you just need to change the _display_ language. If you
have to target it to a specific wiki.... I'd recommend doing that in the
rewrite rules if possible. But that don't sound easy to do. ;)
-- brion
On Mon, Nov 4, 2013 at 1:50 PM, Yuri Astrakhan <yastrakhan(a)wikimedia.org>wrote;wrote:
Brion,
I was thinking of how to do the new landing page better.
Needed:
m.wikipedia.org should show the same output as
en.m.wikipedia.org/wiki/Special:Zero page, except that it should be
localized based on the carrier's default language.
Possible solutions:
* <VirtualHost> - map to docroot that contains the same mediawiki as
en.m.wikipedia.org. There should be a Rewrite rule that allows only ^/$
-> wiki/Special:Zero; but all other paths will return 404. Also, I need
some "magic" code that dynamically changes the current language based on
the carrier's configuration.
* Magic hack - something similar to extract2.php that will first load
zero configuration, configure the language to use, then somehow execute the
whole mediawiki rendering for the special page, and lastly output the
rendered content.
I think #1 is better, please advise on how to switch the language and if
we should put up any defenses (like removing headers, rejecting non-GET
requests, etc).
Thanks.