From ca32f08966f1b51fcb19460f0996bb0c4048e6fe Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Sat, 3 Dec 2011 13:29:22 +0100 Subject: Update to MediaWiki 1.18.0 * also update ArchLinux skin to chagnes in MonoBook * Use only css to hide our menu bar when printing --- includes/installer/MysqlInstaller.php | 62 ++++++++++++++++++++++++++++++++--- 1 file changed, 58 insertions(+), 4 deletions(-) (limited to 'includes/installer/MysqlInstaller.php') diff --git a/includes/installer/MysqlInstaller.php b/includes/installer/MysqlInstaller.php index 2fe16dcf..3bb8c114 100644 --- a/includes/installer/MysqlInstaller.php +++ b/includes/installer/MysqlInstaller.php @@ -42,6 +42,9 @@ class MysqlInstaller extends DatabaseInstaller { 'CREATE TEMPORARY TABLES', ); + /** + * @return string + */ public function getName() { return 'mysql'; } @@ -50,14 +53,23 @@ class MysqlInstaller extends DatabaseInstaller { parent::__construct( $parent ); } + /** + * @return Bool + */ public function isCompiled() { return self::checkExtension( 'mysql' ); } + /** + * @return array + */ public function getGlobalDefaults() { return array(); } + /** + * @return string + */ public function getConnectForm() { return $this->getTextBox( 'wgDBserver', 'config-db-host', array(), $this->parent->getHelpBox( 'config-db-host-help' ) ) . @@ -112,6 +124,9 @@ class MysqlInstaller extends DatabaseInstaller { return $status; } + /** + * @return Status + */ public function openConnection() { $status = Status::newGood(); try { @@ -188,6 +203,8 @@ class MysqlInstaller extends DatabaseInstaller { /** * Get a list of storage engines that are available and supported + * + * @return array */ public function getEngines() { $engines = array( 'InnoDB', 'MyISAM' ); @@ -216,6 +233,8 @@ class MysqlInstaller extends DatabaseInstaller { /** * Get a list of character sets that are available and supported + * + * @return array */ public function getCharsets() { $status = $this->getConnection(); @@ -232,6 +251,8 @@ class MysqlInstaller extends DatabaseInstaller { /** * Return true if the install user can create accounts + * + * @return bool */ public function canCreateAccounts() { $status = $this->getConnection(); @@ -305,6 +326,9 @@ class MysqlInstaller extends DatabaseInstaller { return true; } + /** + * @return string + */ public function getSettingsForm() { if ( $this->canCreateAccounts() ) { $noCreateMsg = false; @@ -319,13 +343,33 @@ class MysqlInstaller extends DatabaseInstaller { if ( !in_array( $this->getVar( '_MysqlEngine' ), $engines ) ) { $this->setVar( '_MysqlEngine', reset( $engines ) ); } + + $s .= Xml::openElement( 'div', array( + 'id' => 'dbMyisamWarning' + )); + $s .= $this->parent->getWarningBox( wfMsg( 'config-mysql-myisam-dep' ) ); + $s .= Xml::closeElement( 'div' ); + + if( $this->getVar( '_MysqlEngine' ) != 'MyISAM' ) { + $s .= Xml::openElement( 'script', array( 'type' => 'text/javascript' ) ); + $s .= '$(\'#dbMyisamWarning\').hide();'; + $s .= Xml::closeElement( 'script' ); + } + if ( count( $engines ) >= 2 ) { $s .= $this->getRadioSet( array( 'var' => '_MysqlEngine', 'label' => 'config-mysql-engine', 'itemLabelPrefix' => 'config-mysql-', - 'values' => $engines - )); + 'values' => $engines, + 'itemAttribs' => array( + 'MyISAM' => array( + 'class' => 'showHideRadio', + 'rel' => 'dbMyisamWarning'), + 'InnoDB' => array( + 'class' => 'hideShowRadio', + 'rel' => 'dbMyisamWarning') + ))); $s .= $this->parent->getHelpBox( 'config-mysql-engine-help' ); } @@ -349,6 +393,9 @@ class MysqlInstaller extends DatabaseInstaller { return $s; } + /** + * @return Status + */ public function submitSettingsForm() { $this->setVarsFromRequest( array( '_MysqlEngine', '_MysqlCharset' ) ); $status = $this->submitWebUserBox(); @@ -404,6 +451,9 @@ class MysqlInstaller extends DatabaseInstaller { $this->parent->addInstallStep( $callback, 'tables' ); } + /** + * @return Status + */ public function setupDatabase() { $status = $this->getConnection(); if ( !$status->isOK() ) { @@ -419,6 +469,9 @@ class MysqlInstaller extends DatabaseInstaller { return $status; } + /** + * @return Status + */ public function setupUser() { $dbUser = $this->getVar( 'wgDBuser' ); if( $dbUser == $this->getVar( '_InstallUser' ) ) { @@ -499,7 +552,6 @@ class MysqlInstaller extends DatabaseInstaller { } // Try to grant to all the users we know exist or we were able to create - $escPass = $this->db->addQuotes( $password ); $dbAllTables = $this->db->addIdentifierQuotes( $dbName ) . '.*'; foreach( $grantableNames as $name ) { try { @@ -540,7 +592,7 @@ class MysqlInstaller extends DatabaseInstaller { } catch( DBQueryError $dqe ) { return false; } - + } /** @@ -562,6 +614,8 @@ class MysqlInstaller extends DatabaseInstaller { /** * Get variables to substitute into tables.sql and the SQL patch files. + * + * @return array */ public function getSchemaVars() { return array( -- cgit v1.2.3-54-g00ecf