/** * Upgrade/install other parts of moodle * @param bool $verbose * @return void, may throw exception */ function upgrade_noncore($verbose) { global $CFG; raise_memory_limit(MEMORY_EXTRA); // upgrade all plugins types try { // Reset caches before any output. cache_helper::purge_all(true); purge_all_caches(); $plugintypes = core_component::get_plugin_types(); foreach ($plugintypes as $type=>$location) { upgrade_plugins($type, 'print_upgrade_part_start', 'print_upgrade_part_end', $verbose); } // Update cache definitions. Involves scanning each plugin for any changes. cache_helper::update_definitions(); // Mark the site as upgraded. set_config('allversionshash', core_component::get_all_versions_hash()); // Purge caches again, just to be sure we arn't holding onto old stuff now. cache_helper::purge_all(true); purge_all_caches(); } catch (Exception $ex) { upgrade_handle_exception($ex); } }
/** * 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); } } }
/** * Upgrade/install other parts of moodle * @param bool $verbose * @return void, may throw exception */ function upgrade_noncore($verbose) { global $CFG; raise_memory_limit(MEMORY_EXTRA); // 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); } }
/** * Upgrade/install other parts of moodle * @param bool $verbose * @return void, may throw exception */ function upgrade_noncore($verbose) { global $CFG; raise_memory_limit(MEMORY_EXTRA); // upgrade all plugins types try { // Reset caches before any output. cache_helper::purge_all(true); purge_all_caches(); $plugintypes = core_component::get_plugin_types(); foreach ($plugintypes as $type => $location) { upgrade_plugins($type, 'print_upgrade_part_start', 'print_upgrade_part_end', $verbose); } // Upgrade services. // This function gives plugins and subsystems a chance to add functions to existing built-in services. external_update_services(); // Update cache definitions. Involves scanning each plugin for any changes. cache_helper::update_definitions(); // Mark the site as upgraded. set_config('allversionshash', core_component::get_all_versions_hash()); // Purge caches again, just to be sure we arn't holding onto old stuff now. cache_helper::purge_all(true); purge_all_caches(); } catch (Exception $ex) { upgrade_handle_exception($ex); } catch (Throwable $ex) { // Engine errors in PHP7 throw exceptions of type Throwable (this "catch" will be ignored in PHP5). upgrade_handle_exception($ex); } }
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); set_config('adminsetuppending', 1); // we neeed this redirect to setup proper session upgrade_finished("index.php?sessionstarted=1&lang={$CFG->lang}"); } /// 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 if (!empty($CFG->adminsetuppending)) { $sessionstarted = optional_param('sessionstarted', 0, PARAM_BOOL); if (!$sessionstarted) { redirect("index.php?sessionstarted=1&lang={$CFG->lang}"); } else {
/** * Upgrade/install other parts of moodle * @param bool $verbose * @return void, may throw exception */ function upgrade_noncore($verbose) { global $CFG; raise_memory_limit(MEMORY_EXTRA); // 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); } // Update cache definitions. Involves scanning each plugin for any changes. cache_helper::update_definitions(); } catch (Exception $ex) { upgrade_handle_exception($ex); } }
/** * Upgrade/install other parts of moodle * @param bool $verbose * @return void, may throw exception */ function upgrade_noncore($verbose) { global $CFG; raise_memory_limit(MEMORY_EXTRA); // upgrade all plugins types try { // Disable the use of cache stores here. // We don't reset this, the site can live without proper caching for life of this request. cache_factory::disable_stores(); $plugintypes = get_plugin_types(); foreach ($plugintypes as $type=>$location) { upgrade_plugins($type, 'print_upgrade_part_start', 'print_upgrade_part_end', $verbose); } // Update cache definitions. Involves scanning each plugin for any changes. cache_helper::update_definitions(); } catch (Exception $ex) { upgrade_handle_exception($ex); } }
/** * Upgrade/install other parts of moodle * @param bool $verbose * @return void, may throw exception */ function upgrade_noncore($verbose) { global $CFG; raise_memory_limit(MEMORY_EXTRA); // upgrade all plugins types try { // Disable the use of cache stores here. We will reset the factory after we've performed the installation. // This ensures that we don't permanently cache anything during installation. cache_factory::disable_stores(); $plugintypes = get_plugin_types(); foreach ($plugintypes as $type => $location) { upgrade_plugins($type, 'print_upgrade_part_start', 'print_upgrade_part_end', $verbose); } // Update cache definitions. Involves scanning each plugin for any changes. cache_helper::update_definitions(); // Reset the cache system to a normal state. cache_factory::reset(); } catch (Exception $ex) { upgrade_handle_exception($ex); } }