Extension:FileManager

From MediaWiki.org

Jump to: navigation, search
Manual on MediaWiki Extensions
List of MediaWiki Extensions
FileManager

Release status: beta

Implementation User interface, Extended syntax
Description
Author(s) Jean-Lou Dupont
Version See SVN ($Id: FileManager.php 652 2007-08-12 14:24:43Z jeanlou.dupont $)
MediaWiki tested on 1.10 but probably works with a earlier versions
Download SVN

Contents

[edit] Purpose

This Mediawiki extension enables a user with the 'commitfile' right to edit files in the Mediawiki installation directory.

[edit] Features

  • Can be used independantly of BizzWiki environment
  • New rights: 'readfile', 'commitfile'
  • Logging
  • New Namespace 'NS_FILESYSTEM'
  • Support for titles beginning with small caps; need the title to be prefixed with '/'
    • e.g. to have access to 'includes/Setup.php' just reference the title 'Filesystem:/includes/Setup.php'
  • No auto summary upon page creation

[edit] DEPENDENCY

[edit] Notes

It is recommended to use:

$wgCapitalLinks = false;

in LocalSettings.php; default MediaWiki behavior is to capitalize title names - which does not help with filesystem behavior on certain operating systems.

[edit] NS_FILESYSTEM namespace

The namespace with for identifier NS_FILESYSTEM must be created in LocalSettings.php See Manual:Using_custom_namespaces for details. In short you could do:

 $wgExtraNamespaces[100] = "Filesystem";
 define("NS_FILESYSTEM", 100);
 $wgNamespaceProtection[NS_FILESYSTEM] = array( 'read' );
 $wgContentNamespaces[] = 100;

[edit] Usage

Visit a page on corresponding with a file located in the MediaWiki installation directory. E.g.

Filesystem:/includes/Article.php

[edit] History

  • fixed for 'wgCapitalLinks'
  • fixed for suppressing PHP error messages on file_get_contents
  • fixed logging messages
  • disabled 'auto summary' upon page creation (clogs recentchanges, logs etc.)
  • added 'reload' functionality
  • Added some protection against !isset indexes in '$wgExtensionCredits'
  • Added 'proprietary words' functionality
    • @@file@@ replaces for the current filename
    • @@mtime@@ replaces for the current filename last modification timestamp
    • @@currentmtime@@ replaces for the current extracted filename last modification timestamp
  • Removed extraneous '/' in the path name
  • Added 'parser phase 2' magic words:
    • ( ($#extractfile|@@file@@$) )  : extracts the filename returned through the proprietary word '@@file@@'
    • ( ($#extractmtime|@@mtime@@$) ) : extracts 'mtime' returned through the proprietary word '@@mtime@@'
  • EditFormPreload: added check for title both 'underscored' and not

[edit] TODO

  • internationalization
  • add 'edit from filesystem' functionality: capability to 'reload' a file from the filesystem
  • enhance 'logging' through $type etc.

[edit] Installation

  • Install Extension:StubManager extension
  • Download all the files from the SVN link
  • Place in a directory e.g. 'extensions/FileManager'
  • Place the following after 'StubManager' in LocalSettings.php
require('extensions/FileManager/FileManager.php');
Personal tools