Extension:PageServer

From MediaWiki.org

Jump to: navigation, search
Manual on MediaWiki Extensions
List of MediaWiki Extensions
PageServer

Release status: beta

Implementation other (invalid type)
Description
Author(s) Jean-Lou Dupont
Version @see SVN / tags
MediaWiki 1.10, 1.11, 1.12
Download SVN

Contents

[edit] Purpose

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 )

[edit] Features

  • 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' )

[edit] Usage

[edit] Parser Functions

  • {{#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)

[edit] Server to other extensions

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

[edit] Dependencies

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



[edit] Installation

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

[edit] LocalSettings.php

Extension:ExtensionManager: See footnote[2]

require_once( "$IP/extensions/PageServer/PageServer.php" );

[edit] PEAR

PEAR is a repository of 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

[edit] Upgrades through PEAR

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

[edit] PEAR Web Frontend

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.

[edit] RSS feed

To keep kept up-to-date with this channel, use the following RSS feedImage:Rss2.jpg.

[edit] Notes

[edit] Sandbox

You are invited in the author's sandbox to try-out some of his extensions.

[edit] Other Extensions From the same author

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

[edit] History

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
Personal tools
In other languages