Go to the documentation of this file.
118 'envCheckRegisterGlobals',
120 'envCheckMagicQuotes',
121 'envCheckMagicSybase',
128 'envCheckModSecurity',
135 'envCheckShellLocale',
136 'envCheckUploadsDirectory',
138 'envCheckSuhosinMaxValueLength',
162 'wgEmailAuthentication',
165 'wgImageMagickConvertCommand',
171 'wgDeletedDirectory',
175 'wgUseInstantCommons',
178 'wgResourceLoaderMaxQueryLength',
190 '_Environment' =>
false,
191 '_SafeMode' =>
false,
192 '_RaiseMemory' =>
false,
193 '_UpgradeDone' =>
false,
194 '_InstallDone' =>
false,
195 '_Caches' =>
array(),
196 '_InstallPassword' =>
'',
197 '_SameAccount' =>
true,
198 '_CreateDBAccount' =>
false,
199 '_NamespaceType' =>
'site-name',
201 '_AdminPassword' =>
'',
202 '_AdminPassword2' =>
'',
204 '_Subscribe' =>
false,
205 '_SkipOptional' =>
'continue',
206 '_RightsProfile' =>
'wiki',
207 '_LicenseCode' =>
'none',
209 '_Extensions' =>
array(),
210 '_MemCachedServers' =>
'',
211 '_UpgradeKeySupplied' =>
false,
212 '_ExistingDBSettings' =>
false,
216 'wgLogo' =>
'$wgStylePath/common/images/wiki.png',
239 'xcache' =>
'xcache_get',
240 'apc' =>
'apc_fetch',
241 'wincache' =>
'wincache_ucache_get'
252 '*' =>
array(
'edit' =>
false )
256 'createaccount' =>
false,
262 'createaccount' =>
false,
276 'url' =>
'http://creativecommons.org/licenses/by/3.0/',
277 'icon' =>
'{$wgStylePath}/common/images/cc-by.png',
280 'url' =>
'http://creativecommons.org/licenses/by-sa/3.0/',
281 'icon' =>
'{$wgStylePath}/common/images/cc-by-sa.png',
283 'cc-by-nc-sa' =>
array(
284 'url' =>
'http://creativecommons.org/licenses/by-nc-sa/3.0/',
285 'icon' =>
'{$wgStylePath}/common/images/cc-by-nc-sa.png',
288 'url' =>
'https://creativecommons.org/publicdomain/zero/1.0/',
289 'icon' =>
'{$wgStylePath}/common/images/cc-0.png',
293 'icon' =>
'{$wgStylePath}/common/images/public-domain.png',
296 'url' =>
'http://www.gnu.org/copyleft/fdl.html',
297 'icon' =>
'{$wgStylePath}/common/images/gnu-fdl.png',
304 'cc-choose' =>
array(
316 'https://lists.wikimedia.org/mailman/subscribe/mediawiki-announce';
322 'ca',
'cs',
'da',
'de',
'en',
'es',
'et',
'eu',
'fi',
'fr',
'hr',
'hu',
323 'it',
'ja',
'ko',
'lt',
'nl',
'no',
'pl',
'pt',
'pt-br',
'ro',
'ru',
324 'sl',
'sr',
'sv',
'tr',
'uk'
340 abstract public function showError( $msg );
359 $wgMessagesDirs[
'MediawikiInstaller'] = __DIR__ .
'/i18n';
366 foreach ( $this->defaultVarNames
as $var ) {
370 $this->compiledDBs =
array();
371 foreach ( self::getDBTypes()
as $type ) {
374 if ( !$installer->isCompiled() ) {
377 $this->compiledDBs[] =
$type;
408 $phpVersion = phpversion();
409 if ( version_compare( $phpVersion, self::MINIMUM_PHP_VERSION,
'>=' ) ) {
410 $this->
showMessage(
'config-env-php', $phpVersion );
413 $this->
showMessage(
'config-env-php-toolow', $phpVersion, self::MINIMUM_PHP_VERSION );
419 list( $pcreVersion ) = explode(
' ', PCRE_VERSION, 2 );
420 if ( version_compare( $pcreVersion, self::MINIMUM_PCRE_VERSION,
'<' ) ) {
421 $this->
showError(
'config-pcre-old', self::MINIMUM_PCRE_VERSION, $pcreVersion );
427 foreach ( $this->envChecks
as $check ) {
428 $status = $this->$check();
429 if ( $status ===
false ) {
435 $this->
setVar(
'_Environment', $good );
489 $type = strtolower(
$type );
491 if ( !isset( $this->dbInstallers[
$type] ) ) {
492 $class = ucfirst(
$type ) .
'Installer';
493 $this->dbInstallers[
$type] =
new $class( $this );
496 return $this->dbInstallers[
$type];
515 $_lsExists = file_exists(
"$IP/LocalSettings.php" );
523 require
"$IP/includes/DefaultSettings.php";
524 require
"$IP/LocalSettings.php";
526 return get_defined_vars();
539 return str_repeat(
'*', strlen( $realPassword ) );
550 if ( !preg_match(
'/^\*+$/',
$value ) ) {
567 if ( !function_exists(
'posix_getegid' ) || !function_exists(
'posix_getpwuid' ) ) {
568 # I don't know this, this isn't UNIX.
572 # posix_getegid() *not* getmygid() because we want the group of the webserver,
573 # not whoever owns the current script.
574 $gid = posix_getegid();
575 $getpwuid = posix_getpwuid( $gid );
576 $group = $getpwuid[
'name'];
597 public function parse( $text, $lineStart =
false ) {
601 $out =
$wgParser->parse( $text, $this->parserTitle, $this->parserOptions, $lineStart );
604 $html =
'<!--DB access attempted during parse--> ' . htmlspecialchars( $text );
606 if ( !empty( $this->debug ) ) {
607 $html .=
"<!--\n" .
$e->getTraceAsString() .
"\n-->";
622 $this->parserOptions->setExternalLinkTarget(
false );
626 global $wgExternalLinkTarget;
627 $this->parserOptions->setExternalLinkTarget( $wgExternalLinkTarget );
640 if ( !$status->isOK() ) {
643 $status->value->insert(
647 'ss_total_views' => 0,
648 'ss_total_edits' => 0,
649 'ss_good_articles' => 0,
650 'ss_total_pages' => 0,
665 if ( substr(
$name, 0, 2 ) ==
'wg' ) {
682 foreach ( self::getDBTypes()
as $name ) {
683 $allNames[] =
wfMessage(
"config-type-$name" )->text();
688 $databases = array_flip( $databases );
689 foreach ( array_keys( $databases )
as $db ) {
692 if ( !$status->isGood() ) {
695 if ( !$status->isOK() ) {
696 unset( $databases[$db] );
699 $databases = array_flip( $databases );
701 $this->
showError(
'config-no-db', $wgLang->commaList( $allNames ) );
726 $this->
showError(
'config-brokenlibxml' );
740 $this->
showError(
'config-magic-quotes-runtime' );
754 $this->
showError(
'config-magic-quotes-sybase' );
782 $this->
setVar(
'_SafeMode',
true );
794 if ( !function_exists(
"utf8_encode" ) ) {
813 $regexd = preg_replace(
'/[\x{0430}-\x{04FF}]/iu',
'',
'-АБВГД-' );
818 $regexprop = preg_replace(
'/\p{Zs}/u',
'',
"-\xE3\x80\x80-" );
820 if ( $regexd !=
'--' || $regexprop !=
'--' ) {
821 $this->
showError(
'config-pcre-no-utf8' );
834 $limit = ini_get(
'memory_limit' );
842 if ( $n < $this->minMemorySize * 1024 * 1024 ) {
843 $newLimit =
"{$this->minMemorySize}M";
845 if ( ini_set(
"memory_limit", $newLimit ) ===
false ) {
849 $this->
setVar(
'_RaiseMemory',
true );
861 foreach ( $this->objectCaches
as $name => $function ) {
862 if ( function_exists( $function ) ) {
866 $caches[
$name] =
true;
874 $this->
setVar(
'_Caches', $caches );
882 if ( self::apacheModulePresent(
'mod_security' ) ) {
894 $names =
array(
"gdiff3",
"diff3",
"diff3.exe" );
895 $versionInfo =
array(
'$1 --version 2>&1',
'GNU diffutils' );
900 $this->
setVar(
'wgDiff3', $diff3 );
902 $this->
setVar(
'wgDiff3',
false );
915 $versionInfo =
array(
'$1 -version',
'ImageMagick' );
918 $this->
setVar(
'wgImageMagickConvertCommand',
'' );
920 $this->
setVar(
'wgImageMagickConvertCommand', $convert );
921 $this->
showMessage(
'config-imagemagick', $convert );
924 } elseif ( function_exists(
'imagejpeg' ) ) {
941 $versionInfo =
array(
'$1 --version',
'git version' );
946 $this->
setVar(
'wgGitBin', $git );
949 $this->
setVar(
'wgGitBin',
false );
961 if ( $server !==
null ) {
962 $this->
showMessage(
'config-using-server', $server );
963 $this->
setVar(
'wgServer', $server );
981 $IP = dirname( dirname( __DIR__ ) );
982 $this->
setVar(
'IP', $IP );
986 $this->
getVar(
'wgServer' ),
987 $this->
getVar(
'wgScriptPath' )
999 if ( defined(
'MW_INSTALL_PHP5_EXT' ) ) {
1004 $this->
setVar(
'wgScriptExtension',
".$ext" );
1014 $os = php_uname(
's' );
1015 $supported =
array(
'Linux',
'SunOS',
'HP-UX',
'Darwin' ); # Tested these
1017 if ( !in_array( $os, $supported ) ) {
1021 # Get a list of available locales.
1030 $candidatesByLocale =
array();
1031 $candidatesByLang =
array();
1034 if (
$line ===
'' ) {
1038 if ( !preg_match(
'/^([a-zA-Z]+)(_[a-zA-Z]+|)\.(utf8|UTF-8)(@[a-zA-Z_]*|)$/i',
$line, $m ) ) {
1042 list( , $lang, , , ) = $m;
1044 $candidatesByLocale[$m[0]] = $m;
1045 $candidatesByLang[$lang][] = $m;
1048 # Try the current value of LANG.
1049 if ( isset( $candidatesByLocale[getenv(
'LANG' )] ) ) {
1050 $this->
setVar(
'wgShellLocale', getenv(
'LANG' ) );
1055 # Try the most common ones.
1056 $commonLocales =
array(
'en_US.UTF-8',
'en_US.utf8',
'de_DE.UTF-8',
'de_DE.utf8' );
1057 foreach ( $commonLocales
as $commonLocale ) {
1058 if ( isset( $candidatesByLocale[$commonLocale] ) ) {
1059 $this->
setVar(
'wgShellLocale', $commonLocale );
1065 # Is there an available locale in the Wiki's language?
1066 $wikiLang = $this->
getVar(
'wgLanguageCode' );
1068 if ( isset( $candidatesByLang[$wikiLang] ) ) {
1069 $m = reset( $candidatesByLang[$wikiLang] );
1070 $this->
setVar(
'wgShellLocale', $m[0] );
1075 # Are there any at all?
1076 if ( count( $candidatesByLocale ) ) {
1077 $m = reset( $candidatesByLocale );
1078 $this->
setVar(
'wgShellLocale', $m[0] );
1095 $url = $this->
getVar(
'wgServer' ) . $this->
getVar(
'wgScriptPath' ) .
'/images/';
1111 $maxValueLength = ini_get(
'suhosin.get.max_value_length' );
1112 if ( $maxValueLength > 0 && $maxValueLength < 1024 ) {
1114 $this->
showMessage(
'config-suhosin-max-value-length', $maxValueLength );
1129 } elseif ( $c <= 0x7FF ) {
1130 return chr( 0xC0 | $c >> 6 ) . chr( 0x80 | $c & 0x3F );
1131 } elseif ( $c <= 0xFFFF ) {
1132 return chr( 0xE0 | $c >> 12 ) . chr( 0x80 | $c >> 6 & 0x3F )
1133 . chr( 0x80 | $c & 0x3F );
1134 } elseif ( $c <= 0x10FFFF ) {
1135 return chr( 0xF0 | $c >> 18 ) . chr( 0x80 | $c >> 12 & 0x3F )
1136 . chr( 0x80 | $c >> 6 & 0x3F )
1137 . chr( 0x80 | $c & 0x3F );
1147 $utf8 = function_exists(
'utf8_normalize' );
1148 $intl = function_exists(
'normalizer_normalize' );
1160 $useNormalizer =
'php';
1161 $needsUpdate =
false;
1168 $useNormalizer =
'utf8';
1170 if ( $utf8 !== $normal_c ) {
1171 $needsUpdate =
true;
1175 $useNormalizer =
'intl';
1176 $intl = normalizer_normalize( $not_normal_c, Normalizer::FORM_C );
1177 if ( $intl !== $normal_c ) {
1178 $needsUpdate =
true;
1184 if ( $useNormalizer ===
'php' ) {
1185 $this->
showMessage(
'config-unicode-pure-php-warning' );
1187 $this->
showMessage(
'config-unicode-using-' . $useNormalizer );
1188 if ( $needsUpdate ) {
1189 $this->
showMessage(
'config-unicode-update-warning' );
1198 if ( !function_exists(
'ctype_digit' ) ) {
1211 if ( !function_exists(
'json_decode' ) ) {
1229 array(
'/usr/bin',
'/usr/local/bin',
'/opt/csw/bin',
1230 '/usr/gnu/bin',
'/usr/sfw/bin',
'/sw/bin',
'/opt/local/bin' ),
1231 explode( PATH_SEPARATOR, getenv(
'PATH' ) )
1253 if ( !is_array( $names ) ) {
1254 $names =
array( $names );
1261 $file_exists = file_exists(
$command );
1264 if ( $file_exists ) {
1265 if ( !$versionInfo ) {
1292 foreach ( self::getPossibleBinPaths()
as $path ) {
1294 if ( $exe !==
false ) {
1311 $scriptTypes =
array(
1313 "<?php echo 'ex' . 'ec';",
1314 "#!/var/env php5\n<?php echo 'ex' . 'ec';",
1322 foreach ( $scriptTypes
as $ext => $contents ) {
1338 if ( $text ==
'exec' ) {
1358 if ( function_exists(
'apache_get_modules' ) && in_array( $moduleName, apache_get_modules() ) ) {
1363 phpinfo( INFO_MODULES );
1364 $info = ob_get_clean();
1366 return strpos( $info, $moduleName ) !==
false;
1375 $this->parserOptions->setTargetLanguage( $lang );
1376 $this->parserOptions->setUserLang( $lang );
1385 return "{$_SERVER['PHP_SELF']}?page=" . urlencode( $page );
1395 if ( $this->
getVar(
'IP' ) ===
null ) {
1399 $extDir = $this->
getVar(
'IP' ) .
'/extensions';
1400 if ( !is_readable( $extDir ) || !is_dir( $extDir ) ) {
1404 $dh = opendir( $extDir );
1406 while ( (
$file = readdir( $dh ) ) !==
false ) {
1407 if ( !is_dir(
"$extDir/$file" ) ) {
1410 if ( file_exists(
"$extDir/$file/$file.php" ) ) {
1415 natcasesort( $exts );
1427 $exts = $this->
getVar(
'_Extensions' );
1428 $IP = $this->
getVar(
'IP' );
1439 $wgAutoloadClasses =
array();
1441 require
"$IP/includes/DefaultSettings.php";
1443 foreach ( $exts
as $e ) {
1444 require_once
"$IP/extensions/$e/$e.php";
1447 $hooksWeWant = isset(
$wgHooks[
'LoadExtensionSchemaUpdates'] ) ?
1452 $GLOBALS[
'wgHooks'] =
array(
'LoadExtensionSchemaUpdates' => $hooksWeWant );
1470 $coreInstallSteps =
array(
1471 array(
'name' =>
'database',
'callback' =>
array( $installer,
'setupDatabase' ) ),
1472 array(
'name' =>
'tables',
'callback' =>
array( $installer,
'createTables' ) ),
1473 array(
'name' =>
'interwiki',
'callback' =>
array( $installer,
'populateInterwikiTable' ) ),
1474 array(
'name' =>
'stats',
'callback' =>
array( $this,
'populateSiteStats' ) ),
1475 array(
'name' =>
'keys',
'callback' =>
array( $this,
'generateKeys' ) ),
1476 array(
'name' =>
'sysop',
'callback' =>
array( $this,
'createSysop' ) ),
1477 array(
'name' =>
'mainpage',
'callback' =>
array( $this,
'createMainpage' ) ),
1482 foreach ( $coreInstallSteps
as $step ) {
1483 $this->installSteps[] = $step;
1484 if ( isset( $this->extraInstallSteps[$step[
'name']] ) ) {
1485 $this->installSteps = array_merge(
1486 $this->installSteps,
1487 $this->extraInstallSteps[$step[
'name']]
1493 if ( isset( $this->extraInstallSteps[
'BEGINNING'] ) ) {
1494 $this->installSteps = array_merge(
1495 $this->extraInstallSteps[
'BEGINNING'],
1501 if ( count( $this->
getVar(
'_Extensions' ) ) ) {
1502 array_unshift( $this->installSteps,
1503 array(
'name' =>
'extensions',
'callback' =>
array( $this,
'includeExtensions' ) )
1505 $this->installSteps[] =
array(
1506 'name' =>
'extension-tables',
1507 'callback' =>
array( $installer,
'createExtensionTables' )
1523 $installResults =
array();
1527 foreach ( $steps
as $stepObj ) {
1528 $name = $stepObj[
'name'];
1529 call_user_func_array( $startCB,
array(
$name ) );
1532 $status = call_user_func( $stepObj[
'callback'], $installer );
1535 call_user_func( $endCB,
$name, $status );
1536 $installResults[
$name] = $status;
1540 if ( !$status->isOk() ) {
1544 if ( $status->isOk() ) {
1545 $this->
setVar(
'_InstallDone',
true );
1548 return $installResults;
1558 if ( strval( $this->
getVar(
'wgUpgradeKey' ) ) ===
'' ) {
1559 $keys[
'wgUpgradeKey'] = 16;
1582 $this->
setVar( $name, $secretKey );
1587 $names = preg_replace(
'/^(.*)$/',
'\$$1', $names );
1589 $status->warning(
'config-insecure-keys',
$wgLang->listToText( $names ), count( $names ) );
1609 if (
$user->idForName() == 0 ) {
1610 $user->addToDatabase();
1613 $user->setPassword( $this->
getVar(
'_AdminPassword' ) );
1618 $user->addGroup(
'sysop' );
1619 $user->addGroup(
'bureaucrat' );
1620 if ( $this->
getVar(
'_AdminEmail' ) ) {
1621 $user->setEmail( $this->
getVar(
'_AdminEmail' ) );
1623 $user->saveSettings();
1627 $ssUpdate->doUpdate();
1631 if ( $this->
getVar(
'_Subscribe' ) && $this->
getVar(
'_AdminEmail' ) ) {
1643 'email' => $this->
getVar(
'_AdminEmail' ),
1650 $myLang = $this->
getVar(
'_UserLang' );
1651 if ( in_array( $myLang, $this->mediaWikiAnnounceLanguages ) ) {
1652 $myLang = $myLang ==
'pt-br' ?
'pt_BR' : $myLang;
1653 $params[
'language'] = $myLang;
1658 array(
'method' =>
'POST',
'postData' =>
$params ) )->execute();
1660 $s->warning(
'config-install-subscribe-fail',
$res->getMessage() );
1663 $s->warning(
'config-install-subscribe-notpossible' );
1678 wfMessage(
'mainpagetext' )->inContentLanguage()->
text() .
"\n\n" .
1679 wfMessage(
'mainpagedocfooter' )->inContentLanguage()->
text()
1682 $page->doEditContent( $content,
1690 $status->fatal(
'config-install-mainpage-failed',
$e->getMessage() );
1700 define(
'MW_NO_SESSION', 1 );
1703 $GLOBALS[
'wgUseDatabaseMessages'] =
false;
1707 $GLOBALS[
'wgShowExceptionDetails'] =
true;
1709 $GLOBALS[
'wgExternalLinkTarget'] =
'_blank';
1712 $GLOBALS[
'wgShowSQLErrors'] =
true;
1713 $GLOBALS[
'wgShowDBErrorBacktrace'] =
true;
1716 $GLOBALS[
'wgDisableOutputCompression'] =
true;
1719 $GLOBALS[
'wgCookiePrefix'] =
'mw_installer';
1725 $GLOBALS[
'wgResourceLoaderLESSFunctions'][
'embeddable'] =
function ( $frame, $less ) {
1726 return $less->toBool(
false );
1737 public function addInstallStep( $callback, $findStep =
'BEGINNING' ) {
1738 $this->extraInstallSteps[$findStep][] = $callback;
1747 set_time_limit( 0 );
envCheckBrokenXML()
Some versions of libxml+PHP break < and > encoding horribly.
Set options of the Parser.
__construct()
Constructor, always call this from child classes.
static newFromId( $id)
Static factory method for creation from a given user ID.
static newFromText( $text, $defaultNamespace=NS_MAIN)
Create a new Title from text, such as what one would find in a link.
wfShellExec( $cmd, &$retval=null, $environ=array(), $limits=array(), $options=array())
Execute a shell command, with time and memory limits mirrored from the PHP configuration if supported...
static disableBackend()
Disables all access to the load balancer, will cause all database access to throw a DBAccessError.
static wasStrong()
Return a boolean indicating whether or not the source used for cryptographic random bytes generation ...
createMainpage(DatabaseInstaller $installer)
Insert Main Page with default content.
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
showMessage( $msg)
UI interface for displaying a short message The parameters are like parameters to wfMessage().
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses just before the function returns a value If you return an< a > element with HTML attributes $attribs and contents $html will be returned If you return $ret will be returned and may include noclasses & $html
const MINIMUM_PHP_VERSION
parse( $text, $lineStart=false)
Convert wikitext $text to HTML.
global $wgAutoloadClasses
showStatusMessage(Status $status)
Show a message to the installing user by using a Status object.
dirIsExecutable( $dir, $url)
Checks if scripts located in the given directory can be executed via the given URL.
design txt This is a brief overview of the new design More thorough and up to date information is available on the documentation wiki at etc Handles the details of getting and saving to the user table of the and dealing with sessions and cookies OutputPage Encapsulates the entire HTML page that will be sent in response to any server request It is used by calling its functions to add text
envCheckLibicu()
Check the libicu version.
static newMainPage()
Create a new Title for the Main Page.
envCheckExtension()
Environment check for setting the preferred PHP file extension.
populateSiteStats(DatabaseInstaller $installer)
Install step which adds a row to the site_stats table with appropriate initial values.
array $extraInstallSteps
Extra steps for installation, for things like DatabaseInstallers to modify.
getConnection()
Connect to the database using the administrative user/password currently defined in the session.
array $rightsProfiles
User rights profiles.
envCheckShellLocale()
Environment check for preferred locale in shell.
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses & $ret
wfSuppressWarnings( $end=false)
Reference-counted warning suppression.
envCheckMbstring()
Environment check for mbstring.func_overload.
envCheckUploadsDirectory()
Environment check for the permissions of the uploads directory.
static newGood( $value=null)
Factory function for good results.
performInstallation( $startCB, $endCB)
Actually perform the installation.
$mediaWikiAnnounceLanguages
Supported language codes for Mailman.
Thrown by User::setPassword() on error.
static newFromName( $name, $validate='valid')
Static factory method for creation from username.
checkPrerequisites()
Checks for installation prerequisites other than those checked by isCompiled()
static generateHex( $chars, $forceStrong=false)
Generate a run of (ideally) cryptographically random data and return it in hexadecimal string format.
array $dbInstallers
Cached DB installer instances, access using getDBInstaller().
setParserLanguage( $lang)
ParserOptions are constructed before we determined the language, so fix it.
$wgHooks['ArticleShow'][]
addInstallStep( $callback, $findStep='BEGINNING')
Add an installation step following the given step.
array $internalDefaults
Variables that are stored alongside globals, and are used for any configuration of the installation p...
setPassword( $name, $value)
Set a variable which stores a password, except if the new value is a fake password in which case leav...
envGetDefaultServer()
Helper function to be called from envCheckServer()
preInstall()
Allow DB installers a chance to make last-minute changes before installation occurs.
setVar( $name, $value)
Set a MW configuration variable, or internal installer configuration variable.
Title $parserTitle
Cached Title, used by parse().
array $objectCaches
Known object cache types and the functions used to test for their existence.
static locateExecutableInDefaultPaths( $names, $versionInfo=false)
Same as locateExecutable(), but checks in getPossibleBinPaths() by default.
Generic operation result class Has warning/error list, boolean status and arbitrary value.
static overrideConfig()
Override the necessary bits of the config to run an installation.
createSysop()
Create the first user account, grant it sysop and bureaucrat rights.
getFakePassword( $realPassword)
Get a fake password for sending back to the user in HTML.
envCheckSuhosinMaxValueLength()
Checks if suhosin.get.max_value_length is set, and if so generate a warning because it decreases Reso...
static getLocalisationCache()
Get the LocalisationCache instance.
showError( $msg)
Same as showMessage(), but for displaying errors.
static getPossibleBinPaths()
Get an array of likely places we can find executables.
static factory(Title $title)
Create a WikiPage object of the appropriate class for the given title.
envCheckRegisterGlobals()
Environment check for register_globals.
wfRestoreWarnings()
Restore error level to previous value.
envCheckDiff3()
Search for GNU diff3.
envCheckMagicQuotes()
Environment check for magic_quotes_runtime.
generateKeys()
Generate $wgSecretKey.
envCheckMagicSybase()
Environment check for magic_quotes_sybase.
envCheckMemory()
Environment check for available memory.
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses just before the function returns a value If you return an< a > element with HTML attributes $attribs and contents $html will be returned If you return $ret will be returned and may include noclasses after processing after in associative array form externallinks including delete and has completed for all link tables default is conds Array Extra conditions for the No matching items in log is displayed if loglist is empty msgKey Array If you want a nice box with a set this to the key of the message First element is the message additional optional elements are parameters for the key that are processed with wfMessage() -> params() ->parseAsBlock() - offset Set to overwrite offset parameter in $wgRequest set to '' to unset offset - wrap String Wrap the message in html(usually something like "<
getCompiledDBs()
Get a list of DBs supported by current PHP setup.
exportVars()
Exports all wg* variables stored by the installer into global scope.
integer $minMemorySize
Minimum memory size in MB.
envCheckCache()
Environment check for compiled object cache types.
static getExistingLocalSettings()
Determine if LocalSettings.php exists.
envCheckPath()
Environment check for setting $IP and $wgScriptPath.
doGenerateKeys( $keys)
Generate a secret value for variables using our CryptRand generator.
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
ParserOptions $parserOptions
Cached ParserOptions, used by parse().
when a variable name is used in a it is silently declared as a new masking the global
globals will be eliminated from MediaWiki replaced by an application object which would be passed to constructors Whether that would be an convenient solution remains to be but certainly PHP makes such object oriented programming models easier than they were in previous versions For the time being MediaWiki programmers will have to work in an environment with some global context At the time of globals were initialised on startup by MediaWiki of these were configuration settings
Class for handling updates to the site_stats table.
getVar( $name, $default=null)
Get an MW configuration variable, or internal installer configuration variable.
Content object for wiki text pages.
deferred txt A few of the database updates required by various functions here can be deferred until after the result page is displayed to the user For updating the view updating the linked to tables after a etc PHP does not yet have any way to tell the server to actually return and disconnect while still running these but it might have such a feature in the future We handle these by creating a deferred update object and putting those objects on a global list
envCheckXML()
Environment check for the XML module.
static get( $url, $timeout='default', $options=array())
Simple wrapper for Http::request( 'GET' )
Allows to change the fields on the form that will be generated $name
Exception class for attempted DB access.
array $installSteps
The actual list of installation steps.
wfIsWindows()
Check if the operating system is Windows.
wfEscapeShellArg()
Windows-compatible version of escapeshellarg() Windows doesn't recognise single-quotes in the shell,...
getDBInstaller( $type=false)
Get an instance of DatabaseInstaller for the specified DB type.
Base class for DBMS-specific installation helper classes.
envCheckDB()
Environment check for DB types.
getInstallSteps(DatabaseInstaller $installer)
Get an array of install steps.
please add to it if you re going to add events to the MediaWiki code where normally authentication against an external auth plugin would be creating a account $user
array $compiledDBs
List of detected DBs, access using getCompiledDBs().
wfIniGetBool( $setting)
Safety wrapper around ini_get() for boolean settings.
doEnvironmentChecks()
Do initial checks of the PHP environment.
if(PHP_SAPI !='cli') $file
envCheckGraphics()
Environment check for ImageMagick and GD.
wfShorthandToInteger( $string='', $default=-1)
Converts shorthand byte notation to integer form.
static apacheModulePresent( $moduleName)
Checks for presence of an Apache module.
Test for PHP+libxml2 bug which breaks XML input subtly with certain versions.
Represents a title within MediaWiki.
envCheckPCRE()
Environment check for the PCRE module.
this class mediates it Skin Encapsulates a look and feel for the wiki All of the functions that render HTML and make choices about how to render it are here and are called from various other places when and is meant to be subclassed with other skins that may override some of its functions The User object contains a reference to a and so rather than having a global skin object we just rely on the global User and get the skin with $wgUser and also has some character encoding functions and other locale stuff The current user interface language is instantiated as $wgLang
if(count( $args)==0) $dir
static canMakeRequests()
Simple function to test if we can make any sort of requests at all, using cURL or fopen()
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such as
array $licenses
License types.
disableTimeLimit()
Disable the time limit for execution.
findExtensions()
Finds extensions that follow the format /extensions/Name/Name.php, and returns an array containing th...
if(PHP_SAPI !='cli') $source
envCheckServer()
Environment check for the server hostname.
const MINIMUM_PCRE_VERSION
The oldest version of PCRE we can support.
static getDBTypes()
Get a list of known DB types.
envCheckSafeMode()
Environment check for safe_mode.
$mediaWikiAnnounceUrl
URL to mediawiki-announce subscription.
includeExtensions()
Installs the auto-detected extensions.
static factory( $url, $options=null)
Generate a new request object.
envCheckGit()
Search for git.
getDocUrl( $page)
Overridden by WebInstaller to provide lastPage parameters.
subscribeToMediaWikiAnnounce(Status $s)
unicodeChar( $c)
Convert a hex string representing a Unicode code point to that code point.
static maybeGetWebserverPrimaryGroup()
On POSIX systems return the primary group of the webserver we're running under.
div flags Integer display flags(NO_ACTION_LINK, NO_EXTRA_USER_LINKS) 'LogException' returning false will NOT prevent logging $e
array $defaultVarNames
MediaWiki configuration globals that will eventually be passed through to LocalSettings....
static newFatal( $message)
Factory function for fatal errors.
array $envChecks
A list of environment check methods called by doEnvironmentChecks().
envCheckModSecurity()
Scare user to death if they have mod_security.
static locateExecutable( $path, $names, $versionInfo=false)
Search a path for any of the given executable names.