本文整理汇总了PHP中upgrade_handle_exception函数的典型用法代码示例。如果您正苦于以下问题:PHP upgrade_handle_exception函数的具体用法?PHP upgrade_handle_exception怎么用?PHP upgrade_handle_exception使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了upgrade_handle_exception函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: upgrade_noncore
/**
* 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);
}
}
示例2: upgrade_noncore
/**
* 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);
}
}
}
示例3: upgrade_noncore
/**
* 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);
}
}
示例4: upgrade_noncore
/**
* 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);
}
}
示例5: upgrade_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);
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 {
示例6: upgrade_noncore
/**
* 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);
}
}
示例7: upgrade_noncore
/**
* 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);
}
}
示例8: upgrade_noncore
/**
* 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);
}
}