Consistently use '@deprecated since <version>'
[lhc/web/wiklou.git] / includes / db / DatabaseMysqlBase.php
index 85be31c..d437c4c 100644 (file)
@@ -93,7 +93,7 @@ abstract class DatabaseMysqlBase extends DatabaseBase {
                        if ( !$error ) {
                                $error = $this->lastError();
                        }
-                       wfLogDBError( "Error connecting to {$this->mServer}: $error\n" );
+                       wfLogDBError( "Error connecting to {$this->mServer}: $error" );
                        wfDebug( "DB connection error\n" .
                                "Server: $server, User: $user, Password: " .
                                substr( $password, 0, 3 ) . "..., error: " . $error . "\n" );
@@ -108,7 +108,7 @@ abstract class DatabaseMysqlBase extends DatabaseBase {
                        $success = $this->selectDB( $dbName );
                        wfRestoreWarnings();
                        if ( !$success ) {
-                               wfLogDBError( "Error selecting database $dbName on server {$this->mServer}\n" );
+                               wfLogDBError( "Error selecting database $dbName on server {$this->mServer}" );
                                wfDebug( "Error selecting database $dbName on server {$this->mServer} " .
                                        "from client host " . wfHostname() . "\n" );
 
@@ -638,7 +638,7 @@ abstract class DatabaseMysqlBase extends DatabaseBase {
        }
 
        /**
-        * @deprecated in 1.19, use getLagFromSlaveStatus
+        * @deprecated since 1.19, use getLagFromSlaveStatus
         *
         * @return bool|int
         */
@@ -804,14 +804,18 @@ abstract class DatabaseMysqlBase extends DatabaseBase {
         * @return string
         */
        public function getSoftwareLink() {
+               // MariaDB includes its name in its version string (sent when the connection is opened),
+               // and this is how MariaDB's version of the mysql command-line client identifies MariaDB
+               // servers (see the mariadb_connection() function in libmysql/libmysql.c).
                $version = $this->getServerVersion();
-               if ( strpos( $version, 'MariaDB' ) !== false ) {
+               if ( strpos( $version, 'MariaDB' ) !== false || strpos( $version, '-maria-' ) !== false ) {
                        return '[{{int:version-db-mariadb-url}} MariaDB]';
-               } elseif ( strpos( $version, 'percona' ) !== false ) {
-                       return '[{{int:version-db-percona-url}} Percona Server]';
-               } else {
-                       return '[{{int:version-db-mysql-url}} MySQL]';
                }
+
+               // Percona Server's version suffix is not very distinctive, and @@version_comment
+               // doesn't give the necessary info for source builds, so assume the server is MySQL.
+               // (Even Percona's version of mysql doesn't try to make the distinction.)
+               return '[{{int:version-db-mysql-url}} MySQL]';
        }
 
        /**