X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Finstaller%2FMysqlInstaller.php;h=2d433244ae62a573dae78061dbebd54e31848d5e;hb=6a06b39dc99b47d59485771f2720a37ae8728259;hp=5e420b607b0e40ba709e8f9890c2f693aee13ac9;hpb=b93eb55e42b8ea536711f4aacb8c8f424a59b359;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/installer/MysqlInstaller.php b/includes/installer/MysqlInstaller.php index 5e420b607b..2d433244ae 100644 --- a/includes/installer/MysqlInstaller.php +++ b/includes/installer/MysqlInstaller.php @@ -64,10 +64,6 @@ class MysqlInstaller extends DatabaseInstaller { return 'mysql'; } - public function __construct( $parent ) { - parent::__construct( $parent ); - } - /** * @return Bool */ @@ -86,7 +82,12 @@ class MysqlInstaller extends DatabaseInstaller { * @return string */ public function getConnectForm() { - return $this->getTextBox( 'wgDBserver', 'config-db-host', array(), $this->parent->getHelpBox( 'config-db-host-help' ) ) . + return $this->getTextBox( + 'wgDBserver', + 'config-db-host', + array(), + $this->parent->getHelpBox( 'config-db-host-help' ) + ) . Html::openElement( 'fieldset' ) . Html::element( 'legend', array(), wfMessage( 'config-db-wiki-settings' )->text() ) . $this->getTextBox( 'wgDBname', 'config-db-name', array( 'dir' => 'ltr' ), @@ -267,9 +268,7 @@ class MysqlInstaller extends DatabaseInstaller { if ( !$status->isOK() ) { return false; } - /** - * @var $conn DatabaseBase - */ + /** @var $conn DatabaseBase */ $conn = $status->value; // Get current account name @@ -435,13 +434,14 @@ class MysqlInstaller extends DatabaseInstaller { if ( !$create ) { // Test the web account try { - $db = DatabaseBase::factory( 'mysql', array( + DatabaseBase::factory( 'mysql', array( 'host' => $this->getVar( 'wgDBserver' ), 'user' => $this->getVar( 'wgDBuser' ), 'password' => $this->getVar( 'wgDBpassword' ), 'dbname' => false, 'flags' => 0, - 'tablePrefix' => $this->getVar( 'wgDBprefix' ) ) ); + 'tablePrefix' => $this->getVar( 'wgDBprefix' ) + ) ); } catch ( DBConnectionError $e ) { return Status::newFatal( 'config-connection-error', $e->getMessage() ); } @@ -478,10 +478,14 @@ class MysqlInstaller extends DatabaseInstaller { if ( !$status->isOK() ) { return $status; } + /** @var DatabaseBase $conn */ $conn = $status->value; $dbName = $this->getVar( 'wgDBname' ); if ( !$conn->selectDB( $dbName ) ) { - $conn->query( "CREATE DATABASE " . $conn->addIdentifierQuotes( $dbName ) . "CHARACTER SET utf8", __METHOD__ ); + $conn->query( + "CREATE DATABASE " . $conn->addIdentifierQuotes( $dbName ) . "CHARACTER SET utf8", + __METHOD__ + ); $conn->selectDB( $dbName ); } $this->setupSchemaVars(); @@ -512,13 +516,14 @@ class MysqlInstaller extends DatabaseInstaller { if ( $this->getVar( '_CreateDBAccount' ) ) { // Before we blindly try to create a user that already has access, try { // first attempt to connect to the database - $db = DatabaseBase::factory( 'mysql', array( + DatabaseBase::factory( 'mysql', array( 'host' => $server, 'user' => $dbUser, 'password' => $password, 'dbname' => false, 'flags' => 0, - 'tablePrefix' => $this->getVar( 'wgDBprefix' ) ) ); + 'tablePrefix' => $this->getVar( 'wgDBprefix' ) + ) ); $grantableNames[] = $this->buildFullUserName( $dbUser, $server ); $tryToCreate = false; } catch ( DBConnectionError $e ) {