* Removed f-prot support from $wgAntivirusSetup.
* New variable $wgDBerrorLogTZ to provide dates in the error log in a
different timezone than the wiki timezone set by $wgLocalTimezone.
+* New variables $wgDBssl and $wgDBcompress to enable SSL and compression for database
+ connections, if either are available for the selected DB type.
=== New features in 1.20 ===
* Added TitleIsAlwaysKnown hook which gets called when determining if a page exists.
$wgDBpassword = '';
/** Database type */
$wgDBtype = 'mysql';
+/** Whether to use SSL in DB connection. */
+$wgDBssl = false;
+/** Whether to use compression in DB connection. */
+$wgDBcompress = false;
/** Separate username for maintenance tasks. Leave as null to use the default. */
$wgDBadminuser = null;
* - DBO_IGNORE -- ignore errors (not useful in LocalSettings.php)
* - DBO_NOBUFFER -- turn off buffering (not useful in LocalSettings.php)
* - DBO_PERSISTENT -- enables persistent database connections
+ * - DBO_SSL -- uses SSL/TLS encryption in database connections, if available
+ * - DBO_COMPRESS -- uses internal compression in database connections, if available
*
* - max lag: (optional) Maximum replication lag before a slave will taken out of rotation
* - max threads: (optional) Maximum number of running threads
define( 'DBO_PERSISTENT', 32 );
define( 'DBO_SYSDBA', 64 ); //for oracle maintenance
define( 'DBO_DDLMODE', 128 ); // when using schema files: mostly for Oracle
+define( 'DBO_SSL', 256 );
+define( 'DBO_COMPRESS', 512 );
/**@}*/
/**@{
$this->mPassword = $password;
$this->mDBname = $dbName;
+ $connFlags = 0;
+ if ( $this->mFlags & DBO_SSL ) {
+ $connFlags |= MYSQL_CLIENT_SSL;
+ }
+ if ( $this->mFlags & DBO_COMPRESS ) {
+ $connFlags |= MYSQL_CLIENT_COMPRESS;
+ }
+
wfProfileIn("dbconnect-$server");
# The kernel's default SYN retransmission period is far too slow for us,
usleep( 1000 );
}
if ( $this->mFlags & DBO_PERSISTENT ) {
- $this->mConn = mysql_pconnect( $realServer, $user, $password );
+ $this->mConn = mysql_pconnect( $realServer, $user, $password, $connFlags );
} else {
# Create a new connection...
- $this->mConn = mysql_connect( $realServer, $user, $password, true );
+ $this->mConn = mysql_connect( $realServer, $user, $password, true, $connFlags );
}
#if ( $this->mConn === false ) {
#$iplus = $i + 1;
if ( $port != false && $port != '' ) {
$connectVars['port'] = $port;
}
+ if ( $this->mFlags & DBO_SSL ) {
+ $connectVars['sslmode'] = 1;
+ }
+
$this->connectString = $this->makeConnectionString( $connectVars, PGSQL_CONNECT_FORCE_NEW );
$this->close();
$this->installErrorHandler();
$servers = $wgDBservers;
} else {
global $wgDBserver, $wgDBuser, $wgDBpassword, $wgDBname, $wgDBtype, $wgDebugDumpSql;
+ global $wgDBssl, $wgDBcompress;
+
+ $flags = ( $wgDebugDumpSql ? DBO_DEBUG : 0 ) | DBO_DEFAULT;
+ if ( $wgDBssl ) {
+ $flags |= DBO_SSL;
+ }
+ if ( $wgDBcompress ) {
+ $flags |= DBO_COMPRESS;
+ }
+
$servers = array(array(
'host' => $wgDBserver,
'user' => $wgDBuser,
'dbname' => $wgDBname,
'type' => $wgDBtype,
'load' => 1,
- 'flags' => ($wgDebugDumpSql ? DBO_DEBUG : 0) | DBO_DEFAULT
+ 'flags' => $flags
));
}