This file is indexed.

/usr/share/fusionforge/plugins/mediawiki/bin/mw-plugin-init.php is in fusionforge-plugin-mediawiki 6.0.5-2ubuntu1.

This file is owned by root:root, with mode 0o755.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
#! /usr/bin/php
<?php
/*
 * Copyright (C) 2010  Olaf Lenz
 *
 * This file is part of FusionForge.
 *
 * FusionForge is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * FusionForge is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along
 * with this program; if not, write to the Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 */

  /** This script will set up the structure required to use the
   mediawiki plugin.
  */

require_once dirname(__FILE__) . '/../../../www/env.inc.php';
require_once $gfcommon.'include/pre.php';

$echo_links = $argc >= 1;

$master_path = forge_get_config('master_path', 'mediawiki');
$projects_path = forge_get_config('projects_path', 'mediawiki');
$src_path = forge_get_config('src_path', 'mediawiki');

# create directories
if (!is_dir($projects_path)) {
	echo "Creating $projects_path...\n";
	mkdir($projects_path, 0755, true);
	chmod($projects_path, 0755);
}

if (!is_dir($master_path)) {
	echo "Creating $master_path...\n";
	mkdir($master_path, 0755, true);
	chmod($master_path, 0755);
}

function mysymlink($from, $to) {
	global $echo_links;
	if (!@symlink($from, $to)) {
		echo "Could not create symbolic link from $from to $to.\n";
	}
	if ($echo_links) {
		echo "$from $to\n";
	}
}

# install links in master
echo "Creating symlinks from $master_path to $src_path...\n";
if (!($dh = opendir($src_path))) {
	echo "Could not open mediawiki source directory $src_path!\n";
} else {
	$ignore_file = array(
		'.' => true,
		'..' => true,
		'config' => true,
		'skins' => true,
		'images' => true,
		'tests' => true,
		't' => true,
		);
	while ($file = readdir($dh)) {
		if (!isset($ignore_file[$file]) || !$ignore_file[$file]) {
			$from = "$src_path/$file";
			$to = "$master_path/$file";
			mysymlink($from, $to);
		}
	}
	closedir ($dh);
}

// link LocalSettings.php from forge_get_config('source_path')/plugins/mediawiki/etc/plugins/mediawiki/LocalSettings.php
$from = forge_get_config('source_path')."/plugins/mediawiki/www/LocalSettings.php";
$to = "$master_path/LocalSettings.php";
mysymlink($from, $to);

// create skin directory
$todir = "$master_path/skins";
if (!is_dir($todir)) {
	mkdir($todir);
}

// link FusionForge skin file
$fromdir = forge_get_config('source_path')."/plugins/mediawiki/mediawiki-skin";
$from = "$fromdir/FusionForge.php";
$to = "$todir/FusionForge.php";
mysymlink($from, $to);

// create skin subdir
$todir = "$todir/fusionforge";
if (!is_dir($todir))
	mkdir($todir);

// link fusionforge.css files
$fromdir = "$fromdir/fusionforge";
$from = "$fromdir/fusionforge.css";
$to = "$todir/fusionforge.css";
mysymlink($from, $to);

// link the rest of the files from monobook skin
$fromdir = "$src_path/skins/monobook";

$dh = opendir($fromdir);
$ignore_file = array(
	'.' => true,
	'..' => true,
	);
while ($file = readdir($dh)) {
	if (!isset($ignore_file[$file]) || !$ignore_file[$file]) {
		$from = "$fromdir/$file";
		$to = "$todir/$file";
		mysymlink($from, $to);
	}
}
closedir($dh);

// Local Variables:
// mode: php
// c-file-style: "bsd"
// End:

?>