mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 14:27:22 +01:00
Merge branch 'MDL-26609-version-maturity' of git://github.com/mudrd8mz/moodle
This commit is contained in:
commit
5f9f0717fe
@ -70,6 +70,8 @@ Options:
|
||||
problem encountered.
|
||||
--agree-license Indicates agreement with software license,
|
||||
required in non-interactive mode.
|
||||
--allow-unstable Install even if the version is not marked as stable yet,
|
||||
required in non-interactive mode.
|
||||
-h, --help Print out this help
|
||||
|
||||
Example:
|
||||
@ -136,9 +138,6 @@ $CFG->early_install_lang = true;
|
||||
$parts = explode('/', str_replace('\\', '/', dirname(dirname(__FILE__))));
|
||||
$CFG->admin = array_pop($parts);
|
||||
|
||||
require($CFG->dirroot.'/version.php');
|
||||
$CFG->target_release = $release;
|
||||
|
||||
//point pear include path to moodles lib/pear so that includes and requires will search there for files before anywhere else
|
||||
//the problem is that we need specific version of quickforms and hacked excel files :-(
|
||||
ini_set('include_path', $CFG->libdir.'/pear' . PATH_SEPARATOR . ini_get('include_path'));
|
||||
@ -154,6 +153,9 @@ require_once($CFG->libdir.'/deprecatedlib.php');
|
||||
require_once($CFG->libdir.'/adminlib.php');
|
||||
require_once($CFG->libdir.'/componentlib.class.php');
|
||||
|
||||
require($CFG->dirroot.'/version.php');
|
||||
$CFG->target_release = $release;
|
||||
|
||||
//Database types
|
||||
$databases = array('mysqli' => moodle_database::get_driver_instance('mysqli', 'native'),
|
||||
'pgsql' => moodle_database::get_driver_instance('pgsql', 'native'),
|
||||
@ -193,6 +195,7 @@ list($options, $unrecognized) = cli_get_params(
|
||||
'adminpass' => '',
|
||||
'non-interactive' => false,
|
||||
'agree-license' => false,
|
||||
'allow-unstable' => false,
|
||||
'help' => false
|
||||
),
|
||||
array(
|
||||
@ -402,6 +405,28 @@ $CFG->langotherroot = $CFG->dataroot.'/lang';
|
||||
$CFG->langlocalroot = $CFG->dataroot.'/lang';
|
||||
get_string_manager(true);
|
||||
|
||||
// make sure we are installing stable release or require a confirmation
|
||||
if (isset($maturity)) {
|
||||
if (($maturity < MATURITY_STABLE) and !$options['allow-unstable']) {
|
||||
$maturitylevel = get_string('maturity'.$maturity, 'admin');
|
||||
|
||||
if ($interactive) {
|
||||
cli_separator();
|
||||
cli_heading(get_string('notice'));
|
||||
echo get_string('maturitycorewarning', 'admin', $maturitylevel) . PHP_EOL;
|
||||
echo get_string('morehelp') . ': ' . get_docs_url('admin/versions') . PHP_EOL;
|
||||
echo get_string('continue') . PHP_LOL;
|
||||
$prompt = get_string('cliyesnoprompt', 'admin');
|
||||
$input = cli_input($prompt, '', array(get_string('clianswerno', 'admin'), get_string('cliansweryes', 'admin')));
|
||||
if ($input == get_string('clianswerno', 'admin')) {
|
||||
exit(1);
|
||||
}
|
||||
} else {
|
||||
cli_error(get_string('maturitycorewarning', 'admin'));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ask for db type - show only drivers available
|
||||
if ($interactive) {
|
||||
$options['dbtype'] = strtolower($options['dbtype']);
|
||||
|
@ -40,8 +40,16 @@ require_once($CFG->libdir.'/environmentlib.php');
|
||||
|
||||
|
||||
// now get cli options
|
||||
list($options, $unrecognized) = cli_get_params(array('non-interactive'=>false, 'help'=>false),
|
||||
array('h'=>'help'));
|
||||
list($options, $unrecognized) = cli_get_params(
|
||||
array(
|
||||
'non-interactive' => false,
|
||||
'allow-unstable' => false,
|
||||
'help' => false
|
||||
),
|
||||
array(
|
||||
'h' => 'help'
|
||||
)
|
||||
);
|
||||
|
||||
$interactive = empty($options['non-interactive']);
|
||||
|
||||
@ -59,6 +67,8 @@ Site defaults may be changed via local/defaults.php.
|
||||
|
||||
Options:
|
||||
--non-interactive No interactive questions or confirmations
|
||||
--allow-unstable Upgrade even if the version is not marked as stable yet,
|
||||
required in non-interactive mode.
|
||||
-h, --help Print out this help
|
||||
|
||||
Example:
|
||||
@ -73,13 +83,14 @@ if (empty($CFG->version)) {
|
||||
cli_error(get_string('missingconfigversion', 'debug'));
|
||||
}
|
||||
|
||||
require("$CFG->dirroot/version.php"); // defines $version and $release
|
||||
require("$CFG->dirroot/version.php"); // defines $version, $release and $maturity
|
||||
$CFG->target_release = $release; // used during installation and upgrades
|
||||
|
||||
if ($version < $CFG->version) {
|
||||
cli_error(get_string('downgradedcore', 'error'));
|
||||
}
|
||||
|
||||
$oldversion = "$CFG->release ($CFG->version)";
|
||||
$newversion = "$release ($version)";
|
||||
|
||||
// test environment first
|
||||
@ -93,6 +104,30 @@ if (!check_moodle_environment($version, $environment_results, false, ENV_SELECT_
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if ($interactive) {
|
||||
$a = new stdClass();
|
||||
$a->oldversion = $oldversion;
|
||||
$a->newversion = $newversion;
|
||||
echo cli_heading(get_string('databasechecking', '', $a)) . PHP_EOL;
|
||||
}
|
||||
|
||||
// make sure we are upgrading to a stable release or display a warning
|
||||
if (isset($maturity)) {
|
||||
if (($maturity < MATURITY_STABLE) and !$options['allow-unstable']) {
|
||||
$maturitylevel = get_string('maturity'.$maturity, 'admin');
|
||||
|
||||
if ($interactive) {
|
||||
cli_separator();
|
||||
cli_heading(get_string('notice'));
|
||||
echo get_string('maturitycorewarning', 'admin', $maturitylevel) . PHP_EOL;
|
||||
echo get_string('morehelp') . ': ' . get_docs_url('admin/versions') . PHP_EOL;
|
||||
cli_separator();
|
||||
} else {
|
||||
cli_error(get_string('maturitycorewarning', 'admin', $maturitylevel));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($interactive) {
|
||||
echo html_to_text(get_string('upgradesure', 'admin', $newversion))."\n";
|
||||
$prompt = get_string('cliyesnoprompt', 'admin');
|
||||
|
@ -86,7 +86,7 @@ if (!isset($CFG->version)) {
|
||||
|
||||
$version = null;
|
||||
$release = null;
|
||||
require("$CFG->dirroot/version.php"); // defines $version and $release
|
||||
require("$CFG->dirroot/version.php"); // defines $version, $release and $maturity
|
||||
$CFG->target_release = $release; // used during installation and upgrades
|
||||
|
||||
if (!$version or !$release) {
|
||||
@ -130,14 +130,26 @@ if (!core_tables_exist()) {
|
||||
if (empty($confirmrelease)) {
|
||||
$strcurrentrelease = get_string('currentrelease');
|
||||
$PAGE->navbar->add($strcurrentrelease);
|
||||
$PAGE->set_title($strinstallation.' - Moodle '.$CFG->target_release);
|
||||
$PAGE->set_heading($strinstallation);
|
||||
$PAGE->set_title($strinstallation);
|
||||
$PAGE->set_heading($strinstallation . ' - Moodle ' . $CFG->target_release);
|
||||
$PAGE->set_cacheable(false);
|
||||
echo $OUTPUT->header();
|
||||
echo $OUTPUT->heading("Moodle $release");
|
||||
|
||||
if (isset($maturity)) {
|
||||
// main version.php declares moodle code maturity
|
||||
if ($maturity < MATURITY_STABLE) {
|
||||
$maturitylevel = get_string('maturity'.$maturity, 'admin');
|
||||
echo $OUTPUT->box(
|
||||
$OUTPUT->container(get_string('maturitycorewarning', 'admin', $maturitylevel)) .
|
||||
$OUTPUT->container($OUTPUT->doc_link('admin/versions', get_string('morehelp'))),
|
||||
'generalbox maturitywarning');
|
||||
}
|
||||
}
|
||||
|
||||
$releasenoteslink = get_string('releasenoteslink', 'admin', 'http://docs.moodle.org/en/Release_Notes');
|
||||
$releasenoteslink = str_replace('target="_blank"', 'onclick="this.target=\'_blank\'"', $releasenoteslink); // extremely ugly validation hack
|
||||
echo $OUTPUT->box($releasenoteslink, 'generalbox boxaligncenter boxwidthwide');
|
||||
echo $OUTPUT->box($releasenoteslink, 'generalbox releasenoteslink');
|
||||
|
||||
require_once($CFG->libdir.'/environmentlib.php');
|
||||
if (!check_moodle_environment($release, $environment_results, true, ENV_SELECT_RELEASE)) {
|
||||
@ -189,11 +201,20 @@ if ($version > $CFG->version) { // upgrade
|
||||
$strdatabasechecking = get_string('databasechecking', '', $a);
|
||||
|
||||
if (empty($confirmupgrade)) {
|
||||
$PAGE->navbar->add($strdatabasechecking);
|
||||
$PAGE->set_title($strdatabasechecking);
|
||||
$PAGE->set_heading($stradministration);
|
||||
$PAGE->set_title($stradministration);
|
||||
$PAGE->set_heading($strdatabasechecking);
|
||||
$PAGE->set_cacheable(false);
|
||||
echo $OUTPUT->header();
|
||||
if (isset($maturity)) {
|
||||
// main version.php declares moodle code maturity
|
||||
if ($maturity < MATURITY_STABLE) {
|
||||
$maturitylevel = get_string('maturity'.$maturity, 'admin');
|
||||
echo $OUTPUT->box(
|
||||
$OUTPUT->container(get_string('maturitycorewarning', 'admin', $maturitylevel)) .
|
||||
$OUTPUT->container($OUTPUT->doc_link('admin/versions', get_string('morehelp'))),
|
||||
'generalbox maturitywarning');
|
||||
}
|
||||
}
|
||||
$continueurl = new moodle_url('index.php', array('confirmupgrade' => 1));
|
||||
$cancelurl = new moodle_url('index.php');
|
||||
echo $OUTPUT->confirm(get_string('upgradesure', 'admin', $a->newversion), $continueurl, $cancelurl);
|
||||
|
@ -680,6 +680,13 @@ $string['maintinprogress'] = 'Maintenance is in progress...';
|
||||
$string['managelang'] = 'Manage';
|
||||
$string['managelicenses'] = 'Manage licences';
|
||||
$string['manageqtypes'] = 'Manage question types';
|
||||
$string['maturity50'] = 'Alpha';
|
||||
$string['maturity100'] = 'Beta';
|
||||
$string['maturity150'] = 'Release candidate';
|
||||
$string['maturity200'] = 'Stable version';
|
||||
$string['maturitycorewarning'] = 'You are going to install or upgrade Moodle to a version marked as "{$a}"
|
||||
that is not considered as production-ready yet. Please make sure this is intentional
|
||||
and that you are using correct checkout of Moodle source code.';
|
||||
$string['maxbytes'] = 'Maximum uploaded file size';
|
||||
$string['maxconsecutiveidentchars'] = 'Consecutive identical characters';
|
||||
$string['maxeditingtime'] = 'Maximum time to edit posts';
|
||||
|
@ -386,7 +386,7 @@ $string['currentlyselectedusers'] = 'Currently selected users';
|
||||
$string['currentpicture'] = 'Current picture';
|
||||
$string['currentrelease'] = 'Current release information';
|
||||
$string['currentversion'] = 'Current version';
|
||||
$string['databasechecking'] = 'Upgrading Moodle database from version {$a->oldversion} to {$a->newversion}...';
|
||||
$string['databasechecking'] = 'Upgrading Moodle database from version {$a->oldversion} to {$a->newversion}';
|
||||
$string['databaseperformance'] = 'Database performance';
|
||||
$string['databasesetup'] = 'Setting up database';
|
||||
$string['databasesuccess'] = 'Database was successfully upgraded';
|
||||
|
@ -53,6 +53,14 @@ define('MEMORY_EXTRA', -3);
|
||||
/** Extremely large memory limit - not recommended for standard scripts */
|
||||
define('MEMORY_HUGE', -4);
|
||||
|
||||
/**
|
||||
* Software maturity levels used by the core and plugins
|
||||
*/
|
||||
define('MATURITY_ALPHA', 50); // internals can be tested using white box techniques
|
||||
define('MATURITY_BETA', 100); // feature complete, ready for preview and testing
|
||||
define('MATURITY_RC', 150); // tested, will be released unless there are fatal bugs
|
||||
define('MATURITY_STABLE', 200); // ready for production deployment
|
||||
|
||||
/**
|
||||
* Simple class. It is usually used instead of stdClass because it looks
|
||||
* more familiar to Java developers ;-) Do not use for type checking of
|
||||
|
@ -23,6 +23,9 @@
|
||||
#page-admin-index .adminerror,
|
||||
#page-admin-index .adminwarning {margin:20px;}
|
||||
|
||||
#page-admin-index .maturitywarning {margin-left:auto;margin-right:auto;text-align:center;width:60%;background-color:#ffd3d9;}
|
||||
#page-admin-index .releasenoteslink {margin-left:auto;margin-right:auto;text-align:center;width:60%;}
|
||||
|
||||
#page-admin-enrol .enrolplugintable {width:700px;margin:1em auto;}
|
||||
|
||||
#page-admin-report-capability-index #settingsform h2,
|
||||
@ -144,4 +147,4 @@ table.flexible .r1 {background-color: #FAFAFA;}
|
||||
*/
|
||||
#page-admin-webservice-service_users .missingcaps {color: #ff6600;font-size: 90%;}
|
||||
#page-admin-setting-webservicetokens .missingcaps {color: #ff6600;font-size: 90%;}
|
||||
#page-admin-webservice-service_functions .functiondesc {font-size: 90%;}
|
||||
#page-admin-webservice-service_functions .functiondesc {font-size: 90%;}
|
||||
|
@ -29,7 +29,10 @@
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$version = 2011030300.00; // YYYYMMDD = date of the last version bump
|
||||
// XX = daily increments
|
||||
|
||||
$release = '2.0.2+ (Build: 20110303)'; // Human-friendly version name
|
||||
$version = 2011030300.00; // YYYYMMDD = date of the last version bump
|
||||
// XX = daily increments
|
||||
|
||||
$release = '2.0.2+ (Build: 20110303)'; // Human-friendly version name
|
||||
|
||||
$maturity = MATURITY_STABLE; // this version's maturity level
|
||||
|
Loading…
x
Reference in New Issue
Block a user