本文整理汇总了PHP中theme_reset_all_caches函数的典型用法代码示例。如果您正苦于以下问题:PHP theme_reset_all_caches函数的具体用法?PHP theme_reset_all_caches怎么用?PHP theme_reset_all_caches使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了theme_reset_all_caches函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: auth_oidc_initialize_customicon
/**
* @package auth_oidc
* @author James McQuillan <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @copyright (C) 2014 onwards Microsoft Open Technologies, Inc. (http://msopentech.com/)
*/
function auth_oidc_initialize_customicon($filefullname)
{
global $CFG;
$file = get_config('auth_oidc', 'customicon');
$systemcontext = \context_system::instance();
$fullpath = "/{$systemcontext->id}/auth_oidc/customicon/0{$file}";
$fs = get_file_storage();
if (!($file = $fs->get_file_by_hash(sha1($fullpath))) or $file->is_directory()) {
return false;
}
$pixpluginsdir = 'pix_plugins/auth/oidc/0';
$pixpluginsdirparts = explode('/', $pixpluginsdir);
$curdir = $CFG->dataroot;
foreach ($pixpluginsdirparts as $dir) {
$curdir .= '/' . $dir;
if (!file_exists($curdir)) {
mkdir($curdir);
}
}
if (file_exists($CFG->dataroot . '/pix_plugins/auth/oidc/0')) {
$file->copy_content_to($CFG->dataroot . '/pix_plugins/auth/oidc/0/customicon.jpg');
theme_reset_all_caches();
}
}
开发者ID:eugeneventer,项目名称:o365-moodle,代码行数:30,代码来源:lib.php
示例2: optional_param
$reset = optional_param('reset', 0, PARAM_BOOL);
$device = optional_param('device', '', PARAM_TEXT);
$unsettheme = optional_param('unsettheme', 0, PARAM_BOOL);
$confirmation = optional_param('confirmation', 0, PARAM_BOOL);
admin_externalpage_setup('themeselector');
if (!empty($device)) {
// Make sure the device requested is valid.
$devices = core_useragent::get_device_type_list();
if (!in_array($device, $devices)) {
// The provided device isn't a valid device throw an error.
print_error('invaliddevicetype');
}
}
unset($SESSION->theme);
if ($reset and confirm_sesskey()) {
theme_reset_all_caches();
} else {
if ($choose && $confirmation) {
$theme = theme_config::load($choose);
echo $OUTPUT->header();
echo $OUTPUT->heading(get_string('themesaved'));
echo $OUTPUT->box_start();
echo format_text(get_string('choosereadme', 'theme_' . $theme->name), FORMAT_MOODLE);
echo $OUTPUT->box_end();
echo $OUTPUT->continue_button($CFG->wwwroot . '/theme/index.php');
echo $OUTPUT->footer();
exit;
} else {
if ($choose && $device && !theme_is_device_locked($device) && !$unsettheme && confirm_sesskey()) {
// Load the theme to make sure it is valid.
$theme = theme_config::load($choose);
开发者ID:evltuma,项目名称:moodle,代码行数:31,代码来源:index.php
示例3: purge_all_caches
/**
* Invalidates browser caches and cached data in temp.
*
* IMPORTANT - If you are adding anything here to do with the cache directory you should also have a look at
* {@link phpunit_util::reset_dataroot()}
*
* @return void
*/
function purge_all_caches()
{
global $CFG, $DB;
reset_text_filters_cache();
js_reset_all_caches();
theme_reset_all_caches();
get_string_manager()->reset_caches();
core_text::reset_caches();
if (class_exists('core_plugin_manager')) {
core_plugin_manager::reset_caches();
}
// Bump up cacherev field for all courses.
try {
increment_revision_number('course', 'cacherev', '');
} catch (moodle_exception $e) {
// Ignore exception since this function is also called before upgrade script when field course.cacherev does not exist yet.
}
$DB->reset_caches();
cache_helper::purge_all();
// Purge all other caches: rss, simplepie, etc.
clearstatcache();
remove_dir($CFG->cachedir . '', true);
// Make sure cache dir is writable, throws exception if not.
make_cache_directory('');
// This is the only place where we purge local caches, we are only adding files there.
// The $CFG->localcachedirpurged flag forces local directories to be purged on cluster nodes.
remove_dir($CFG->localcachedir, true);
set_config('localcachedirpurged', time());
make_localcache_directory('', true);
\core\task\manager::clear_static_caches();
}
开发者ID:lucaboesch,项目名称:moodle,代码行数:39,代码来源:moodlelib.php
示例4: theme_set_designer_mod
/**
* Enable or disable theme designer mode.
*
* @param bool $state
*/
function theme_set_designer_mod($state)
{
set_config('themedesignermode', (int) (!empty($state)));
// Reset caches after switching mode so that any designer mode caches get purged too.
theme_reset_all_caches();
}
开发者ID:MoodleMetaData,项目名称:MoodleMetaData,代码行数:11,代码来源:outputlib.php
示例5: theme_set_designer_mod
/**
* Enable or disable theme designer mode.
*
* @param bool $state
*/
function theme_set_designer_mod($state)
{
theme_reset_all_caches();
set_config('themedesignermode', (int) (!empty($state)));
}
开发者ID:nicusX,项目名称:moodle,代码行数:10,代码来源:outputlib.php
示例6: purge_all_caches
/**
* Invalidates browser caches and cached data in temp
* @return void
*/
function purge_all_caches()
{
global $CFG;
reset_text_filters_cache();
js_reset_all_caches();
theme_reset_all_caches();
get_string_manager()->reset_caches();
// purge all other caches: rss, simplepie, etc.
remove_dir($CFG->dataroot . '/cache', true);
// make sure cache dir is writable, throws exception if not
make_upload_directory('cache');
clearstatcache();
}
开发者ID:hitphp,项目名称:moodle,代码行数:17,代码来源:moodlelib.php
示例7: purge_all_caches
/**
* Invalidates browser caches and cached data in temp
* @return void
*/
function purge_all_caches()
{
global $CFG;
reset_text_filters_cache();
js_reset_all_caches();
theme_reset_all_caches();
get_string_manager()->reset_caches();
textlib::reset_caches();
// purge all other caches: rss, simplepie, etc.
remove_dir($CFG->cachedir . '', true);
// make sure cache dir is writable, throws exception if not
make_cache_directory('');
// hack: this script may get called after the purifier was initialised,
// but we do not want to verify repeatedly this exists in each call
make_cache_directory('htmlpurifier');
}
开发者ID:nmicha,项目名称:moodle,代码行数:20,代码来源:moodlelib.php
示例8: xmldb_hotpot_upgrade
//.........这里部分代码省略.........
if ($hotpot->outputformat == 14 && ($hotpot->sourcetype == 'hp_6_jmatch_xml' || $hotpot->sourcetype == 'hp_6_jmix_xml')) {
$hotpot->outputformat = $hotpot->sourcetype . '_v6';
} else {
$hotpot->outputformat = '';
// = "best" output format
}
$DB->update_record('hotpot', $hotpot);
// update progress bar
$i++;
$bar->update($i, $count, $strupdating . ": ({$i}/{$count})");
}
$rs->close();
}
upgrade_mod_savepoint(true, "{$newversion}", 'hotpot');
}
$newversion = 2010080316;
if ($oldversion < $newversion) {
// because the HotPot activities were probably hidden until now
// we need to reset the course caches (using "course/lib.php")
require_once $CFG->dirroot . '/course/lib.php';
$courseids = array();
if ($hotpots = $DB->get_records('hotpot', null, '', 'id,course')) {
foreach ($hotpots as $hotpot) {
$courseids[$hotpot->course] = true;
}
$courseids = array_keys($courseids);
}
unset($hotpots, $hotpot);
foreach ($courseids as $courseid) {
rebuild_course_cache($courseid, true);
}
unset($courseids, $courseid);
// reset theme cache to force inclusion of new hotpot css
theme_reset_all_caches();
upgrade_mod_savepoint(true, "{$newversion}", 'hotpot');
}
$newversion = 2010080325;
if ($oldversion < $newversion) {
$table = new xmldb_table('hotpot');
$fieldnames = array('sourceitemid', 'configitemid');
foreach ($fieldnames as $fieldname) {
$field = new xmldb_field($fieldname);
if ($dbman->field_exists($table, $field)) {
$dbman->drop_field($table, $field);
}
}
upgrade_mod_savepoint(true, "{$newversion}", 'hotpot');
}
$newversion = 2010080330;
if ($oldversion < $newversion) {
require_once $CFG->dirroot . '/mod/hotpot/lib.php';
hotpot_refresh_events();
}
$newversion = 2010080333;
if ($oldversion < $newversion) {
update_capabilities('mod/hotpot');
upgrade_mod_savepoint(true, "{$newversion}", 'hotpot');
}
$newversion = 2010080339;
if ($oldversion < $newversion) {
$table = new xmldb_table('hotpot');
$field = new xmldb_field('exitgrade', XMLDB_TYPE_INTEGER, '6', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, '0', 'exitcm');
xmldb_hotpot_fix_previous_field($dbman, $table, $field);
if (!$dbman->field_exists($table, $field)) {
$dbman->add_field($table, $field);
}
开发者ID:hapaxapah,项目名称:moodle-mod_hotpot,代码行数:67,代码来源:upgrade.php
示例9: theme_snap_process_site_coverimage
/**
* Process site cover image.
*
* @throws Exception
* @throws coding_exception
* @throws dml_exception
*/
function theme_snap_process_site_coverimage()
{
$context = \context_system::instance();
\theme_snap\local::process_coverimage($context);
theme_reset_all_caches();
}
开发者ID:pramithkm,项目名称:moodle-theme_snap,代码行数:13,代码来源:lib.php
注:本文中的theme_reset_all_caches函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论