本文整理汇总了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 <james.mcquillan@remote-learner.net>
* @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();
}
}
示例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);
示例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();
}
示例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();
}
示例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)));
}
示例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();
}
示例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');
}
示例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);
}
示例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();
}