This partially reverts commit
c4e284f1130cdc2a4811120594bdb8013d17eaaa
(adding _ to prefixes in tests and readbility / code style fixes are preserved).
It broke all installations which used a table prefix not ending in underscore.
Bug: T227147
Change-Id: I99fc0a2f0fc7b5b321d75fd885763688f92f6d04
/**
* Table name prefix.
- * This should be alphanumeric, contain neither spaces nor hyphens, and end in "_"
+ * Should be alphanumeric plus underscores, and not contain spaces nor hyphens.
+ * Suggested format ends with an underscore.
*/
$wgDBprefix = '';
}
$this->schema = $schema;
if ( !is_string( $prefix ) ) {
- throw new InvalidArgumentException( 'Prefix must be a string.' );
- } elseif ( $prefix !== '' && substr( $prefix, -1, 1 ) !== '_' ) {
- throw new InvalidArgumentException( 'A non-empty prefix must end with "_".' );
+ throw new InvalidArgumentException( "Prefix must be a string." );
}
$this->prefix = $prefix;
}