Commit 775f811a authored by skodak's avatar skodak
Browse files

MDL-16002 rewritten upgrade locking and better upgrade progress tracking;...

MDL-16002 rewritten upgrade locking and better upgrade progress tracking; MDL-16070 Do not use $a[0] syntax in lang packs + various other upgrade improvements and fixes
parent 9deded34
...@@ -33,7 +33,7 @@ if ($frm = data_submitted() and confirm_sesskey()) { ...@@ -33,7 +33,7 @@ if ($frm = data_submitted() and confirm_sesskey()) {
$plugin = "auth/$auth"; $plugin = "auth/$auth";
$name = $matches[1]; $name = $matches[1];
if (!set_config($name, $value, $plugin)) { if (!set_config($name, $value, $plugin)) {
print_error("cannotsaveconfig", 'error', '', array($name, $value, $plugin)); print_error("cannotsaveconfig", 'error', '', (object)array('name'=>$name, 'value'=>$value, 'plugin'=>$plugin));
} }
} }
} }
......
...@@ -819,9 +819,6 @@ if ( file_exists(dirname(dirname(__FILE__)) . '/config.php')) { ...@@ -819,9 +819,6 @@ if ( file_exists(dirname(dirname(__FILE__)) . '/config.php')) {
$DB->get_manager()->install_from_xmldb_file("$CFG->libdir/db/install.xml"); //New method $DB->get_manager()->install_from_xmldb_file("$CFG->libdir/db/install.xml"); //New method
// all new installs are in unicode - keep for backwards compatibility and 1.8 upgrade checks
set_config('unicodedb', 1);
/// Continue with the instalation /// Continue with the instalation
// Install the roles system. // Install the roles system.
...@@ -868,12 +865,6 @@ if ( file_exists(dirname(dirname(__FILE__)) . '/config.php')) { ...@@ -868,12 +865,6 @@ if ( file_exists(dirname(dirname(__FILE__)) . '/config.php')) {
if ($CFG->version) { if ($CFG->version) {
if ($version > $CFG->version) { // upgrade if ($version > $CFG->version) { // upgrade
/// If the database is not already Unicode then we do not allow upgrading!
/// Instead, we print an error telling them to upgrade to 1.7 first. MDL-6857
if (empty($CFG->unicodedb)) {
console_write(STDERR,'unicodeupgradeerror', 'error');
}
$a->oldversion = "$CFG->release ($CFG->version)"; $a->oldversion = "$CFG->release ($CFG->version)";
$a->newversion = "$release ($version)"; $a->newversion = "$release ($version)";
$strdatabasechecking = get_string("databasechecking", "", $a); $strdatabasechecking = get_string("databasechecking", "", $a);
......
This diff is collapsed.
...@@ -404,7 +404,7 @@ ...@@ -404,7 +404,7 @@
if ($location || $plugin) { if ($location || $plugin) {
// file in an extra location // file in an extra location
if ($currentfile != "{$prefix}{$plugin}.php") { if ($currentfile != "{$prefix}{$plugin}.php") {
print_error('filemismatch', 'error', '', array($currectfile, $prefix, $plugin)); print_error('filemismatch', 'error', '', (object)array('current'=>$currectfile, 'file'=>$prefix.$plugin.'.php'));
} }
if (!$uselocal) { if (!$uselocal) {
notify($streditingnoncorelangfile); notify($streditingnoncorelangfile);
...@@ -413,7 +413,7 @@ ...@@ -413,7 +413,7 @@
} else { } else {
// file in standard location // file in standard location
if ($currentfile != $filename) { if ($currentfile != $filename) {
print_error('filemismatch', 'error', '', array($currectfile, $filename, '')); print_error('filemismatch', 'error', '', (object)array('current'=>$currectfile, 'file'=>$filename.'.php'));
} }
} }
...@@ -467,7 +467,7 @@ ...@@ -467,7 +467,7 @@
if (lang_save_file($saveinto, $currentfile, $newstrings, $uselocal, $packstring)) { if (lang_save_file($saveinto, $currentfile, $newstrings, $uselocal, $packstring)) {
notify(get_string("changessaved")." ($saveinto/$currentfile)", "notifysuccess"); notify(get_string("changessaved")." ($saveinto/$currentfile)", "notifysuccess");
} else { } else {
print_error('cannotsavefile', 'error', 'lang.php?mode=compare&currentfile=$currentfile', array($saveinto, $currentfile)); print_error('cannotsavefile', 'error', 'lang.php?mode=compare&currentfile=$currentfile', $saveinto.'/'.$currentfile);
} }
unset($packstring); unset($packstring);
} }
......
...@@ -15,8 +15,8 @@ if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page ...@@ -15,8 +15,8 @@ if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page
// Completion system // Completion system
require_once($CFG->libdir.'/completionlib.php'); require_once($CFG->libdir.'/completionlib.php');
$temp->add(new admin_setting_configcheckbox('enablecompletion',get_string('enablecompletion','completion'),get_string('configenablecompletion','completion'),COMPLETION_DISABLED)); $temp->add(new admin_setting_configcheckbox('enablecompletion', get_string('enablecompletion','completion'), get_string('configenablecompletion','completion'), COMPLETION_DISABLED));
$temp->add(new admin_setting_pickroles('progresstrackedroles',get_string('progresstrackedroles','completion'),get_string('configprogresstrackedroles','completion'))); $temp->add(new admin_setting_pickroles('progresstrackedroles', get_string('progresstrackedroles','completion'), get_string('configprogresstrackedroles', 'completion'), array('moodle/legacy:student')));
$ADMIN->add('misc', $temp); $ADMIN->add('misc', $temp);
......
...@@ -16,11 +16,14 @@ ...@@ -16,11 +16,14 @@
// //
// The commands in here will all be database-neutral, // The commands in here will all be database-neutral,
// using the methods of database_manager class // using the methods of database_manager class
//
// Please do not forget to use upgrade_set_timeout()
// before any action that may take longer time to finish.
function xmldb_backup_upgrade($oldversion=0) { function xmldb_backup_upgrade($oldversion) {
global $CFG, $DB;
global $CFG, $THEME, $DB;
$dbman = $DB->get_manager();
$result = true; $result = true;
/// And upgrade begins here. For each one, you'll need one /// And upgrade begins here. For each one, you'll need one
......
...@@ -16,11 +16,14 @@ ...@@ -16,11 +16,14 @@
// //
// The commands in here will all be database-neutral, // The commands in here will all be database-neutral,
// using the methods of database_manager class // using the methods of database_manager class
//
// Please do not forget to use upgrade_set_timeout()
// before any action that may take longer time to finish.
function xmldb_block_activity_modules_upgrade($oldversion=0) { function xmldb_block_activity_modules_upgrade($oldversion) {
global $CFG, $DB;
global $CFG, $THEME, $DB;
$dbman = $DB->get_manager();
$result = true; $result = true;
/// And upgrade begins here. For each one, you'll need one /// And upgrade begins here. For each one, you'll need one
......
...@@ -16,11 +16,14 @@ ...@@ -16,11 +16,14 @@
// //
// The commands in here will all be database-neutral, // The commands in here will all be database-neutral,
// using the methods of database_manager class // using the methods of database_manager class
//
// Please do not forget to use upgrade_set_timeout()
// before any action that may take longer time to finish.
function xmldb_block_admin_upgrade($oldversion=0) { function xmldb_block_admin_upgrade($oldversion) {
global $CFG, $DB;
global $CFG, $THEME, $DB;
$dbman = $DB->get_manager();
$result = true; $result = true;
/// And upgrade begins here. For each one, you'll need one /// And upgrade begins here. For each one, you'll need one
......
...@@ -16,11 +16,14 @@ ...@@ -16,11 +16,14 @@
// //
// The commands in here will all be database-neutral, // The commands in here will all be database-neutral,
// using the methods of database_manager class // using the methods of database_manager class
//
// Please do not forget to use upgrade_set_timeout()
// before any action that may take longer time to finish.
function xmldb_block_calendar_month_upgrade($oldversion=0) { function xmldb_block_calendar_month_upgrade($oldversion) {
global $CFG, $DB;
global $CFG, $THEME, $DB;
$dbman = $DB->get_manager();
$result = true; $result = true;
/// And upgrade begins here. For each one, you'll need one /// And upgrade begins here. For each one, you'll need one
......
...@@ -16,11 +16,14 @@ ...@@ -16,11 +16,14 @@
// //
// The commands in here will all be database-neutral, // The commands in here will all be database-neutral,
// using the methods of database_manager class // using the methods of database_manager class
//
// Please do not forget to use upgrade_set_timeout()
// before any action that may take longer time to finish.
function xmldb_block_calendar_upcoming_upgrade($oldversion=0) { function xmldb_block_calendar_upcoming_upgrade($oldversion) {
global $CFG, $DB;
global $CFG, $THEME, $DB;
$dbman = $DB->get_manager();
$result = true; $result = true;
/// And upgrade begins here. For each one, you'll need one /// And upgrade begins here. For each one, you'll need one
......
...@@ -16,11 +16,14 @@ ...@@ -16,11 +16,14 @@
// //
// The commands in here will all be database-neutral, // The commands in here will all be database-neutral,
// using the methods of database_manager class // using the methods of database_manager class
//
// Please do not forget to use upgrade_set_timeout()
// before any action that may take longer time to finish.
function xmldb_block_course_list_upgrade($oldversion=0) { function xmldb_block_course_list_upgrade($oldversion) {
global $CFG, $DB;
global $CFG, $THEME, $DB;
$dbman = $DB->get_manager();
$result = true; $result = true;
/// And upgrade begins here. For each one, you'll need one /// And upgrade begins here. For each one, you'll need one
......
...@@ -16,11 +16,14 @@ ...@@ -16,11 +16,14 @@
// //
// The commands in here will all be database-neutral, // The commands in here will all be database-neutral,
// using the methods of database_manager class // using the methods of database_manager class
//
// Please do not forget to use upgrade_set_timeout()
// before any action that may take longer time to finish.
function xmldb_block_course_summary_upgrade($oldversion=0) { function xmldb_block_course_summary_upgrade($oldversion) {
global $CFG, $DB;
global $CFG, $THEME, $DB;
$dbman = $DB->get_manager();
$result = true; $result = true;
/// And upgrade begins here. For each one, you'll need one /// And upgrade begins here. For each one, you'll need one
......
...@@ -16,13 +16,14 @@ ...@@ -16,13 +16,14 @@
// //
// The commands in here will all be database-neutral, // The commands in here will all be database-neutral,
// using the methods of database_manager class // using the methods of database_manager class
//
// Please do not forget to use upgrade_set_timeout()
// before any action that may take longer time to finish.
function xmldb_blocks_upgrade($oldversion=0) { function xmldb_blocks_upgrade($oldversion) {
global $CFG, $DB;
global $CFG, $THEME, $DB;
$dbman = $DB->get_manager(); $dbman = $DB->get_manager();
$result = true; $result = true;
/// And upgrade begins here. For each one, you'll need one /// And upgrade begins here. For each one, you'll need one
......
...@@ -16,11 +16,14 @@ ...@@ -16,11 +16,14 @@
// //
// The commands in here will all be database-neutral, // The commands in here will all be database-neutral,
// using the methods of database_manager class // using the methods of database_manager class
//
// Please do not forget to use upgrade_set_timeout()
// before any action that may take longer time to finish.
function xmldb_block_news_items_upgrade($oldversion=0) { function xmldb_block_news_items_upgrade($oldversion) {
global $CFG, $DB;
global $CFG, $THEME, $DB;
$dbman = $DB->get_manager();
$result = true; $result = true;
/// And upgrade begins here. For each one, you'll need one /// And upgrade begins here. For each one, you'll need one
......
...@@ -16,11 +16,14 @@ ...@@ -16,11 +16,14 @@
// //
// The commands in here will all be database-neutral, // The commands in here will all be database-neutral,
// using the methods of database_manager class // using the methods of database_manager class
//
// Please do not forget to use upgrade_set_timeout()
// before any action that may take longer time to finish.
function xmldb_block_online_users_upgrade($oldversion=0) { function xmldb_block_online_users_upgrade($oldversion) {
global $CFG, $DB;
global $CFG, $THEME, $DB;
$dbman = $DB->get_manager();
$result = true; $result = true;
/// And upgrade begins here. For each one, you'll need one /// And upgrade begins here. For each one, you'll need one
......
...@@ -16,11 +16,14 @@ ...@@ -16,11 +16,14 @@
// //
// The commands in here will all be database-neutral, // The commands in here will all be database-neutral,
// using the methods of database_manager class // using the methods of database_manager class
//
// Please do not forget to use upgrade_set_timeout()
// before any action that may take longer time to finish.
function xmldb_block_participants_upgrade($oldversion=0) { function xmldb_block_participants_upgrade($oldversion) {
global $CFG, $DB;
global $CFG, $THEME, $DB;
$dbman = $DB->get_manager();
$result = true; $result = true;
/// And upgrade begins here. For each one, you'll need one /// And upgrade begins here. For each one, you'll need one
......
...@@ -16,11 +16,14 @@ ...@@ -16,11 +16,14 @@
// //
// The commands in here will all be database-neutral, // The commands in here will all be database-neutral,
// using the methods of database_manager class // using the methods of database_manager class
//
// Please do not forget to use upgrade_set_timeout()
// before any action that may take longer time to finish.
function xmldb_block_recent_activity_upgrade($oldversion=0) { function xmldb_block_recent_activity_upgrade($oldversion) {
global $CFG, $DB;
global $CFG, $THEME, $DB;
$dbman = $DB->get_manager();
$result = true; $result = true;
/// And upgrade begins here. For each one, you'll need one /// And upgrade begins here. For each one, you'll need one
......
...@@ -16,11 +16,14 @@ ...@@ -16,11 +16,14 @@
// //
// The commands in here will all be database-neutral, // The commands in here will all be database-neutral,
// using the methods of database_manager class // using the methods of database_manager class
//
// Please do not forget to use upgrade_set_timeout()
// before any action that may take longer time to finish.
function xmldb_block_rss_client_upgrade($oldversion=0) { function xmldb_block_rss_client_upgrade($oldversion) {
global $CFG, $DB;
global $CFG, $THEME, $DB;
$dbman = $DB->get_manager();
$result = true; $result = true;
/// And upgrade begins here. For each one, you'll need one /// And upgrade begins here. For each one, you'll need one
......
...@@ -107,12 +107,11 @@ $defaultfiletypes = "PDF,TXT,HTML,PPT,XML,DOC,HTM"; ...@@ -107,12 +107,11 @@ $defaultfiletypes = "PDF,TXT,HTML,PPT,XML,DOC,HTM";
if(isset($CFG->block_search_pdf_to_text_cmd)) { if(isset($CFG->block_search_pdf_to_text_cmd)) {
p($CFG->block_search_pdf_to_text_cmd); p($CFG->block_search_pdf_to_text_cmd);
} else { } else {
$encoding = ($CFG->unicodedb) ? "-enc UTF-8" : "-enc ISO-8859-1" ;
if ($CFG->ostype == 'WINDOWS'){ if ($CFG->ostype == 'WINDOWS'){
p("lib/xpdf/win32/pdftotext.exe -eol dos $encoding -q"); p("lib/xpdf/win32/pdftotext.exe -eol dos -enc UTF-8 -q");
} }
else{ else{
p("lib/xpdf/linux/pdftotext $encoding -eol unix -q"); p("lib/xpdf/linux/pdftotext -enc UTF-8 -eol unix -q");
} }
} ?>"/><br/><br/> } ?>"/><br/><br/>
</td> </td>
......
...@@ -16,11 +16,14 @@ ...@@ -16,11 +16,14 @@
// //
// The commands in here will all be database-neutral, // The commands in here will all be database-neutral,
// using the methods of database_manager class // using the methods of database_manager class
//
// Please do not forget to use upgrade_set_timeout()
// before any action that may take longer time to finish.
function xmldb_block_search_upgrade($oldversion=0) { function xmldb_block_search_upgrade($oldversion) {
global $CFG, $DB;
global $CFG, $THEME, $DB;
$dbman = $DB->get_manager();
$result = true; $result = true;
/// And upgrade begins here. For each one, you'll need one /// And upgrade begins here. For each one, you'll need one
......
Supports Markdown
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