Beispiel #1
0
/// Check all enrolment plugins and upgrade if necessary
/// first old *.php update and then the new upgrade.php script
upgrade_plugins('enrol', 'enrol', "{$CFG->wwwroot}/{$CFG->admin}/index.php");
// Return here afterwards
/// Check all auth plugins and upgrade if necessary
upgrade_plugins('auth', 'auth', "{$CFG->wwwroot}/{$CFG->admin}/index.php");
/// Check all course formats and upgrade if necessary
upgrade_plugins('format', 'course/format', "{$CFG->wwwroot}/{$CFG->admin}/index.php");
/// Check for local database customisations
/// first old *.php update and then the new upgrade.php script
require_once "{$CFG->dirroot}/lib/locallib.php";
upgrade_local_db("{$CFG->wwwroot}/{$CFG->admin}/index.php");
// Return here afterwards
/// Check for changes to RPC functions
require_once "{$CFG->dirroot}/{$CFG->admin}/mnet/adminlib.php";
upgrade_RPC_functions("{$CFG->wwwroot}/{$CFG->admin}/index.php");
// Return here afterwards
/// Upgrade all plugins for gradebook
upgrade_plugins('gradeexport', 'grade/export', "{$CFG->wwwroot}/{$CFG->admin}/index.php");
upgrade_plugins('gradeimport', 'grade/import', "{$CFG->wwwroot}/{$CFG->admin}/index.php");
upgrade_plugins('gradereport', 'grade/report', "{$CFG->wwwroot}/{$CFG->admin}/index.php");
/// Check all message output plugins and upgrade if necessary
upgrade_plugins('message', 'message/output', "{$CFG->wwwroot}/{$CFG->admin}/index.php");
/// Check all course report plugins and upgrade if necessary
upgrade_plugins('coursereport', 'course/report', "{$CFG->wwwroot}/{$CFG->admin}/index.php");
/// Check all admin report plugins and upgrade if necessary
upgrade_plugins('report', $CFG->admin . '/report', "{$CFG->wwwroot}/{$CFG->admin}/index.php");
/// just make sure upgrade logging is properly terminated
upgrade_log_finish();
unset($_SESSION['installautopilot']);
/// Set up the blank site - to be customized later at the end of install.
Beispiel #2
0
/**
 * Upgrade/install other parts of moodle
 * @param bool $verbose
 * @return void, may throw exception
 */
function upgrade_noncore($verbose)
{
    global $CFG;
    // upgrade all plugins types
    try {
        $plugintypes = get_plugin_types();
        foreach ($plugintypes as $type => $location) {
            upgrade_plugins($type, 'print_upgrade_part_start', 'print_upgrade_part_end', $verbose);
        }
    } catch (Exception $ex) {
        upgrade_handle_exception($ex);
    }
    // Check for changes to RPC functions
    if ($CFG->mnet_dispatcher_mode != 'off') {
        try {
            // this needs a full rewrite, sorry to mention that :-(
            // we have to make it part of standard WS framework
            require_once "{$CFG->dirroot}/{$CFG->admin}/mnet/adminlib.php";
            upgrade_RPC_functions();
            // Return here afterwards
        } catch (Exception $ex) {
            upgrade_handle_exception($ex);
        }
    }
}
Beispiel #3
0
$DB->get_manager()->install_from_xmldb_file("{$CFG->libdir}/db/install.xml");
/// set all core default records and default settings
require_once "{$CFG->libdir}/db/install.php";
xmldb_main_install($version);
/// Continue with the instalation
// Install the roles system.
moodle_install_roles();
// Install core event handlers
events_update_definition();
// Install core message providers
message_update_providers();
message_update_providers('message');
// Write default settings unconditionally (i.e. even if a setting is already set, overwrite it)
admin_apply_default_settings(NULL, true);
/// upgrade all plugins types
$plugintypes = get_plugin_types();
foreach ($plugintypes as $type => $location) {
    upgrade_plugins($type);
}
/// Check for changes to RPC functions
if ($CFG->mnet_dispatcher_mode != 'off') {
    require_once "{$CFG->dirroot}/{$CFG->admin}/mnet/adminlib.php";
    upgrade_RPC_functions($return_url);
    // Return here afterwards
}
/// just make sure upgrade logging is properly terminated
upgrade_finished();
/// make sure admin user is created - this is the last step because we need
/// session to be working properly in order to edit admin account
create_admin_user();
redirect('index.php');
Beispiel #4
0
}
/// upgrade all plugins types
try {
    $plugintypes = get_plugin_types();
    foreach ($plugintypes as $type => $location) {
        upgrade_plugins($type, $location, 'print_upgrade_part_start', 'print_upgrade_part_end');
    }
} catch (Exception $ex) {
    upgrade_handle_exception($ex);
}
/// Check for changes to RPC functions
if ($CFG->mnet_dispatcher_mode != 'off') {
    try {
        // this needs a full rewrite, sorry to mention that :-(
        require_once "{$CFG->dirroot}/{$CFG->admin}/mnet/adminlib.php";
        upgrade_RPC_functions();
        // Return here afterwards
    } catch (Exception $ex) {
        upgrade_handle_exception($ex);
    }
}
/// Check for local database customisations
try {
    require_once "{$CFG->dirroot}/lib/locallib.php";
    upgrade_local_db('print_upgrade_part_start', 'print_upgrade_part_end');
} catch (Exception $ex) {
    upgrade_handle_exception($ex);
}
/// indicate that this site is fully configured except the admin password
if (empty($CFG->rolesactive)) {
    set_config('rolesactive', 1);
 upgrade_plugins('format', 'course/format', '');
 // Don't return anywhere
 /// Check for local database customisations
 /// first old *.php update and then the new upgrade.php script
 require_once "{$CFG->dirroot}/lib/locallib.php";
 if ($verbose > CLI_NO) {
     print_heading(get_string('upgradinglocaldb', 'install'), '', 1);
 }
 upgrade_local_db('');
 // Don't return anywhere
 /// Check for changes to RPC functions
 require_once "{$CFG->dirroot}/{$CFG->admin}/mnet/adminlib.php";
 if ($verbose > CLI_NO) {
     print_heading(get_string('upgradingrpcfunctions', 'install'), '', 1);
 }
 upgrade_RPC_functions('');
 // Don't return anywhere
 /// Upgrade all plugins for gradebook
 if ($verbose > CLI_NO) {
     print_heading(get_string('upgradinggradeexportplugin', 'install'), '', 1);
 }
 upgrade_plugins('gradeexport', 'grade/export', '');
 // Don't return anywhere
 if ($verbose > CLI_NO) {
     print_heading(get_string('upgradinggradeimportplugin', 'install'), '', 1);
 }
 upgrade_plugins('gradeimport', 'grade/import', '');
 // Don't return anywhere
 if ($verbose > CLI_NO) {
     print_heading(get_string('upgradinggradereportplugin', 'install'), '', 1);
 }