Bücher online kostenlos Kostenlos Online Lesen
Working With MediaWiki

Working With MediaWiki

Titel: Working With MediaWiki
Autoren: Yaron Koren
Vom Netzwerk:
easily later on. But if you don’t have Git, you can get the code from here:
https://www.mediawiki.org/wiki/Download_from_Git#Download
    When MediaWiki is downloaded as a tarball, it comes pre-bundled with six extensions, contained in the
/extensions
directory: ConfirmEdit, Gadgets, Nuke, ParserFunctions, Renameuser, Vector and WikiEditor. All of these will be discussed in some detail later in the book.
    If you have Git installed (and it’s at least version 1.7), you can download MediaWiki with the following call:
git clone https://gerrit.wikimedia.org/r/p/mediawiki/core.git
    This will create a directory named “core”, which you can (and should) then rename.

Setting the logo
    Most, though not all, of MediaWiki’s skins include a spot for a logo, at the top left-hand corner of the screen (or top right-hand, if the wiki is in a right-to-left language). In MediaWiki, the logo is the customary way to individualize one’s wiki — for better or worse, most skins don’t display the name of the wiki anywhere on the page (other than indirectly at the bottom, in the “About ___” link). So the logo should show the name of the wiki, and ideally some representative graphic — though that part is strictly optional; it’s much better to have a logo that just states the wiki name than no logo at all.
    MediaWiki wikis do have a default logo, which is a grayed-out MediaWiki sunflower logo with the words “Set $wgLogo to the URL path to your own logo image” over it. As the instructions say, all you need to do is set a new value for $wgLogo in your LocalSettings.php file. The logo image can be located either within the MediaWiki directory, or at some arbitrary URL. By default, it’s located at /skins/common/images/wiki.png — you shouldn’t replace that file with your logo image, because then you run the risk of it being overwritten when you update the MediaWiki code.

Changing the URL structure
    By default, MediaWiki URLs appear in a format like:
mywiki.com/mediawiki/index.php?title=Main_Page
    However, the preferred format is something more like:
mywiki.com/wiki/Main_Page
    This is the format that Wikipedia and other Wikimedia sites use. The “wiki” directory can have any name, though “wiki” makes sense for obvious reasons.
    There are various approaches to changing the URL format, based primarily on whether you have root access on the server on which the wiki resides. You can see all the steps required for the various approaches here:
https://www.mediawiki.org/wiki/Manual:Short_URL
    We’ll just note that there are some cases when users want to have a URL structure that looks simply like:
mywiki.com/Main_Page
    It’s certainly a clean-looking URL, but this is not recommended, because, among other reasons, it means that your server can’t have helper files like robots.txt and favicon.ico. You can see a longer discussion of this approach here:
https://www.mediawiki.org/wiki/Manual:Wiki_in_site_root_directory
    Finally, you can also change the name of the start page, which by default is (in English) “Main Page”, by changing the contents of the page “MediaWiki:mainpage”. This is an example of interface text editable via the wiki, of which there are hundreds of examples — see here for a complete description.

Updating MediaWiki
    As new versions of MediaWiki come out, you’re generally advised to keep updating to the latest version — there are always bug fixes, interface improvements, and interesting new features. It’s generally pretty easy to update, though it depends on whether you’re using Git or not. If you are, you can just run a “git pull” in the directory housing your MediaWiki code. Then, you’ll need to call the script “update.php”, located in MediaWiki’s /maintenance directory — it goes through the database and adds or modifies database tables to fit the new DB schema for this version. update.php tends to work very well — it even works when upgrading from extremely old versions.
    If you’re downloading the new MediaWiki version as a package, instead of via Git, then you’ll need to move the /images directory, the /extensions directory (or at least parts of it), and LocalSettings.php into this new directory, and rename both it and the old MediaWiki directory so that the wiki URL will now point to this one. As before, you’ll need to call update.php.
    And if you’re using any extensions besides the ones that come pre-bundled with MediaWiki, then you might have to get the
Vom Netzwerk:

Weitere Kostenlose Bücher