mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 16:32:18 +02:00
MDL-52502 phpunit: Add php, db and os deatils
This commit is contained in:
parent
aeccf4bd94
commit
af2dc48b41
@ -827,7 +827,7 @@ abstract class testing_util {
|
||||
* @return string The site info
|
||||
*/
|
||||
public static function get_site_info() {
|
||||
global $CFG;
|
||||
global $CFG, $DB;
|
||||
|
||||
$output = '';
|
||||
|
||||
@ -836,12 +836,26 @@ abstract class testing_util {
|
||||
$release = null;
|
||||
require("$CFG->dirroot/version.php");
|
||||
|
||||
$output .= "Moodle $release, $CFG->dbtype";
|
||||
$output .= "Moodle $release";
|
||||
if ($hash = self::get_git_hash()) {
|
||||
$output .= ", $hash";
|
||||
}
|
||||
$output .= "\n";
|
||||
|
||||
// Add php version.
|
||||
$phpversion = phpversion();
|
||||
$output .= "Php: ". $phpversion;
|
||||
|
||||
// Add database type and version.
|
||||
$dbtype = $DB->get_dbvendor();
|
||||
$dbinfo = $DB->get_server_info();
|
||||
$dbversion = $dbinfo['version'];
|
||||
$output .= ", " . ucfirst($dbtype) . ": " . $dbversion;
|
||||
|
||||
// OS details.
|
||||
$osdetails = php_uname('s') . " " . php_uname('r') . " " . php_uname('m');
|
||||
$output .= ", OS: " . $osdetails . "\n";
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user