Index | Files

package mediawiki

import ""

Package mediawiki provides access to MediaWiki installations to Go web servers via CGI.


Package Files



const (
    // Default PHP script to execute, if unspecified by the HTTP request.
    DirIndex = "index.php"

    // Default PHP CGI binary
    PHPExe = "php-cgi"

    // only execute PHP code from these directories (relative to
    // the mediawiki installation directory), but not from their
    // children.
    PHPWhitelistDirs = "/"

    // only serve static assets from these directories (relative
    // to the mediawiki installation directory) and from their
    // children, recursively.
    AssetWhitelistDirsRecursive = "/resources:/skins"

func New Uses

func New(root, urlprefix, php string) http.Handler

New returns a new HTTP handler that serves the mediawiki installed at root using the PHP CGI executable specified by php. The handler should be installed at urlprefix.

type MediaWiki Uses

type MediaWiki struct {
    Root      string // directory containing Mediawiki files
    URLPrefix string // the URL prefix used for accessing the wiki
    PHPExe    string // php-cgi executable

    // see the constants with the same name for a description of
    // these fields.
    PHPWhitelistDirs            []string
    AssetWhitelistDirsRecursive []string

A *MediaWiki is an http.Handler that serves a mediawiki instance.

func (*MediaWiki) ServeHTTP Uses

func (mw *MediaWiki) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP implements http.Handler.


After install, the server still allows access to the installer until restart.

Package mediawiki imports 5 packages (graph) and is imported by 1 packages. Updated 2018-02-21. Refresh now. Tools for package owners.