From 5019881d1d1c0abcc199e5cdd1500f564e0914bc Mon Sep 17 00:00:00 2001 From: Sean Harvey Date: Mon, 11 Oct 2010 01:09:31 +0000 Subject: [PATCH] MINOR dev/build now shows database name and version next to "Building database ..." text git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@111851 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- core/model/DatabaseAdmin.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/core/model/DatabaseAdmin.php b/core/model/DatabaseAdmin.php index 971c689ee..11ae278a9 100644 --- a/core/model/DatabaseAdmin.php +++ b/core/model/DatabaseAdmin.php @@ -161,10 +161,13 @@ class DatabaseAdmin extends Controller { DB::quiet(); } else { $conn = DB::getConn(); + // Assumes database class is like "MySQLDatabase" or "MSSQLDatabase" (suffixed with "Database") + $dbType = substr(get_class($conn), 0, -8); + $dbVersion = $conn->getVersion(); $databaseName = (method_exists($conn, 'currentDatabase')) ? $conn->currentDatabase() : ""; - if(Director::is_cli()) echo "\n\nBuilding Database $databaseName\n\n"; - else echo "

Building Database $databaseName

"; + if(Director::is_cli()) echo sprintf("\n\nBuilding database %s using %s %s\n\n", $databaseName, $dbType, $dbVersion); + else echo sprintf("

Building database %s using %s %s

", $databaseName, $dbType, $dbVersion); } // Set up the initial database