当前位置: 首页>>代码示例>>PHP>>正文


PHP cache_helper::update_definitions方法代码示例

本文整理汇总了PHP中cache_helper::update_definitions方法的典型用法代码示例。如果您正苦于以下问题:PHP cache_helper::update_definitions方法的具体用法?PHP cache_helper::update_definitions怎么用?PHP cache_helper::update_definitions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在cache_helper的用法示例。


在下文中一共展示了cache_helper::update_definitions方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1:

 *
 * @package    core
 * @category   cache
 * @copyright  2012 Sam Hemelryk
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
 */
require_once '../config.php';
require_once $CFG->dirroot . '/lib/adminlib.php';
require_once $CFG->dirroot . '/cache/locallib.php';
require_once $CFG->dirroot . '/cache/forms.php';
// The first time the user visits this page we are going to reparse the definitions.
// Just ensures that everything is up to date.
// We flag is session so that this only happens once as people are likely to hit
// this page several times if making changes.
if (empty($SESSION->cacheadminreparsedefinitions)) {
    cache_helper::update_definitions();
    $SESSION->cacheadminreparsedefinitions = true;
}
$action = optional_param('action', null, PARAM_ALPHA);
admin_externalpage_setup('cacheconfig');
$context = context_system::instance();
$stores = cache_administration_helper::get_store_instance_summaries();
$plugins = cache_administration_helper::get_store_plugin_summaries();
$definitions = cache_administration_helper::get_definition_summaries();
$defaultmodestores = cache_administration_helper::get_default_mode_stores();
$locks = cache_administration_helper::get_lock_summaries();
$title = new lang_string('cacheadmin', 'cache');
$mform = null;
$notification = null;
$notifysuccess = true;
if (!empty($action) && confirm_sesskey()) {
开发者ID:Jtgadbois,项目名称:Pedadida,代码行数:31,代码来源:admin.php

示例2: 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);
    }
}
开发者ID:jtibbetts,项目名称:moodle,代码行数:33,代码来源:upgradelib.php

示例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 {
        // 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);
    }
}
开发者ID:dg711,项目名称:moodle,代码行数:35,代码来源:upgradelib.php

示例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 {
        $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);
    }
}
开发者ID:Jtgadbois,项目名称:Pedadida,代码行数:22,代码来源:upgradelib.php

示例5: 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);
    }
}
开发者ID:Burick,项目名称:moodle,代码行数:26,代码来源:upgradelib.php

示例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 {
        // 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);
    }
}
开发者ID:vinoth4891,项目名称:clinique,代码行数:26,代码来源:upgradelib.php


注:本文中的cache_helper::update_definitions方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。