View | Details | Raw Unified | Return to bug 22426
Collapse All | Expand All

(-)./index.php.commoncode (+3 lines)
Lines 36-41 Link Here
36
 * @file
36
 * @file
37
 */
37
 */
38
38
39
$DIR=getcwd();
40
chdir('/usr/share/mediawiki');
41
39
42
40
# Initialise common code
43
# Initialise common code
41
$preIP = dirname( __FILE__ );
44
$preIP = dirname( __FILE__ );
(-)./config/index.php.commoncode (-6 / +8 lines)
Lines 19-24 Link Here
19
# 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
19
# 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
20
# http://www.gnu.org/copyleft/gpl.html
20
# http://www.gnu.org/copyleft/gpl.html
21
21
22
$DIR=dirname( getcwd() );
23
chdir('/usr/share/mediawiki/config');
22
error_reporting( E_ALL );
24
error_reporting( E_ALL );
23
header( "Content-type: text/html; charset=utf-8" );
25
header( "Content-type: text/html; charset=utf-8" );
24
@ini_set( "display_errors", true );
26
@ini_set( "display_errors", true );
Lines 27-33 Link Here
27
$wgRequestTime = microtime( true );
29
$wgRequestTime = microtime( true );
28
30
29
# Attempt to set up the include path, to fix problems with relative includes
31
# Attempt to set up the include path, to fix problems with relative includes
30
$IP = dirname( dirname( __FILE__ ) );
32
$IP = '/usr/share/mediawiki';
31
define( 'MW_INSTALL_PATH', $IP );
33
define( 'MW_INSTALL_PATH', $IP );
32
34
33
# Define an entry point and include some files
35
# Define an entry point and include some files
Lines 218-235 Link Here
218
220
219
/* Check for existing configurations and bug out! */
221
/* Check for existing configurations and bug out! */
220
222
221
if( file_exists( "../LocalSettings.php" ) ) {
223
if( file_exists( "$DIR/LocalSettings.php" ) ) {
222
	$script = defined('MW_INSTALL_PHP5_EXT') ? 'index.php5' : 'index.php';
224
	$script = defined('MW_INSTALL_PHP5_EXT') ? 'index.php5' : 'index.php';
223
	dieout( "<p><strong>Setup has completed, <a href='../$script'>your wiki</a> is configured.</strong></p>
225
	dieout( "<p><strong>Setup has completed, <a href='../$script'>your wiki</a> is configured.</strong></p>
224
	<p>Please delete the /config directory for extra security.</p>" );
226
	<p>Please delete the /config directory for extra security.</p>" );
225
}
227
}
226
228
227
if( file_exists( "./LocalSettings.php" ) ) {
229
if( file_exists( "$DIR/LocalSettings.php" ) ) {
228
	writeSuccessMessage();
230
	writeSuccessMessage();
229
	dieout( '' );
231
	dieout( '' );
230
}
232
}
231
233
232
if( !is_writable( "." ) ) {
234
if( !is_writable( $DIR . "/config" ) ) {
233
	dieout( "<h2>Can't write config file, aborting</h2>
235
	dieout( "<h2>Can't write config file, aborting</h2>
234
236
235
	<p>In order to configure the wiki you have to make the <tt>config</tt> subdirectory
237
	<p>In order to configure the wiki you have to make the <tt>config</tt> subdirectory
Lines 1213-1219 Link Here
1213
		$localSettings = "<" . "?php$endl$local";
1215
		$localSettings = "<" . "?php$endl$local";
1214
		// Fix up a common line-ending problem (due to CVS on Windows)
1216
		// Fix up a common line-ending problem (due to CVS on Windows)
1215
		$localSettings = str_replace( "\r\n", "\n", $localSettings );
1217
		$localSettings = str_replace( "\r\n", "\n", $localSettings );
1216
		$f = fopen( "LocalSettings.php", 'xt' );
1218
		$f = fopen( $DIR . "/config/LocalSettings.php", 'xt' );
1217
1219
1218
		if( $f == false ) {
1220
		if( $f == false ) {
1219
			print( "</li>\n" );
1221
			print( "</li>\n" );
Lines 1776-1782 Link Here
1776
if( defined( 'MW_INSTALL_PATH' ) ) {
1778
if( defined( 'MW_INSTALL_PATH' ) ) {
1777
	\$IP = MW_INSTALL_PATH;
1779
	\$IP = MW_INSTALL_PATH;
1778
} else {
1780
} else {
1779
	\$IP = dirname( __FILE__ );
1781
	\$IP = '/usr/share/mediawiki';
1780
}
1782
}
1781
1783
1782
\$path = array( \$IP, \"\$IP/includes\", \"\$IP/languages\" );
1784
\$path = array( \$IP, \"\$IP/includes\", \"\$IP/languages\" );
(-)./maintenance/commandLine.inc.commoncode (-2 / +2 lines)
Lines 175-181 Link Here
175
	if ( isset( $options['conf'] ) ) {
175
	if ( isset( $options['conf'] ) ) {
176
		$settingsFile = $options['conf'];
176
		$settingsFile = $options['conf'];
177
	} else {
177
	} else {
178
		$settingsFile = "$IP/LocalSettings.php";
178
		$settingsFile = "$DIR/LocalSettings.php";
179
	}
179
	}
180
	if ( isset( $options['wiki'] ) ) {
180
	if ( isset( $options['wiki'] ) ) {
181
		$bits = explode( '-', $options['wiki'] );
181
		$bits = explode( '-', $options['wiki'] );
Lines 201-207 Link Here
201
201
202
	$adminSettings = isset( $options['aconf'] )
202
	$adminSettings = isset( $options['aconf'] )
203
		? $options['aconf']
203
		? $options['aconf']
204
		: "{$IP}/AdminSettings.php";
204
		: "{$DIR}/AdminSettings.php";
205
	if( is_readable( $adminSettings ) )
205
	if( is_readable( $adminSettings ) )
206
		require_once( $adminSettings );
206
		require_once( $adminSettings );
207
207
(-)./maintenance/update.php.commoncode (+3 lines)
Lines 10-15 Link Here
10
 * @ingroup Maintenance
10
 * @ingroup Maintenance
11
 */
11
 */
12
12
13
$DIR=getcwd();
14
chdir('/usr/share/mediawiki');
15
13
/** */
16
/** */
14
$wgUseMasterForMaintenance = true;
17
$wgUseMasterForMaintenance = true;
15
$options = array( 'quick', 'nopurge' );
18
$options = array( 'quick', 'nopurge' );
(-)./maintenance/archives/upgradeWatchlist.php.commoncode (-1 / +1 lines)
Lines 15-21 Link Here
15
# Convert watchlists to new format
15
# Convert watchlists to new format
16
16
17
global $IP;
17
global $IP;
18
require_once( "../LocalSettings.php" );
18
require_once( "$DIR/LocalSettings.php" );
19
require_once( "$IP/Setup.php" );
19
require_once( "$IP/Setup.php" );
20
20
21
$wgTitle = Title::newFromText( "Rebuild links script" );
21
$wgTitle = Title::newFromText( "Rebuild links script" );
(-)./includes/WebStart.php.commoncode (-2 / +2 lines)
Lines 103-116 Link Here
103
	# LocalSettings.php is the per site customization file. If it does not exit
103
	# LocalSettings.php is the per site customization file. If it does not exit
104
	# the wiki installer need to be launched or the generated file moved from
104
	# the wiki installer need to be launched or the generated file moved from
105
	# ./config/ to ./
105
	# ./config/ to ./
106
	if( !file_exists( "$IP/LocalSettings.php" ) ) {
106
	if( !file_exists( "$DIR/LocalSettings.php" ) ) {
107
		require_once( "$IP/includes/DefaultSettings.php" ); # used for printing the version
107
		require_once( "$IP/includes/DefaultSettings.php" ); # used for printing the version
108
		require_once( "$IP/includes/templates/NoLocalSettings.php" );
108
		require_once( "$IP/includes/templates/NoLocalSettings.php" );
109
		die();
109
		die();
110
	}
110
	}
111
111
112
	# Include site settings. $IP may be changed (hopefully before the AutoLoader is invoked)
112
	# Include site settings. $IP may be changed (hopefully before the AutoLoader is invoked)
113
	require_once( "$IP/LocalSettings.php" );
113
	require_once( "$DIR/LocalSettings.php" );
114
}
114
}
115
wfProfileOut( 'WebStart.php-conf' );
115
wfProfileOut( 'WebStart.php-conf' );
116
116
(-)./includes/templates/NoLocalSettings.php.commoncode (-1 / +1 lines)
Lines 58-64 Link Here
58
		<h1>MediaWiki <?php echo htmlspecialchars( $wgVersion ) ?></h1>
58
		<h1>MediaWiki <?php echo htmlspecialchars( $wgVersion ) ?></h1>
59
		<div class='error'>
59
		<div class='error'>
60
		<?php
60
		<?php
61
		if ( file_exists( 'config/LocalSettings.php' ) ) {
61
		if ( file_exists( $DIR . '/config/LocalSettings.php' ) ) {
62
			echo( 'To complete the installation, move <tt>config/LocalSettings.php</tt> to the parent directory.' );
62
			echo( 'To complete the installation, move <tt>config/LocalSettings.php</tt> to the parent directory.' );
63
		} else {
63
		} else {
64
			echo( "Please <a href=\"" . htmlspecialchars( $path ) . "config/index." . htmlspecialchars( $ext ) . "\" title='setup'> set up the wiki</a> first." );
64
			echo( "Please <a href=\"" . htmlspecialchars( $path ) . "config/index." . htmlspecialchars( $ext ) . "\" title='setup'> set up the wiki</a> first." );

Return to bug 22426