Extension:ViewFiles

The ViewFiles extension allows users to view the contents of a limited set of files made available by the system administrator. A possible use for this extension would be to enable your users to see the current contents of your configuration files (e.g. LocalSettings.php and InitialiseSettings.php) or customized skin files so that they could better assist with troubleshooting and make recommendations for configuration changes. Don't forget, if you're going to use this to display files such as LocalSettings.php that contain sensitive data, you'll want to get that data out of webroot before exposing those files to the world.

Installation
In current versions of MediaWiki, the SyntaxHighlight extension already is coming with the tarball of the MediaWiki Core. The files are located in folder extensions/SyntaxHighlight/.

Download ViewFiles

 * Download the latest version of ViewFiles
 * Create a folder in the extensions folder named ViewFiles
 * Move the files to the extensions/ViewFiles/ folder

Install SyntaxHighlight and ViewFiles
See Extension:SyntaxHighlight for information on how to set a default source language (optional; will not affect how files are displayed by ViewFiles).
 * Edit LocalSettings.php in the root of your MediaWiki installation, and add the following line near the bottom:

Configuration
The only required configuration setting is $wgViewFilesFilePathList.

$wgViewFilesIntro
What to begin the page with; e.g.

$wgViewFilesBegin
What to begin each file listing with; defaults to: $wgViewFilesBegin = ' '. "\n";

$wgViewFilesFileLangList
This list of filenames and associated languages overrides the extension lookup of the SyntaxHighlight extension. Defaults to:

$wgViewFilesFilePathList
Create a list of files and their paths, e.g.: