Skip to content

MediaWiki

Arnie97 edited this page Apr 17, 2021 · 9 revisions

MediaWiki

https://www.mediawiki.org

Tech Stack

PHP 7.3+

Platform

  • Commons android app (need further investigation)
  • A full set of documented APIs with lots of client libraries

Storage Model

MariaDB is recommended.

The files have to be uploaded to the MediaWiki site: https://www.mediawiki.org/wiki/Manual:Configuring_file_uploads

Whenever an image is uploaded, several things are created:

  1. An article in the file namespace with the name of the file, e.g. File:MyPicture.png. This page is stored and can be edited like any other page.
  2. The file itself is stored into the folder on the file system, which is configured in $wgUploadDirectory or into one if its subfolders (see below).
  3. If thumbnailing is available, thumbnailed versions of the file will be created when necessary (such as for the usage on the file description page. These are stored in the thumb directory of the image directory, in a separate directory for each main file. If $wgHashedUploadDirectory is enabled (by default), MediaWiki creates several subdirectories in the images directory. If $wgHashedUploadDirectory is set to true, uploaded files will be distributed into sub-directories of $wgUploadDirectory based on the first two characters of the md5 hash of the filename. (e.g. $IP/images/a/ab/foo.jpg) Creation of such subdirectories is handled automatically. This is used to avoid having too many files in one folder because some filesystems don't perform well with large numbers of files in one folder. If you only maintain a small wiki with few uploaded images, you could turn this off by setting $wgHashedUploadDirectory = false, all images are uploaded in $wgUploadDirectory itself. (e.g. $IP/images/foo.jpg)

Taxonomy

https://www.mediawiki.org/wiki/Help:Categories https://www.mediawiki.org/wiki/Manual:Categorylinks_table

Each page could be assigned with multiple categories, including category pages themselves.

The category pages themselves contain 2 parts: at their beginning, an optional part may contain text that can be edited, like any other page, at their end, an ever present, automatically generated, alphabetical list of all pages in that category, in the form of links. In fact, in the Unicode sort order.

EXIF metadata is shown at the bottom of the page (however too verbose).

File Formats

If the file is not visual (like an image or video) a icon is used instead of thumbnail.

Pros

  • Credible code quality
  • Clear API
  • A variety of plugins available
  • Multi-classification model
  • Support for non-image file formats
  • Interoperability with Wikipedia, Wikidata and other MediaWiki sites

Cons

  • Cannot run over a large set of existing files on a read-only partition? (not sure)
  • Not optimized for photo gallery use
Clone this wiki locally