}
/**
- * @return Bool
+ * @return bool
*/
public function isCompiled() {
return self::checkExtension( 'mysql' ) || self::checkExtension( 'mysqli' );
public function submitConnectForm() {
// Get variables from the request.
- $newValues = $this->setVarsFromRequest( array( 'wgDBserver', 'wgDBname', 'wgDBprefix' ) );
+ $newValues = $this->setVarsFromRequest( array(
+ 'wgDBserver', 'wgDBname', 'wgDBprefix', '_InstallUser', '_InstallPassword'
+ ) );
// Validate them.
$status = Status::newGood();
if ( !preg_match( '/^[a-z0-9_-]*$/i', $newValues['wgDBprefix'] ) ) {
$status->fatal( 'config-invalid-db-prefix', $newValues['wgDBprefix'] );
}
+ if ( !strlen( $newValues['_InstallUser'] ) ) {
+ $status->fatal( 'config-db-username-empty' );
+ }
+ if (!strlen( $newValues['_InstallPassword'] ) ) {
+ $status->fatal( 'config-db-password-empty', $newValues['_InstallUser'] );
+ }
if ( !$status->isOK() ) {
return $status;
}
* Return a formal 'User'@'Host' username for use in queries
* @param string $name Username, quotes will be added
* @param string $host Hostname, quotes will be added
- * @return String
+ * @return string
*/
private function buildFullUserName( $name, $host ) {
return $this->db->addQuotes( $name ) . '@' . $this->db->addQuotes( $host );
* access to mysql.user, so false means "no" or "maybe"
* @param string $host Hostname to check
* @param string $user Username to check
- * @return boolean
+ * @return bool
*/
private function userDefinitelyExists( $host, $user ) {
try {
* Return any table options to be applied to all tables that don't
* override them.
*
- * @return String
+ * @return string
*/
protected function getTableOptions() {
$options = array();