disabled via disable_functions in php.ini (bug #928168)
The PHPTal skin doesn't function unless the PEAR bits are in include_path,
so it's disabled if ini_set can't be used. If the files are manually placed
or a real PEAR installation is available with the right stuff, one can
use $wgUsePHPTal = true;
There are likely other things that need to be taken into account for
restricted environments. Maintenance scripts haven't been tweaked for
such an environment yet either.
<div id="credit">
<center>
<a href="http://www.mediawiki.org/"><img
<div id="credit">
<center>
<a href="http://www.mediawiki.org/"><img
- src="../images/wiki.png" width="135" height="135" alt="" border="0" /></a>
+ src="../stylesheets/images/wiki.png" width="135" height="135" alt="" border="0" /></a>
</center>
<b><a href="http://www.mediawiki.org/">MediaWiki</a></b> is
</center>
<b><a href="http://www.mediawiki.org/">MediaWiki</a></b> is
<?php
$IP = ".."; # Just to suppress notices, not for anything useful
<?php
$IP = ".."; # Just to suppress notices, not for anything useful
-include( "../includes/DefaultSettings.php" );
+define( "MEDIAWIKI", true );
+define( "MEDIAWIKI_INSTALL", true );
+require( "../includes/DefaultSettings.php" );
?>
<h1>MediaWiki <?php print $wgVersion ?> installation</h1>
?>
<h1>MediaWiki <?php print $wgVersion ?> installation</h1>
-include( "../install-utils.inc" );
-include( "../maintenance/updaters.inc" );
+require( "../install-utils.inc" );
+require( "../maintenance/updaters.inc" );
class ConfigData {
function getEncoded( $data ) {
# Hackish
class ConfigData {
function getEncoded( $data ) {
# Hackish
chdir( "config" );
print "<li>Installation directory: <tt>" . htmlspecialchars( $conf->IP ) . "</tt></li>\n";
chdir( "config" );
print "<li>Installation directory: <tt>" . htmlspecialchars( $conf->IP ) . "</tt></li>\n";
+@$oldpath = ini_set( "include_path", ini_get( "include_path" ) );
+if( empty( $oldpath ) ) {
+ print "<li>Can't set <tt>include_path</tt>; new template layout will be disabled.</li>\n";
+}
+
# $conf->ScriptPath = "/~brion/inplace";
$conf->ScriptPath = preg_replace( '{^(.*)/config.*$}', '$1', $_SERVER["REQUEST_URI"] );
print "<li>Script URI path: <tt>" . htmlspecialchars( $conf->ScriptPath ) . "</tt></li>\n";
# $conf->ScriptPath = "/~brion/inplace";
$conf->ScriptPath = preg_replace( '{^(.*)/config.*$}', '$1', $_SERVER["REQUEST_URI"] );
print "<li>Script URI path: <tt>" . htmlspecialchars( $conf->ScriptPath ) . "</tt></li>\n";
/* Load up the settings and get installin' */
$local = writeLocalSettings( $conf );
$wgCommandLineMode = false;
/* Load up the settings and get installin' */
$local = writeLocalSettings( $conf );
$wgCommandLineMode = false;
$wgDBadminuser = $wgDBuser;
$wgDBadminpassword = $wgDBpassword;
$wgCommandLineMode = true;
$wgUseDatabaseMessages = false; /* FIXME: For database failure */
$wgDBadminuser = $wgDBuser;
$wgDBadminpassword = $wgDBpassword;
$wgCommandLineMode = true;
$wgUseDatabaseMessages = false; /* FIXME: For database failure */
- require_once( "Setup.php" );
+ require_once( "includes/Setup.php" );
+ chdir( "config" );
+
require_once( "../maintenance/InitialiseMessages.inc" );
$wgTitle = Title::newFromText( "Installation script" );
require_once( "../maintenance/InitialiseMessages.inc" );
$wgTitle = Title::newFromText( "Installation script" );
# recreate them later.
\$IP = \"{$conf->IP}\";
# recreate them later.
\$IP = \"{$conf->IP}\";
-ini_set( \"include_path\", \"\$IP/includes$sep\$IP/languages$sep\" . ini_get(\"include_path\") );
-require_once( \"DefaultSettings.php\" );
+require_once( \"includes/DefaultSettings.php\" );
if ( \$wgCommandLineMode ) {
if ( isset( \$_SERVER ) && array_key_exists( 'REQUEST_METHOD', \$_SERVER ) ) {
if ( \$wgCommandLineMode ) {
if ( isset( \$_SERVER ) && array_key_exists( 'REQUEST_METHOD', \$_SERVER ) ) {
\$wgMathDirectory = \"{\$wgUploadDirectory}/math\";
\$wgTmpDirectory = \"{\$wgUploadDirectory}/tmp\";
\$wgMathDirectory = \"{\$wgUploadDirectory}/math\";
\$wgTmpDirectory = \"{\$wgUploadDirectory}/tmp\";
-\$wgUsePHPTal = true;
-if ( \$wgUsePHPTal ) {
- ini_set( \"include_path\", \"\$IP/PHPTAL-NP-0.7.0/libs$sep\" . ini_get(\"include_path\") );
-}
-
\$wgLocalInterwiki = \$wgSitename;
\$wgLanguageCode = \"{$conf->LanguageCode}\";
\$wgLocalInterwiki = \$wgSitename;
\$wgLanguageCode = \"{$conf->LanguageCode}\";
$wgLanguageCode = "xxx";
function wfLocalUrl( $x ) { return $x; }
function wfLocalUrlE( $x ) { return $x; }
$wgLanguageCode = "xxx";
function wfLocalUrl( $x ) { return $x; }
function wfLocalUrlE( $x ) { return $x; }
- include( "../languages/Language.php" );
+ require( "../languages/Language.php" );
$wgUseImageMagick = false;
$wgImageMagickConvertCommand = "/usr/bin/convert";
$wgUseImageMagick = false;
$wgImageMagickConvertCommand = "/usr/bin/convert";
-# Make sure include_path is set correctly
+# PHPTal needs a PEAR directory in the include_path. If we can't change the
+# include_path (such as on free.fr and other hosts) we may have to disable it.
+$pathchange = @ini_set( "include_path", "PHPTAL-NP-0.7.0/libs:" . ini_get("include_path") );
+if( empty( $pathchange ) ) {
+ # Can't fix path! User can manually enable it again if they put the files
+ # in an appropriate place.
+ $wgUsePHPTal = false;
+}
+
if( !isset( $wgCommandLineMode ) ) {
$wgCommandLineMode = false;
if( !isset( $wgCommandLineMode ) ) {
$wgCommandLineMode = false;
require_once('Tokenizer.php');
if( $GLOBALS['wgUseWikiHiero'] ){
require_once('Tokenizer.php');
if( $GLOBALS['wgUseWikiHiero'] ){
- require_once('wikihiero.php');
+ require_once('extensions/wikihiero/wikihiero.php');
}
if( $GLOBALS['wgUseTimeline'] ){
require_once('extensions/timeline/Timeline.php');
}
if( $GLOBALS['wgUseTimeline'] ){
require_once('extensions/timeline/Timeline.php');
$wgRequest = new WebRequest();
$wgRequest = new WebRequest();
wfProfileOut( "$fname-includes" );
wfProfileIn( "$fname-memcached" );
global $wgUser, $wgLang, $wgOut, $wgTitle;
wfProfileOut( "$fname-includes" );
wfProfileIn( "$fname-memcached" );
global $wgUser, $wgLang, $wgOut, $wgTitle;
wfProfileOut( "$fname-memcached" );
wfProfileIn( "$fname-misc" );
wfProfileOut( "$fname-memcached" );
wfProfileIn( "$fname-misc" );
-require_once( "Language.php" );
+require_once( "languages/Language.php" );
$wgMessageCache = new MessageCache;
$wgLangClass = "Language" . ucfirst( $wgLanguageCode );
if( ! class_exists( $wgLangClass ) || ($wgLanguageCode == "en" && strcasecmp( $wgInputEncoding, "utf-8" ) == 0 ) ) {
$wgMessageCache = new MessageCache;
$wgLangClass = "Language" . ucfirst( $wgLanguageCode );
if( ! class_exists( $wgLangClass ) || ($wgLanguageCode == "en" && strcasecmp( $wgInputEncoding, "utf-8" ) == 0 ) ) {
- require_once( "LanguageUtf8.php" );
+ require_once( "languages/LanguageUtf8.php" );
$wgLangClass = "LanguageUtf8";
}
$wgLangClass = "LanguageUtf8";
}
wfProfileOut( "$fname-misc" );
wfProfileOut( $fname );
wfProfileOut( "$fname-misc" );
wfProfileOut( $fname );
$wgRequestTime = microtime();
unset( $IP );
$wgRequestTime = microtime();
unset( $IP );
-ini_set( "allow_url_fopen", 0 ); # For security...
+@ini_set( "allow_url_fopen", 0 ); # For security...
if(!file_exists("LocalSettings.php")) {
die( "You'll have to <a href='config/index.php'>set the wiki up</a> first!" );
}
if(!file_exists("LocalSettings.php")) {
die( "You'll have to <a href='config/index.php'>set the wiki up</a> first!" );
}
-require_once( "./LocalSettings.php" );
-
-if( $wgSitename == "MediaWiki" ) {
- die( "You must set the site name in \$wgSitename before installation.\n\n" );
-}
-# PATH_SEPARATOR avaialble only from 4.3.0
-$sep = (DIRECTORY_SEPARATOR == "\\") ? ";" : ":";
-ini_set( "include_path", $IP . $sep . ini_get( "include_path" ) );
-
-require_once( "Setup.php" );
+define( "MEDIAWIKI", true );
+require_once( "./LocalSettings.php" );
+require_once( "includes/Setup.php" );
wfProfileIn( "main-misc-setup" );
OutputPage::setEncodings(); # Not really used yet
wfProfileIn( "main-misc-setup" );
OutputPage::setEncodings(); # Not really used yet
switch( $wgTitle->getNamespace() ) {
case NS_IMAGE:
switch( $wgTitle->getNamespace() ) {
case NS_IMAGE:
- require_once( "ImagePage.php" );
+ require_once( "includes/ImagePage.php" );
$wgArticle = new ImagePage( $wgTitle );
break;
default:
$wgArticle = new ImagePage( $wgTitle );
break;
default:
if( !$wgEnableDublinCoreRdf ) {
wfHttpError( 403, "Forbidden", wfMsg( "nodublincore" ) );
} else {
if( !$wgEnableDublinCoreRdf ) {
wfHttpError( 403, "Forbidden", wfMsg( "nodublincore" ) );
} else {
- require_once( "Metadata.php" );
+ require_once( "includes/Metadata.php" );
wfDublinCoreRdf( $wgArticle );
}
break;
wfDublinCoreRdf( $wgArticle );
}
break;
if( !$wgEnableCreativeCommonsRdf ) {
wfHttpError( 403, "Forbidden", wfMsg("nocreativecommons") );
} else {
if( !$wgEnableCreativeCommonsRdf ) {
wfHttpError( 403, "Forbidden", wfMsg("nocreativecommons") );
} else {
- require_once( "Metadata.php" );
+ require_once( "includes/Metadata.php" );
wfCreativeCommonsRdf( $wgArticle );
}
break;
wfCreativeCommonsRdf( $wgArticle );
}
break;
if( !$wgCommandLineMode && !$wgRequest->checkSessionCookie() ) {
User::SetupSession();
}
if( !$wgCommandLineMode && !$wgRequest->checkSessionCookie() ) {
User::SetupSession();
}
- require_once( "EditPage.php" );
+ require_once( "includes/EditPage.php" );
$editor = new EditPage( $wgArticle );
$editor->$action();
break;
$editor = new EditPage( $wgArticle );
$editor->$action();
break;
if ($_SERVER["REQUEST_URI"] == $wgTitle->getInternalURL('action=history')) {
$wgOut->setSquidMaxage( $wgSquidMaxage );
}
if ($_SERVER["REQUEST_URI"] == $wgTitle->getInternalURL('action=history')) {
$wgOut->setSquidMaxage( $wgSquidMaxage );
}
- require_once( "PageHistory.php" );
+ require_once( "includes/PageHistory.php" );
$history = new PageHistory( $wgArticle );
$history->history();
break;
case "raw":
$history = new PageHistory( $wgArticle );
$history->history();
break;
case "raw":
- require_once( "RawPage.php" );
+ require_once( "includes/RawPage.php" );
$raw = new RawPage( $wgArticle );
$raw->view();
break;
$raw = new RawPage( $wgArticle );
$raw->view();
break;
+if( defined( "MEDIAWIKI" ) ) {
$wgInputEncoding = "utf-8";
$wgOutputEncoding = "utf-8";
$wgInputEncoding = "utf-8";
$wgOutputEncoding = "utf-8";
$wikiLowerChars = $wgMemc->get( $key2 = "$wgDBname:utf8:lower" );
if(empty( $wikiUpperChars) || empty($wikiLowerChars )) {
$wikiLowerChars = $wgMemc->get( $key2 = "$wgDBname:utf8:lower" );
if(empty( $wikiUpperChars) || empty($wikiLowerChars )) {
- require_once( "Utf8Case.php" );
+ require_once( "includes/Utf8Case.php" );
$wgMemc->set( $key1, $wikiUpperChars );
$wgMemc->set( $key2, $wikiLowerChars );
}
$wgMemc->set( $key1, $wikiUpperChars );
$wgMemc->set( $key2, $wikiLowerChars );
}