本文整理汇总了PHP中xmldb_main_upgrade函数的典型用法代码示例。如果您正苦于以下问题:PHP xmldb_main_upgrade函数的具体用法?PHP xmldb_main_upgrade怎么用?PHP xmldb_main_upgrade使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了xmldb_main_upgrade函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: error_reporting
error_reporting($CFG->debug);
upgrade_log_start();
/// Upgrade current language pack if we can
if (empty($CFG->skiplangupgrade)) {
upgrade_language_pack();
}
print_heading($strdatabasechecking);
$db->debug = true;
/// Launch the old main upgrade (if exists)
$status = true;
if (function_exists('main_upgrade')) {
$status = main_upgrade($CFG->version);
}
/// If succesful and exists launch the new main upgrade (XMLDB), called xmldb_main_upgrade
if ($status && function_exists('xmldb_main_upgrade')) {
$status = xmldb_main_upgrade($CFG->version);
}
$db->debug = false;
/// If successful, continue upgrading roles and setting everything properly
if ($status) {
if (empty($CFG->rolesactive)) {
/// Groups upgrade is now in core above.
// Upgrade to the roles system.
moodle_install_roles();
set_config('rolesactive', 1);
} else {
if (!update_capabilities()) {
error('Had trouble upgrading the core capabilities for the Roles System');
}
}
// update core events
示例2: upgrade_core
/**
* Upgrade moodle core
* @param float $version target version
* @param bool $verbose
* @return void, may throw exception
*/
function upgrade_core($version, $verbose) {
global $CFG, $SITE, $DB, $COURSE;
raise_memory_limit(MEMORY_EXTRA);
require_once($CFG->libdir.'/db/upgrade.php'); // Defines upgrades
try {
// Reset caches before any output.
cache_helper::purge_all(true);
purge_all_caches();
// Upgrade current language pack if we can
upgrade_language_pack();
print_upgrade_part_start('moodle', false, $verbose);
// Pre-upgrade scripts for local hack workarounds.
$preupgradefile = "$CFG->dirroot/local/preupgrade.php";
if (file_exists($preupgradefile)) {
core_php_time_limit::raise();
require($preupgradefile);
// Reset upgrade timeout to default.
upgrade_set_timeout();
}
$result = xmldb_main_upgrade($CFG->version);
if ($version > $CFG->version) {
// store version if not already there
upgrade_main_savepoint($result, $version, false);
}
// In case structure of 'course' table has been changed and we forgot to update $SITE, re-read it from db.
$SITE = $DB->get_record('course', array('id' => $SITE->id));
$COURSE = clone($SITE);
// perform all other component upgrade routines
update_capabilities('moodle');
log_update_descriptions('moodle');
external_update_descriptions('moodle');
events_update_definition('moodle');
\core\task\manager::reset_scheduled_tasks_for_component('moodle');
message_update_providers('moodle');
\core\message\inbound\manager::update_handlers_for_component('moodle');
// Update core definitions.
cache_helper::update_definitions(true);
// Purge caches again, just to be sure we arn't holding onto old stuff now.
cache_helper::purge_all(true);
purge_all_caches();
// Clean up contexts - more and more stuff depends on existence of paths and contexts
context_helper::cleanup_instances();
context_helper::create_instances(null, false);
context_helper::build_all_paths(false);
$syscontext = context_system::instance();
$syscontext->mark_dirty();
print_upgrade_part_end('moodle', false, $verbose);
} catch (Exception $ex) {
upgrade_handle_exception($ex);
}
}
示例3: upgrade_core
/**
* Upgrade moodle core
* @param float $version target version
* @param bool $verbose
* @return void, may throw exception
*/
function upgrade_core($version, $verbose) {
global $CFG;
raise_memory_limit(MEMORY_EXTRA);
require_once($CFG->libdir.'/db/upgrade.php'); // Defines upgrades
try {
// Reset caches before any output
purge_all_caches();
// Upgrade current language pack if we can
upgrade_language_pack();
print_upgrade_part_start('moodle', false, $verbose);
// one time special local migration pre 2.0 upgrade script
if ($CFG->version < 2007101600) {
$pre20upgradefile = "$CFG->dirroot/local/upgrade_pre20.php";
if (file_exists($pre20upgradefile)) {
set_time_limit(0);
require($pre20upgradefile);
// reset upgrade timeout to default
upgrade_set_timeout();
}
}
$result = xmldb_main_upgrade($CFG->version);
if ($version > $CFG->version) {
// store version if not already there
upgrade_main_savepoint($result, $version, false);
}
// perform all other component upgrade routines
update_capabilities('moodle');
log_update_descriptions('moodle');
external_update_descriptions('moodle');
events_update_definition('moodle');
message_update_providers('moodle');
// Reset caches again, just to be sure
purge_all_caches();
// Clean up contexts - more and more stuff depends on existence of paths and contexts
context_helper::cleanup_instances();
context_helper::create_instances(null, false);
context_helper::build_all_paths(false);
$syscontext = context_system::instance();
$syscontext->mark_dirty();
print_upgrade_part_end('moodle', false, $verbose);
} catch (Exception $ex) {
upgrade_handle_exception($ex);
}
}
示例4: upgrade_core
/**
* Upgrade moodle core
* @param float $version target version
* @param bool $verbose
* @return void, may throw exception
*/
function upgrade_core($version, $verbose)
{
global $CFG;
require_once $CFG->libdir . '/db/upgrade.php';
// Defines upgrades
try {
// Upgrade current language pack if we can
if (empty($CFG->skiplangupgrade)) {
upgrade_language_pack(false);
}
print_upgrade_part_start('moodle', false, $verbose);
// one time special local migration pre 2.0 upgrade script
if ($version < 2007101600) {
$pre20upgradefile = "{$CFG->dirrot}/local/upgrade_pre20.php";
if (file_exists($pre20upgradefile)) {
set_time_limit(0);
require $pre20upgradefile;
// reset upgrade timeout to default
upgrade_set_timeout();
}
}
$result = xmldb_main_upgrade($CFG->version);
if ($version > $CFG->version) {
// store version if not already there
upgrade_main_savepoint($result, $version, false);
}
// perform all other component upgrade routines
update_capabilities('moodle');
events_update_definition('moodle');
message_update_providers('moodle');
remove_dir($CFG->dataroot . '/cache', true);
// flush cache
print_upgrade_part_end('moodle', false, $verbose);
} catch (Exception $ex) {
upgrade_handle_exception($ex);
}
}
示例5: print_string
print_string('pluginchecknotice');
print_box_end();
print_plugin_tables();
print_upgrade_reload('index.php?confirmupgrade=1&confirmrelease=1');
print_continue('index.php?confirmupgrade=1&confirmrelease=1&confirmplugincheck=1');
print_footer('none');
die;
} else {
/// Launch main upgrade
try {
// Upgrade current language pack if we can
if (empty($CFG->skiplangupgrade)) {
upgrade_language_pack(false);
}
print_upgrade_part_start('moodle', false);
$result = xmldb_main_upgrade($CFG->version);
if ($version > $CFG->version) {
// store version if not already there
upgrade_main_savepoint($result, $version, false);
}
// perform all other component upgrade routines
update_capabilities('moodle');
events_update_definition('moodle');
message_update_providers('moodle');
message_update_providers('message');
remove_dir($CFG->dataroot . '/cache', true);
// flush cache
print_upgrade_part_end('moodle', false);
} catch (Exception $ex) {
upgrade_handle_exception($ex);
}
示例6: upgrade_core
/**
* Upgrade moodle core
* @param float $version target version
* @param bool $verbose
* @return void, may throw exception
*/
function upgrade_core($version, $verbose)
{
global $CFG;
raise_memory_limit(MEMORY_EXTRA);
require_once $CFG->libdir . '/db/upgrade.php';
// Defines upgrades
try {
// Reset caches before any output.
cache_helper::purge_all(true);
purge_all_caches();
// Upgrade current language pack if we can
upgrade_language_pack();
print_upgrade_part_start('moodle', false, $verbose);
// Pre-upgrade scripts for local hack workarounds.
$preupgradefile = "{$CFG->dirroot}/local/preupgrade.php";
if (file_exists($preupgradefile)) {
core_php_time_limit::raise();
require $preupgradefile;
// Reset upgrade timeout to default.
upgrade_set_timeout();
}
$result = xmldb_main_upgrade($CFG->version);
if ($version > $CFG->version) {
// store version if not already there
upgrade_main_savepoint($result, $version, false);
}
// perform all other component upgrade routines
update_capabilities('moodle');
log_update_descriptions('moodle');
external_update_descriptions('moodle');
events_update_definition('moodle');
message_update_providers('moodle');
// Update core definitions.
cache_helper::update_definitions(true);
// Purge caches again, just to be sure we arn't holding onto old stuff now.
cache_helper::purge_all(true);
purge_all_caches();
// Clean up contexts - more and more stuff depends on existence of paths and contexts
context_helper::cleanup_instances();
context_helper::create_instances(null, false);
context_helper::build_all_paths(false);
$syscontext = context_system::instance();
$syscontext->mark_dirty();
print_upgrade_part_end('moodle', false, $verbose);
} catch (Exception $ex) {
upgrade_handle_exception($ex);
}
}
示例7: upgrade_core
/**
* Upgrade moodle core
* @param float $version target version
* @param bool $verbose
* @return void, may throw exception
*/
function upgrade_core($version, $verbose)
{
global $CFG;
raise_memory_limit(MEMORY_EXTRA);
require_once $CFG->libdir . '/db/upgrade.php';
// Defines upgrades
try {
// Reset caches before any output
purge_all_caches();
// 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();
// Upgrade current language pack if we can
upgrade_language_pack();
print_upgrade_part_start('moodle', false, $verbose);
// one time special local migration pre 2.0 upgrade script
if ($CFG->version < 2007101600) {
$pre20upgradefile = "{$CFG->dirroot}/local/upgrade_pre20.php";
if (file_exists($pre20upgradefile)) {
set_time_limit(0);
require $pre20upgradefile;
// reset upgrade timeout to default
upgrade_set_timeout();
}
}
$result = xmldb_main_upgrade($CFG->version);
if ($version > $CFG->version) {
// store version if not already there
upgrade_main_savepoint($result, $version, false);
}
// perform all other component upgrade routines
update_capabilities('moodle');
log_update_descriptions('moodle');
external_update_descriptions('moodle');
events_update_definition('moodle');
message_update_providers('moodle');
// Update core definitions.
cache_helper::update_definitions(true);
// Reset the cache, this returns it to a normal operation state.
cache_factory::reset();
// Purge caches again, just to be sure we arn't holding onto old stuff now.
purge_all_caches();
// Clean up contexts - more and more stuff depends on existence of paths and contexts
context_helper::cleanup_instances();
context_helper::create_instances(null, false);
context_helper::build_all_paths(false);
$syscontext = context_system::instance();
$syscontext->mark_dirty();
print_upgrade_part_end('moodle', false, $verbose);
} catch (Exception $ex) {
upgrade_handle_exception($ex);
}
}