Go to the documentation of this file.
65 abstract public function getName();
155 if ( $status->isOK() ) {
156 $this->db = $status->value;
158 $this->db->clearFlag(
DBO_TRX );
159 $this->db->commit( __METHOD__ );
172 if ( !$status->isOK() ) {
175 $this->db->selectDB( $this->
getVar(
'wgDBname' ) );
177 if ( $this->db->tableExists(
'archive', __METHOD__ ) ) {
178 $status->warning(
'config-install-tables-exist' );
185 $this->db->begin( __METHOD__ );
187 $error = $this->db->sourceFile( $this->db->getSchemaPath() );
189 $this->db->reportQueryError(
$error, 0,
'', __METHOD__ );
190 $this->db->rollback( __METHOD__ );
191 $status->fatal(
'config-install-tables-failed',
$error );
193 $this->db->commit( __METHOD__ );
196 if ( $status->isOk() ) {
209 if ( !$status->isOK() ) {
243 if ( $status->isOK() ) {
246 $msg = __METHOD__ .
': unexpected error while establishing'
247 .
' a database connection with message: '
248 . $status->getMessage()->plain();
260 if ( !$status->isOK() ) {
261 throw new MWException( __METHOD__ .
': unexpected DB connection error' );
264 'connection' => $status->value ) ) );
277 ob_start(
array( $this,
'outputHandler' ) );
282 echo
"\nAn error occurred:\n";
331 return extension_loaded(
$name );
367 public function getVar( $var, $default =
null ) {
370 if ( isset( $defaults[$var] ) ) {
371 $default = $defaults[$var];
372 } elseif ( isset( $internal[$var] ) ) {
373 $default = $internal[$var];
376 return $this->parent->getVar( $var, $default );
404 return $this->parent->getTextBox(
array(
408 'controlName' =>
$name,
431 return $this->parent->getPasswordBox(
array(
435 'controlName' =>
$name,
454 return $this->parent->getCheckBox(
array(
458 'controlName' =>
$name,
481 return $this->parent->getRadioSet(
$params );
492 return $this->parent->setVarsFromRequest( $varNames, $this->
getName() .
'_' );
507 if ( !$status->isOK() ) {
511 if ( !$this->db->selectDB( $this->getVar(
'wgDBname' ) ) ) {
515 return $this->db->tableExists(
'cur', __METHOD__ ) ||
516 $this->db->tableExists(
'revision', __METHOD__ );
529 'config-db-username',
530 array(
'dir' =>
'ltr' ),
531 $this->parent->getHelpBox(
'config-db-install-username' )
535 'config-db-password',
536 array(
'dir' =>
'ltr' ),
537 $this->parent->getHelpBox(
'config-db-install-password' )
560 $wrapperStyle = $this->
getVar(
'_SameAccount' ) ?
'display: none' :
'';
564 '_SameAccount',
'config-db-web-account-same',
565 array(
'class' =>
'hideShowRadio',
'rel' =>
'dbOtherAccount' )
568 $this->
getTextBox(
'wgDBuser',
'config-db-username' ) .
570 $this->parent->getHelpBox(
'config-db-web-help' );
571 if ( $noCreateMsg ) {
572 $s .= $this->parent->getWarningBox(
wfMessage( $noCreateMsg )->plain() );
574 $s .= $this->
getCheckBox(
'_CreateDBAccount',
'config-db-web-create' );
588 array(
'wgDBuser',
'wgDBpassword',
'_SameAccount',
'_CreateDBAccount' )
591 if ( $this->
getVar(
'_SameAccount' ) ) {
592 $this->
setVar(
'wgDBuser', $this->
getVar(
'_InstallUser' ) );
593 $this->
setVar(
'wgDBpassword', $this->
getVar(
'_InstallPassword' ) );
596 if ( $this->
getVar(
'_CreateDBAccount' ) && strval( $this->
getVar(
'wgDBpassword' ) ) ==
'' ) {
610 if ( !$status->isOK() ) {
613 $this->db->selectDB( $this->
getVar(
'wgDBname' ) );
615 if ( $this->db->selectRow(
'interwiki',
'*',
array(), __METHOD__ ) ) {
616 $status->warning(
'config-install-interwiki-exists' );
622 $rows =
file(
"$IP/maintenance/interwiki.list",
623 FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES );
625 $interwikis =
array();
629 foreach ( $rows
as $row ) {
630 $row = preg_replace(
'/^\s*([^#]*?)\s*(#.*)?$/',
'\\1', $row );
635 $interwikis[] = array_combine(
636 array(
'iw_prefix',
'iw_url',
'iw_local',
'iw_api',
'iw_wikiid' ),
640 $this->db->insert(
'interwiki', $interwikis, __METHOD__ );
646 return htmlspecialchars( $string );
array $globalNames
Array of MW configuration globals this class uses.
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
static checkExtension( $name)
Convenience function.
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
doUpgrade()
Perform database upgrades.
Class for the core installer web interface.
getConnection()
Connect to the database using the administrative user/password currently defined in the session.
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.
getPasswordBox( $var, $label, $attribs=array(), $helpData="")
Get a labelled password box to configure a local variable.
static newGood( $value=null)
Factory function for good results.
getCheckBox( $var, $label, $attribs=array(), $helpData="")
Get a labelled checkbox to configure a local boolean variable.
checkPrerequisites()
Checks for installation prerequisites other than those checked by isCompiled()
getSchemaVars()
Override this to provide DBMS-specific schema variables, to be substituted into tables....
preUpgrade()
Allow DB installers a chance to make checks before upgrade.
preInstall()
Allow DB installers a chance to make last-minute changes before installation occurs.
submitSettingsForm()
Set variables based on the request array, assuming it was submitted via the form return by getSetting...
getLocalSettings()
Get the DBMS-specific options for LocalSettings.php generation.
getTextBox( $var, $label, $attribs=array(), $helpData="")
Get a labelled text box to configure a local variable.
getReadableName()
Get the internationalised name for this DBMS.
createTables()
Create database tables from scratch.
getInternalDefaults()
Get a name=>value map of internal variables used during installation.
static closeElement( $element)
Returns "</$element>", except if $wgWellFormedXml is off, in which case it returns the empty string w...
We ve cleaned up the code here by removing clumps of infrequently used code and moving them off somewhere else It s much easier for someone working with this code to see what s _really_ going and make changes or fix bugs In we can take all the code that deals with the little used title reversing we can concentrate it all in an extension file
static openElement( $element, $attribs=array())
Identical to rawElement(), but has no third parameter and omits the end tag (and the self-closing '/'...
getConnectForm()
Get HTML for a web form that configures this database.
wfRestoreWarnings()
Restore error level to previous value.
static newForDB(&$db, $shared=false, $maintenance=null)
static element( $element, $attribs=array(), $contents='')
Identical to rawElement(), but HTML-escapes $contents (like Xml::element()).
submitConnectForm()
Set variables based on the request array, assuming it was submitted via the form returned by getConne...
submitWebUserBox()
Submit the form from getWebUserBox().
getName()
Return the internal name, e.g.
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 "<
setupSchemaVars()
Set appropriate schema variables in the current database connection.
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
when a variable name is used in a it is silently declared as a new masking the global
getWebUserBox( $noCreateMsg=false)
Get a standard web-user fieldset.
getRadioSet( $params)
Get a set of labelled radio buttons.
DatabaseBase $db
The database connection.
getGlobalDefaults()
Get a name=>value map of MW configuration globals that overrides.
Allows to change the fields on the form that will be generated $name
getVar( $var, $default=null)
Get a variable, taking local defaults into account.
static setInstance( $instance)
Set the instance to be the given object.
Database abstraction object.
createExtensionTables()
Create the tables for each extension the user enabled.
submitInstallUserBox()
Submit a standard install user fieldset.
Base class for DBMS-specific installation helper classes.
getGlobalNames()
Get an array of MW configuration globals that will be configured by this class.
getSettingsForm()
Get HTML for a web form that retrieves settings used for installation.
openConnection()
Open a connection to the database using the administrative user/password currently defined in the ses...
enableLB()
Set up LBFactory so that wfGetDB() etc.
populateInterwikiTable()
Common function for databases that don't understand the MySQLish syntax of interwiki....
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
setVar( $name, $value)
Convenience alias for $this->parent->setVar()
getInstallUserBox()
Get a standard install-user fieldset.
setVarsFromRequest( $varNames)
Convenience function to set variables based on form data.
WebInstaller $parent
The Installer object.
setupDatabase()
Create the database and return a Status object indicating success or failure.
usually copyright or history_copyright This message must be in HTML not wikitext $subpages will be ignored and the rest of subPageSubtitle() will run. 'SkinTemplateBuildNavUrlsNav_urlsAfterPermalink' whether MediaWiki currently thinks this is a CSS JS page Hooks may change this value to override the return value of Title::isCssOrJsPage(). 'TitleIsAlwaysKnown' whether MediaWiki currently thinks this page is known isMovable() always returns false. $title whether MediaWiki currently thinks this page is movable Hooks may change this value to override the return value of Title::isMovable(). 'TitleIsWikitextPage' whether MediaWiki currently thinks this is a wikitext page Hooks may change this value to override the return value of Title::isWikitextPage() 'TitleMove' use UploadVerification and UploadVerifyFile instead where the first element is the message key and the remaining elements are used as parameters to the message based on mime etc Preferred in most cases over UploadVerification object with all info about the upload string as detected by MediaWiki Handlers will typically only apply for specific mime types object & $error
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 & $attribs
An LBFactory class that always returns a single database object.
array $internalDefaults
Internal variables for installation.
__construct( $parent)
Construct and initialise parent.
needsUpgrade()
Determine whether an existing installation of MediaWiki is present in the configured administrative c...
static newFatal( $message)
Factory function for fatal errors.