Extension:WebStore

From MediaWiki.org

Jump to: navigation, search

     

Manual on MediaWiki Extensions
List of MediaWiki Extensions
Crystal Clear action run.png
WebStore

Release status: unknown

Implementation  User interface
Description Web-only (non-NFS) file storage middleware. It is needed by the ProofreadPage extension.
Author(s)  Tim Starling
License Any OSI approved license
Download SVN (browse)

check usage (experimental)

WebStore is intended to handle images and the generation of thumbnails in a multiple-server environment. It includes a web-server error 404 handler; if a thumbnail is requested that does not already exist on the local server, the request is forwarded to another server so that the thumbnail image may be automatically generated.

Communication between the multiple servers is based on WWW protocols (http) only.

The WebStore extension is needed by the ProofreadPage extension. Unfortunately, documentation seems to be missing completely. Please add anything you know about this extension here.

WebStore extends the FileStore.

[edit] Installation

  1. Copy all the files to extensions/WebStore
  2. Add require( "$IP/extensions/WebStore/WebStore.php" ); to your LocalSettings.php
  3. WebStore comes with a file called 404-handler.php. To be able to catch 404 events, it needs to be registered as a 404 handler.
    Using Apache, adding something like
    ErrorDocument 404 /extensions/WebStore/404-handler.php
    
    should work.
by example 

The root of your server is configured as following :

DocumentRoot /var/www/

the path of 404-handler.php

/var/www/wiki/extensions/WebStore/404-handler.php

the code will be

ErrorDocument 404 /wiki/extensions/WebStore/404-handler.php

With Apache, an other possibility is to use a rewrite rule. By example, you can add following lines in an Apache configuration file :

RewriteEngine On
RewriteRule ^/images/thumb(.*)\.(jpg|jpeg|png|gif)$ /extensions/WebStore/404-handler.php


You should also create a file called simple404.php like this:

<?php 
 
class Simple404 extends WebStoreCommon {
  function execute(){
    $this->htmlError( 404, 'webstore_404' ); 
  } 
} 
$h = new Simple404;
$h->execute();

and add the following line to LocalSettings.php, somewhere below require( "$IP/extensions/WebStore/WebStore.php" );:

$wgWebStoreSettings['fallback404'] = 'simple404.php';

This way, when an image is requested for the first time, it is directly sent to the browser (without sending a 404 status error code before the image file).