Extension:PageServer

From MediaWiki.org
Jump to: navigation, search
MediaWiki extensions manual - list
Crystal Clear action run.png
PageServer

Release status: beta

Implementation other (invalid type)
Description
Author(s) Jean-Lou Dupont
Last version @see SVN / tags
MediaWiki 1.10, 1.11, 1.12
License No license specified
Download SVN
Check usage and version matrix

Contents

Purpose [edit]

Provides:

  • Page loading facility to other extensions
  • Parser functions (#mwmsg, #mwmsgx) and services to other extensions ( 'loadAndParse' )
  • Hooks:
    • Local page: page_server( &$prefix, &$name, &$result, &$id )
    • Remote page: page_remote( &$uri, &$page, &$etag, &$source, &$state, $expiry = null )

Features [edit]

  • Page loading hook: page_server, page_remote
  • Local Page loading from (in priority):
    • Parser Cache
    • Database
    • PEAR directory (/$pear/MediaWiki)
    • MediaWiki extensions directory in local installation
  • Remote Page loading from (in priority):
    • Cache
    • Remote HTTP URI
  • Page loading parser function: #load_page
  • On-demand loading of wiki page from filesystem
  • Optional parsing (with the MediaWiki parser) of the wiki page
    • All stock & extended functionality (i.e. through parser functions, parser tags) available during parsing phase
  • Parser functions:
    • #mwmsg ( 'MediaWiki Message' )
    • #mwmsgx ( 'MediaWiki Message with parameters' )

Usage [edit]

Parser Functions [edit]

  • {{#mwmsg:msg id}} will output the raw message from the message cache
  • {{#mwmsgx:msg id [|p1][|p2][|p3][|p4]}} will output the parsed message from the message cache

including up to 4 parameters (i.e. the $n parameters when using 'wfMsgForContent' global function)

Server to other extensions [edit]

  • Use PageServer::XYZ where XYZ is the desired function name.
  • Use wfRunHooks: page_server

Dependencies [edit]

  • Extension:StubManager
  • PEAR package "HTTP/Request" is optional but required if "page_remote" hook is to be used



Installation [edit]

See the Mediawiki Extension table entry "download" above.[1]

LocalSettings.php [edit]

Extension:ExtensionManager: See footnote[2]

require_once( "$IP/extensions/PageServer/PageServer.php" );
  • Since this Extensions is depending on StubManager, add the line after the StubManager include, or else your Wiki won't work.

PEAR [edit]

PEAR is a repository of PHP software code.

pear channel-discover mediawiki.googlecode.com/svn
  • Install extension through PEAR:
pear install mediawiki/PageServer
  • Add the following to LocalSettings.php[2][3]:
require 'MediaWiki/PageServer/PageServer.php';
  • Note that the required version of PEAR must be respected. Currently, the minimum version of PEAR usable with this channel is v1.6.2. Perform the following command to upgrade to the latest version of PEAR:
pear upgrade pear

Upgrades through PEAR [edit]

Sometimes, it is necessary to clear PEAR's cache in order to perform upgrades.

pear clear-cache

or use the force method:

pear upgrade --force mediawiki/PageServer

PEAR Web Frontend [edit]

For easier remote package management, PEAR Frontend WEB can be installed. Installation notes can be found here. An example of the WEB frontend is available here.

RSS feed [edit]

To keep up-to-date with this channel, use the following RSS feed__Rss2.jpg.

Notes [edit]

Other Extensions From the same author [edit]

Consult User Jldupont's page.


  1. The most recent release is always available through the extension's PEAR and SVN repositories. This page is not necessarily up-to-date.
  2. 2.0 2.1 2.2 Extension:ExtensionManager does not require any modification to LocalSettings.php because ExtensionManager includes the extension.
    Note that if PHP code caching is in place (e.g. APC, eAccelerator), then to successfully complete the installation a cache flush might be needed.
  3. Modifications to LocalSettings.php is only necessary if not using Extension:ExtensionManager

History [edit]

Release Notes
2.0.0 Fully redesigned version
2.0.1 Fixed parser cache related bug
2.1.0 Added support for page identifier (modification timestamp)
2.2.0 Added remote page loading hook page_remote with caching