array( 'name' => 'tables', 'callback' => array( $this, 'installTables' ) ),
array( 'name' => 'interwiki', 'callback' => array( $installer, 'populateInterwikiTable' ) ),
array( 'name' => 'secretkey', 'callback' => array( $this, 'generateSecretKey' ) ),
- array( 'name' => 'upgradekey', 'callback' => array( $this, 'generateUpgradeKey' ) ),
array( 'name' => 'sysop', 'callback' => array( $this, 'createSysop' ) ),
array( 'name' => 'mainpage', 'callback' => array( $this, 'createMainpage' ) ),
);
$this->setVar( 'wgSecretKey', $secretKey );
- return $status;
- }
+ // Generate a $wgUpgradeKey from our secret key
+ $secretKey = md5( $secretKey );
+ $randPos = mt_rand( 0, strlen( $secretKey ) - 8 );
+ $this->setVar( 'wgUpgradeKey', substr( $secretKey, $randPos, $randPos + 8 ) );
- /**
- * Generate a default $wgUpradeKey, using a semi-random 8 character portion
- * of md5($wgSecretKey)
- *
- * @return Status
- */
- protected function generateUpgradeKey() {
- $secret = md5( $this->getVar( 'wgSecretKey' ) );
- $randPos = mt_rand( 0, strlen( $secret ) - 8 );
- $this->setVar( 'wgUpgradeKey', substr( $secret, $randPos, $randPos + 8 ) );
- return Status::newGood();
+ return $status;
}
/**