'wgDBpassword',
'wgDBprefix',
'wgDBTableOptions',
- 'wgDBmysql5',
];
protected $internalDefaults = [
public $supportedEngines = [ 'InnoDB', 'MyISAM' ];
- public $minimumVersion = '5.5.8';
+ public static $minimumVersion = '5.5.8';
+ protected static $notMiniumumVerisonMessage = 'config-mysql-old';
public $webUserPrivs = [
'DELETE',
* @return bool
*/
public function isCompiled() {
- return self::checkExtension( 'mysql' ) || self::checkExtension( 'mysqli' );
+ return self::checkExtension( 'mysqli' );
}
/**
$conn = $status->value;
// Check version
- $version = $conn->getServerVersion();
- if ( version_compare( $version, $this->minimumVersion ) < 0 ) {
- return Status::newFatal( 'config-mysql-old', $this->minimumVersion, $version );
- }
-
- return $status;
+ return static::meetsMinimumRequirement( $conn->getServerVersion() );
}
/**
/**
* @param string $s
+ * @param string $escapeChar
* @return string
*/
protected function escapeLikeInternal( $s, $escapeChar = '`' ) {
if ( !$status->isOK() ) {
return false;
}
- /** @var $conn Database */
+ /** @var Database $conn */
$conn = $status->value;
// Get current account name
/**
* Convert a wildcard (as used in LIKE) to a regex
* Slashes are escaped, slash terminators included
+ * @param string $wildcard
+ * @return string
*/
protected function likeToRegex( $wildcard ) {
$r = preg_quote( $wildcard, '/' );
$this->setVar( '_MysqlCharset', reset( $charsets ) );
}
- // Do charset selector
- if ( count( $charsets ) >= 2 ) {
- // getRadioSet() builds a set of labeled radio buttons.
- // For grep: The following messages are used as the item labels:
- // config-mysql-binary, config-mysql-utf8
- $s .= $this->getRadioSet( [
- 'var' => '_MysqlCharset',
- 'label' => 'config-mysql-charset',
- 'itemLabelPrefix' => 'config-mysql-',
- 'values' => $charsets
- ] );
- $s .= $this->parent->getHelpBox( 'config-mysql-charset-help' );
- }
-
return $s;
}
}
public function getLocalSettings() {
- $dbmysql5 = wfBoolToStr( $this->getVar( 'wgDBmysql5', true ) );
$prefix = LocalSettingsGenerator::escapePhpString( $this->getVar( 'wgDBprefix' ) );
$tblOpts = LocalSettingsGenerator::escapePhpString( $this->getTableOptions() );
\$wgDBprefix = \"{$prefix}\";
# MySQL table options to use during installation or update
-\$wgDBTableOptions = \"{$tblOpts}\";
-
-# Experimental charset support for MySQL 5.0.
-\$wgDBmysql5 = {$dbmysql5};";
+\$wgDBTableOptions = \"{$tblOpts}\";";
}
}