Skip to content

Commit

Permalink
MINOR dev/build now shows database name and version next to "Building…
Browse files Browse the repository at this point in the history
… database ..." text (from r111851)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@112931 467b73ca-7a2a-4603-9d3b-597d59a354a9
  • Loading branch information
Sam Minnee committed Oct 19, 2010
1 parent 849bca4 commit 4af7d7a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions core/model/DatabaseAdmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,13 @@ function doBuild($quiet = false, $populate = true, $testMode = false) {
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 "<h2>Building Database $databaseName</h2>";
if(Director::is_cli()) echo sprintf("\n\nBuilding database %s using %s %s\n\n", $databaseName, $dbType, $dbVersion);
else echo sprintf("<h2>Building database %s using %s %s</h2>", $databaseName, $dbType, $dbVersion);
}

// Set up the initial database
Expand Down

0 comments on commit 4af7d7a

Please sign in to comment.