mirror of
https://github.com/phpbb/phpbb.git
synced 2025-05-04 14:47:52 +02:00
Merge pull request #3013 from VSEphpbb/ticket/13121
[ticket/13121] Remove cache mode from style management module
This commit is contained in:
commit
b003019958
@ -133,32 +133,10 @@ class acp_styles
|
|||||||
$this->welcome_message('INSTALL_STYLES', 'INSTALL_STYLES_EXPLAIN');
|
$this->welcome_message('INSTALL_STYLES', 'INSTALL_STYLES_EXPLAIN');
|
||||||
$this->show_available();
|
$this->show_available();
|
||||||
return;
|
return;
|
||||||
case 'cache':
|
|
||||||
$this->action_cache();
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
trigger_error($this->user->lang['NO_MODE'] . adm_back_link($this->u_action), E_USER_WARNING);
|
trigger_error($this->user->lang['NO_MODE'] . adm_back_link($this->u_action), E_USER_WARNING);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Purge cache
|
|
||||||
*/
|
|
||||||
protected function action_cache()
|
|
||||||
{
|
|
||||||
global $db, $cache, $auth;
|
|
||||||
|
|
||||||
$this->config->increment('assets_version', 1);
|
|
||||||
$this->cache->purge();
|
|
||||||
|
|
||||||
// Clear permissions
|
|
||||||
$this->auth->acl_clear_prefetch();
|
|
||||||
phpbb_cache_moderators($db, $cache, $auth);
|
|
||||||
|
|
||||||
add_log('admin', 'LOG_PURGE_CACHE');
|
|
||||||
|
|
||||||
trigger_error($this->user->lang['PURGED_CACHE'] . adm_back_link($this->u_base_action), E_USER_NOTICE);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Install style(s)
|
* Install style(s)
|
||||||
*/
|
*/
|
||||||
|
@ -22,7 +22,6 @@ class acp_styles_info
|
|||||||
'modes' => array(
|
'modes' => array(
|
||||||
'style' => array('title' => 'ACP_STYLES', 'auth' => 'acl_a_styles', 'cat' => array('ACP_STYLE_MANAGEMENT')),
|
'style' => array('title' => 'ACP_STYLES', 'auth' => 'acl_a_styles', 'cat' => array('ACP_STYLE_MANAGEMENT')),
|
||||||
'install' => array('title' => 'ACP_STYLES_INSTALL', 'auth' => 'acl_a_styles', 'cat' => array('ACP_STYLE_MANAGEMENT')),
|
'install' => array('title' => 'ACP_STYLES_INSTALL', 'auth' => 'acl_a_styles', 'cat' => array('ACP_STYLE_MANAGEMENT')),
|
||||||
'cache' => array('title' => 'ACP_STYLES_CACHE', 'auth' => 'acl_a_styles', 'cat' => array('ACP_STYLE_MANAGEMENT')),
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,51 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* This file is part of the phpBB Forum Software package.
|
||||||
|
*
|
||||||
|
* @copyright (c) phpBB Limited <https://www.phpbb.com>
|
||||||
|
* @license GNU General Public License, version 2 (GPL-2.0)
|
||||||
|
*
|
||||||
|
* For full copyright and license information, please see
|
||||||
|
* the docs/CREDITS.txt file.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace phpbb\db\migration\data\v310;
|
||||||
|
|
||||||
|
class remove_acp_styles_cache extends \phpbb\db\migration\migration
|
||||||
|
{
|
||||||
|
public function effectively_installed()
|
||||||
|
{
|
||||||
|
$sql = 'SELECT module_id
|
||||||
|
FROM ' . MODULES_TABLE . "
|
||||||
|
WHERE module_class = 'acp'
|
||||||
|
AND module_langname = 'ACP_STYLES_CACHE'";
|
||||||
|
$result = $this->db->sql_query($sql);
|
||||||
|
$module_id = $this->db->sql_fetchfield('module_id');
|
||||||
|
$this->db->sql_freeresult($result);
|
||||||
|
|
||||||
|
return !$module_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
static public function depends_on()
|
||||||
|
{
|
||||||
|
return array('\phpbb\db\migration\data\v310\rc4');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function update_data()
|
||||||
|
{
|
||||||
|
return array(
|
||||||
|
array('module.remove', array(
|
||||||
|
'acp',
|
||||||
|
'ACP_STYLE_MANAGEMENT',
|
||||||
|
array(
|
||||||
|
'module_basename' => 'acp_styles',
|
||||||
|
'module_langname' => 'ACP_STYLES_CACHE',
|
||||||
|
'module_mode' => 'cache',
|
||||||
|
'module_auth' => 'acl_a_styles',
|
||||||
|
),
|
||||||
|
)),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user