Commit 9b449bf7 authored by Aaron Wells's avatar Aaron Wells Committed by Robert Lyon
Browse files

Add a <meta name="generator"> tag with the Mahara major version number

Bug 1384497. This also adds a new $config->series to lib/version.php,
which stores the major version (or as we sometimes call it, "the series")
of the current release. It seemed better to store this separately rather
than to try to parse it from $config->release, because we may change
our release numbering strategy in the future.

Change-Id: If4c0d7352e9433cdaf54a03bb922356d6c950e7d
parent 14ea78cb
...@@ -49,6 +49,10 @@ function check_upgrades($name=null) { ...@@ -49,6 +49,10 @@ function check_upgrades($name=null) {
catch (Exception $e) { catch (Exception $e) {
$coreversion = 0; $coreversion = 0;
} }
$core = new stdClass();
$core->to = $config->version;
$core->torelease = $config->release;
$core->toseries = $config->series;
if (empty($coreversion)) { if (empty($coreversion)) {
if (is_mysql()) { // Show a more informative error message if using mysql with skip-innodb if (is_mysql()) { // Show a more informative error message if using mysql with skip-innodb
// In MySQL 5.6.x, we run the command 'SHOW ENGINES' to check if InnoDB is enabled or not // In MySQL 5.6.x, we run the command 'SHOW ENGINES' to check if InnoDB is enabled or not
...@@ -67,11 +71,7 @@ function check_upgrades($name=null) { ...@@ -67,11 +71,7 @@ function check_upgrades($name=null) {
throw new ConfigSanityException("Mahara requires InnoDB tables. Please ensure InnoDB tables are enabled in your MySQL server."); throw new ConfigSanityException("Mahara requires InnoDB tables. Please ensure InnoDB tables are enabled in your MySQL server.");
} }
} }
$core = new StdClass;
$core->install = true; $core->install = true;
$core->to = $config->version;
$core->torelease = $config->release;
$toupgrade['core'] = $core;
$installing = true; $installing = true;
} }
else if ($config->version > $coreversion) { else if ($config->version > $coreversion) {
...@@ -82,14 +82,11 @@ function check_upgrades($name=null) { ...@@ -82,14 +82,11 @@ function check_upgrades($name=null) {
. "($config->minupgraderelease) first " . "($config->minupgraderelease) first "
. " (you have $coreversion ($corerelease)"); . " (you have $coreversion ($corerelease)");
} }
$core = new StdClass;
$core->upgrade = true; $core->upgrade = true;
$core->from = $coreversion; $core->from = $coreversion;
$core->fromrelease = $corerelease; $core->fromrelease = $corerelease;
$core->to = $config->version;
$core->torelease = $config->release;
$toupgrade['core'] = $core;
} }
$toupgrade['core'] = $core;
} }
// If we were just checking if the core needed to be upgraded, we can stop here // If we were just checking if the core needed to be upgraded, we can stop here
...@@ -297,6 +294,7 @@ function upgrade_core($upgrade) { ...@@ -297,6 +294,7 @@ function upgrade_core($upgrade) {
set_config('version', $upgrade->to); set_config('version', $upgrade->to);
set_config('release', $upgrade->torelease); set_config('release', $upgrade->torelease);
set_config('series', $upgrade->toseries);
if (!empty($upgrade->install)) { if (!empty($upgrade->install)) {
core_postinst(); core_postinst();
......
...@@ -15,7 +15,8 @@ $config = new stdClass(); ...@@ -15,7 +15,8 @@ $config = new stdClass();
// See https://wiki.mahara.org/index.php/Developer_Area/Version_Numbering_Policy // See https://wiki.mahara.org/index.php/Developer_Area/Version_Numbering_Policy
// For upgrades on stable branches, increment the version by one. On master, use the date. // For upgrades on stable branches, increment the version by one. On master, use the date.
$config->version = 2014032714; $config->version = 2014032715;
$config->series = '1.9';
$config->release = '1.9.4testing'; $config->release = '1.9.4testing';
$config->minupgradefrom = 2009022600; $config->minupgradefrom = 2009022600;
$config->minupgraderelease = '1.1.0 (release tag 1.1.0_RELEASE)'; $config->minupgraderelease = '1.1.0 (release tag 1.1.0_RELEASE)';
......
...@@ -533,6 +533,7 @@ EOF; ...@@ -533,6 +533,7 @@ EOF;
$javascript_array = append_version_number($javascript_array); $javascript_array = append_version_number($javascript_array);
$smarty->assign_by_ref('JAVASCRIPT', $javascript_array); $smarty->assign_by_ref('JAVASCRIPT', $javascript_array);
$smarty->assign('RELEASE', get_config('release')); $smarty->assign('RELEASE', get_config('release'));
$smarty->assign('SERIES', get_config('series'));
$siteclosedforupgrade = get_config('siteclosed'); $siteclosedforupgrade = get_config('siteclosed');
if ($siteclosedforupgrade && get_config('disablelogin')) { if ($siteclosedforupgrade && get_config('disablelogin')) {
$smarty->assign('SITECLOSED', 'logindisabled'); $smarty->assign('SITECLOSED', 'logindisabled');
......
<head> <head>
<meta name="generator" content="Mahara {$SERIES} (https://mahara.org)" />
<meta http-equiv="Content-type" content="text/html; charset=UTF-8"> <meta http-equiv="Content-type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=8; IE=9; IE=10" /> <meta http-equiv="X-UA-Compatible" content="IE=8; IE=9; IE=10" />
<meta property="og:title" content="{$PAGETITLE}" /> <meta property="og:title" content="{$PAGETITLE}" />
......
<head> <head>
<meta name="generator" content="Mahara {$SERIES} (https://mahara.org)" />
<meta http-equiv="Content-type" content="text/html; charset=UTF-8"> <meta http-equiv="Content-type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=8; IE=9; IE=10" /> <meta http-equiv="X-UA-Compatible" content="IE=8; IE=9; IE=10" />
<meta property="og:title" content="{$PAGETITLE}" /> <meta property="og:title" content="{$PAGETITLE}" />
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment