Merge pull request #497 from marc1706/ticket/494
[ticket/494] Improve caching and query performance of portal
This commit is contained in:
@@ -296,7 +296,7 @@ class portal_module
|
||||
WHERE module_id = ' . (int) $module_id;
|
||||
$this->db->sql_query($sql);
|
||||
|
||||
$this->cache->destroy('portal_modules');
|
||||
$this->cache->destroy('sql', PORTAL_MODULES_TABLE);
|
||||
$this->cache->destroy('sql', CONFIG_TABLE);
|
||||
|
||||
if(isset($module_name))
|
||||
|
||||
@@ -70,32 +70,26 @@ function set_portal_config($config_name, $config_value)
|
||||
}
|
||||
|
||||
/**
|
||||
* Get portal modules
|
||||
*/
|
||||
* Get portal modules
|
||||
*
|
||||
* @return array Portal modules array
|
||||
*/
|
||||
function obtain_portal_modules()
|
||||
{
|
||||
global $db, $cache, $portal_modules;
|
||||
global $db;
|
||||
|
||||
if (($portal_modules = $cache->get('portal_modules')) === false || defined('DEBUG'))
|
||||
$portal_modules = array();
|
||||
|
||||
$sql = 'SELECT *
|
||||
FROM ' . PORTAL_MODULES_TABLE . '
|
||||
ORDER BY module_order ASC';
|
||||
$result = $db->sql_query($sql, 3600);
|
||||
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$portal_modules = $portal_cached_modules = array();
|
||||
|
||||
$sql = 'SELECT *
|
||||
FROM ' . PORTAL_MODULES_TABLE . '
|
||||
ORDER BY module_order ASC';
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$portal_cached_modules[] = $row;
|
||||
|
||||
$portal_modules[] = $row;
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$cache->put('portal_modules', $portal_cached_modules);
|
||||
$portal_modules[] = $row;
|
||||
}
|
||||
|
||||
$db->sql_freeresult($result);
|
||||
return $portal_modules;
|
||||
}
|
||||
|
||||
|
||||
@@ -225,7 +225,7 @@ class announcements extends module_base
|
||||
AND topic_moved_id = 0
|
||||
' . $post_time . '
|
||||
' . $str_where;
|
||||
$result = $this->db->sql_query($sql);
|
||||
$result = $this->db->sql_query($sql, 300);
|
||||
$total_announcements = (int) $this->db->sql_fetchfield('num_topics');
|
||||
$this->db->sql_freeresult($result);
|
||||
}
|
||||
|
||||
@@ -53,10 +53,10 @@ class attachments extends module_base
|
||||
/** @var \phpbb\request\request */
|
||||
protected $request;
|
||||
|
||||
/** @var \phpbb\template */
|
||||
/** @var \phpbb\template\template */
|
||||
protected $template;
|
||||
|
||||
/** @var \phpbb\db\driver */
|
||||
/** @var \phpbb\db\driver\driver_interface */
|
||||
protected $db;
|
||||
|
||||
/** @var string PHP file extension */
|
||||
@@ -74,8 +74,8 @@ class attachments extends module_base
|
||||
* @param \phpbb\auth\auth $auth phpBB auth service
|
||||
* @param \phpbb\config\config $config phpBB config
|
||||
* @param \board3\portal\includes\modules_helper $helper Modules helper
|
||||
* @param \phpbb\template $template phpBB template
|
||||
* @param \phpbb\db\driver $db Database driver
|
||||
* @param \phpbb\template\template $template phpBB template
|
||||
* @param \phpbb\db\driver\driver_interface $db Database driver
|
||||
* @param \phpbb\request\request $request phpBB request
|
||||
* @param string $phpEx php file extension
|
||||
* @param string $phpbb_root_path phpBB root path
|
||||
@@ -281,7 +281,7 @@ class attachments extends module_base
|
||||
' . $where . '
|
||||
ORDER BY
|
||||
filetime ' . ((!$this->config['display_order']) ? 'DESC' : 'ASC') . ', post_msg_id ASC';
|
||||
$result = $this->db->sql_query_limit($sql, $this->config['board3_attachments_number_' . $module_id]);
|
||||
$result = $this->db->sql_query_limit($sql, $this->config['board3_attachments_number_' . $module_id], 0, 600);
|
||||
|
||||
while ($row = $this->db->sql_fetchrow($result))
|
||||
{
|
||||
|
||||
@@ -119,7 +119,7 @@ class birthday_list extends module_base
|
||||
'ORDER BY' => $order_by,
|
||||
);
|
||||
$sql = $this->db->sql_build_query('SELECT', $sql_array);
|
||||
$result = $this->db->sql_query($sql);
|
||||
$result = $this->db->sql_query($sql, 3600);
|
||||
$today = sprintf('%2d-%2d-', $now['mday'], $now['mon']);
|
||||
|
||||
while ($row = $this->db->sql_fetchrow($result))
|
||||
|
||||
@@ -49,10 +49,10 @@ class latest_bots extends module_base
|
||||
/** @var \phpbb\config\config */
|
||||
protected $config;
|
||||
|
||||
/** @var \phpbb\db\driver */
|
||||
/** @var \phpbb\db\driver\driver_interface */
|
||||
protected $db;
|
||||
|
||||
/** @var \phpbb\template */
|
||||
/** @var \phpbb\template\template */
|
||||
protected $template;
|
||||
|
||||
/** @var \phpbb\user */
|
||||
@@ -62,8 +62,8 @@ class latest_bots extends module_base
|
||||
* Construct a latest bots object
|
||||
*
|
||||
* @param \phpbb\config\config $config phpBB config
|
||||
* @param \phpbb\db\driver $db phpBB db driver
|
||||
* @param \phpbb\template $template phpBB template
|
||||
* @param \phpbb\db\driver\driver_interface $db phpBB db driver
|
||||
* @param \phpbb\template\template $template phpBB template
|
||||
* @param \phpbb\user $user phpBB user object
|
||||
*/
|
||||
public function __construct($config, $db, $template, $user)
|
||||
@@ -85,7 +85,7 @@ class latest_bots extends module_base
|
||||
WHERE user_type = ' . USER_IGNORE . '
|
||||
AND user_lastvisit > 0
|
||||
ORDER BY user_lastvisit DESC';
|
||||
$result = $this->db->sql_query_limit($sql, $this->config['board3_last_visited_bots_number_' . $module_id]);
|
||||
$result = $this->db->sql_query_limit($sql, $this->config['board3_last_visited_bots_number_' . $module_id], 0, 600);
|
||||
|
||||
$show_module = false;
|
||||
|
||||
|
||||
@@ -44,10 +44,10 @@ class latest_members extends module_base
|
||||
/** @var \phpbb\config\config */
|
||||
protected $config;
|
||||
|
||||
/** @var \phpbb\db\driver */
|
||||
/** @var \phpbb\db\driver\driver_interface */
|
||||
protected $db;
|
||||
|
||||
/** @var \phpbb\template */
|
||||
/** @var \phpbb\template\template */
|
||||
protected $template;
|
||||
|
||||
/** @var \phpbb\user */
|
||||
@@ -57,8 +57,8 @@ class latest_members extends module_base
|
||||
* Construct a latest_members object
|
||||
*
|
||||
* @param \phpbb\config\config $config phpBB config
|
||||
* @param \phpbb\db\driver $db phpBB db driver
|
||||
* @param \phpbb\template $template phpBB template
|
||||
* @param \phpbb\db\driver\driver_interface $db phpBB db driver
|
||||
* @param \phpbb\template\template $template phpBB template
|
||||
* @param \phpbb\user $user phpBB user object
|
||||
*/
|
||||
public function __construct($config, $db, $template, $user)
|
||||
@@ -79,7 +79,7 @@ class latest_members extends module_base
|
||||
WHERE user_type <> ' . USER_IGNORE . '
|
||||
AND user_inactive_time = 0
|
||||
ORDER BY user_regdate DESC';
|
||||
$result = $this->db->sql_query_limit($sql, $this->config['board3_max_last_member_' . $module_id]);
|
||||
$result = $this->db->sql_query_limit($sql, $this->config['board3_max_last_member_' . $module_id], 0, 600);
|
||||
|
||||
while(($row = $this->db->sql_fetchrow($result)) && ($row['username']))
|
||||
{
|
||||
|
||||
@@ -118,7 +118,7 @@ class leaders extends module_base
|
||||
AND (g.group_type <> ' . GROUP_HIDDEN . ' OR ug.user_id = ' . $this->user->data['user_id'] . ')
|
||||
ORDER BY g.group_name ASC';
|
||||
}
|
||||
$result = $this->db->sql_query($sql);
|
||||
$result = $this->db->sql_query($sql, 600);
|
||||
|
||||
while ($row = $this->db->sql_fetchrow($result))
|
||||
{
|
||||
@@ -144,7 +144,7 @@ class leaders extends module_base
|
||||
ug.user_id = u.user_id
|
||||
AND '. $this->db->sql_in_set('ug.group_id', $legends) . '
|
||||
ORDER BY u.username_clean ASC';
|
||||
$result = $this->db->sql_query($sql);
|
||||
$result = $this->db->sql_query($sql, 600);
|
||||
|
||||
while ($row = $this->db->sql_fetchrow($result))
|
||||
{
|
||||
@@ -201,7 +201,7 @@ class leaders extends module_base
|
||||
'ORDER_BY' => 'g.group_name ASC, u.username_clean ASC'
|
||||
));
|
||||
|
||||
$result = $this->db->sql_query($sql);
|
||||
$result = $this->db->sql_query($sql, 600);
|
||||
|
||||
while ($row = $this->db->sql_fetchrow($result))
|
||||
{
|
||||
|
||||
@@ -218,7 +218,7 @@ class news extends module_base
|
||||
AND topic_visibility = ' . ITEM_APPROVED . '
|
||||
AND topic_moved_id = 0
|
||||
' . $str_where;
|
||||
$result = $this->db->sql_query($sql);
|
||||
$result = $this->db->sql_query($sql, 300);
|
||||
$total_news = (int) $this->db->sql_fetchfield('num_topics');
|
||||
$this->db->sql_freeresult($result);
|
||||
}
|
||||
|
||||
@@ -121,7 +121,7 @@ class recent extends module_base
|
||||
$forum_sql = ' AND ' . $this->db->sql_in_set('t.forum_id', $forum_ary, true);
|
||||
}
|
||||
|
||||
$result = $this->db->sql_query_limit($sql, 1);
|
||||
$result = $this->db->sql_query_limit($sql, 1, 0, 600);
|
||||
$g_forum_id = (int) $this->db->sql_fetchfield('forum_id');
|
||||
$this->db->sql_freeresult($result);
|
||||
|
||||
@@ -134,9 +134,9 @@ class recent extends module_base
|
||||
AND topic_visibility = ' . ITEM_APPROVED . '
|
||||
AND (topic_type = ' . POST_ANNOUNCE . ' OR topic_type = ' . POST_GLOBAL . ')
|
||||
AND topic_moved_id = 0
|
||||
' . $sql_where . '' . $forum_sql . '
|
||||
' . $sql_where . $forum_sql . '
|
||||
ORDER BY topic_time DESC';
|
||||
$result = $this->db->sql_query_limit($sql, $this->config['board3_max_topics_' . $module_id]);
|
||||
$result = $this->db->sql_query_limit($sql, $this->config['board3_max_topics_' . $module_id], 0 , 600);
|
||||
|
||||
while(($row = $this->db->sql_fetchrow($result)) && ($row['topic_title']))
|
||||
{
|
||||
@@ -160,9 +160,9 @@ class recent extends module_base
|
||||
WHERE topic_visibility = ' . ITEM_APPROVED . '
|
||||
AND topic_posts_approved >' . $this->config['hot_threshold'] . '
|
||||
AND topic_moved_id = 0
|
||||
' . $sql_where . '' . $forum_sql . '
|
||||
' . $sql_where . $forum_sql . '
|
||||
ORDER BY topic_time DESC';
|
||||
$result = $this->db->sql_query_limit($sql, $this->config['board3_max_topics_' . $module_id]);
|
||||
$result = $this->db->sql_query_limit($sql, $this->config['board3_max_topics_' . $module_id], 0, 600);
|
||||
|
||||
while(($row = $this->db->sql_fetchrow($result)) && ($row['topic_title']))
|
||||
{
|
||||
@@ -187,9 +187,9 @@ class recent extends module_base
|
||||
AND topic_visibility = ' . ITEM_APPROVED . '
|
||||
AND topic_type = ' . POST_NORMAL . '
|
||||
AND topic_moved_id = 0
|
||||
' . $sql_where . '' . $forum_sql . '
|
||||
' . $sql_where . $forum_sql . '
|
||||
ORDER BY topic_time DESC';
|
||||
$result = $this->db->sql_query_limit($sql, $this->config['board3_max_topics_' . $module_id]);
|
||||
$result = $this->db->sql_query_limit($sql, $this->config['board3_max_topics_' . $module_id], 0, 600);
|
||||
|
||||
while(($row = $this->db->sql_fetchrow($result)) && ($row['topic_title']))
|
||||
{
|
||||
|
||||
@@ -90,7 +90,7 @@ class stylechanger extends module_base
|
||||
FROM ' . STYLES_TABLE . '
|
||||
WHERE style_active = 1
|
||||
ORDER BY LOWER(style_name) ASC';
|
||||
$result = $this->db->sql_query($sql);
|
||||
$result = $this->db->sql_query($sql, 3600);
|
||||
while ($row = $this->db->sql_fetchrow($result))
|
||||
{
|
||||
$style = $this->request->variable('style', 0);
|
||||
@@ -113,7 +113,7 @@ class stylechanger extends module_base
|
||||
|
||||
// Assign specific vars
|
||||
$this->template->assign_vars(array(
|
||||
'S_STYLE_OPTIONS' => ($this->config['override_user_style'] || $style_count < 2) ? '' : style_select($this->user->data['user_style']),
|
||||
'S_STYLE_OPTIONS' => ($this->config['override_user_style'] || $style_count < 2) ? '' : $style_select,
|
||||
));
|
||||
|
||||
return 'stylechanger_side.html';
|
||||
|
||||
@@ -44,10 +44,10 @@ class topposters extends module_base
|
||||
/** @var \phpbb\config\config */
|
||||
protected $config;
|
||||
|
||||
/** @var \phpbb\db\driver */
|
||||
/** @var \phpbb\db\driver\driver_interface */
|
||||
protected $db;
|
||||
|
||||
/** @var \phpbb\template */
|
||||
/** @var \phpbb\template\template */
|
||||
protected $template;
|
||||
|
||||
/** @var string PHP file extension */
|
||||
@@ -60,8 +60,8 @@ class topposters extends module_base
|
||||
* Construct a topposers object
|
||||
*
|
||||
* @param \phpbb\config\config $config phpBB config
|
||||
* @param \phpbb\db\driver $db phpBB db driver
|
||||
* @param \phpbb\template $template phpBB template
|
||||
* @param \phpbb\db\driver\driver_interface $db phpBB db driver
|
||||
* @param \phpbb\template\template $template phpBB template
|
||||
* @param string $phpbb_root_path phpBB root path
|
||||
* @param string $phpEx php file extension
|
||||
*/
|
||||
@@ -85,7 +85,7 @@ class topposters extends module_base
|
||||
AND user_posts <> 0
|
||||
AND username <> ''
|
||||
ORDER BY user_posts DESC";
|
||||
$result = $this->db->sql_query_limit($sql, $this->config['board3_topposters_' . $module_id]);
|
||||
$result = $this->db->sql_query_limit($sql, $this->config['board3_topposters_' . $module_id], 0, 600);
|
||||
|
||||
while (($row = $this->db->sql_fetchrow($result)))
|
||||
{
|
||||
|
||||
@@ -125,13 +125,13 @@ class user_menu extends module_base
|
||||
$m_approve_fid_sql = ' AND p.post_visibility = 1';
|
||||
}
|
||||
|
||||
$sql = 'SELECT COUNT(distinct t.topic_id) as total
|
||||
$sql = 'SELECT COUNT(DISTINCT t.topic_id) as total
|
||||
FROM ' . TOPICS_TABLE . ' t
|
||||
WHERE t.topic_last_post_time > ' . $this->user->data['user_lastvisit'] . '
|
||||
AND t.topic_moved_id = 0
|
||||
' . str_replace(array('p.', 'post_'), array('t.', 'topic_'), $m_approve_fid_sql) . '
|
||||
' . ((sizeof($ex_fid_ary)) ? 'AND ' . $this->db->sql_in_set('t.forum_id', $ex_fid_ary, true) : '');
|
||||
$result = $this->db->sql_query($sql);
|
||||
$result = $this->db->sql_query($sql, 600);
|
||||
$new_posts_count = (int) $this->db->sql_fetchfield('total');
|
||||
$this->db->sql_freeresult($result);
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ class fetch_posts
|
||||
|
||||
/**
|
||||
* phpBB cache
|
||||
* @var \phpbb\cache\driver
|
||||
* @var \phpbb\cache\driver\driver_interface
|
||||
*/
|
||||
protected $cache;
|
||||
|
||||
@@ -31,7 +31,7 @@ class fetch_posts
|
||||
|
||||
/**
|
||||
* phpBB db driver
|
||||
* @var \phpbb\db\driver_interface
|
||||
* @var \phpbb\db\driver\driver_interface
|
||||
*/
|
||||
protected $db;
|
||||
|
||||
@@ -263,13 +263,14 @@ class fetch_posts
|
||||
$sql_array['SELECT'] .= ', tp.topic_posted';
|
||||
$sql = $this->db->sql_build_query('SELECT', $sql_array);
|
||||
|
||||
// Cache queries for 10 minutes
|
||||
if ($number_of_posts != 0)
|
||||
{
|
||||
$result = $this->db->sql_query_limit($sql, $number_of_posts, $start);
|
||||
$result = $this->db->sql_query_limit($sql, $number_of_posts, $start, 600);
|
||||
}
|
||||
else
|
||||
{
|
||||
$result = $this->db->sql_query($sql);
|
||||
$result = $this->db->sql_query($sql, 600);
|
||||
}
|
||||
|
||||
return $result;
|
||||
|
||||
@@ -215,7 +215,7 @@ class manager
|
||||
trigger_error($this->user->lang['UNABLE_TO_MOVE' . (($is_row) ? '_ROW' : '')] . adm_back_link($this->u_action));
|
||||
}
|
||||
|
||||
$this->cache->destroy('portal_modules');
|
||||
$this->cache->destroy('sql', PORTAL_MODULES_TABLE);
|
||||
|
||||
// Handle ajax requests
|
||||
$this->handle_ajax_request(array('success' => true));
|
||||
@@ -375,7 +375,7 @@ class manager
|
||||
}
|
||||
}
|
||||
|
||||
$this->cache->destroy('portal_modules');
|
||||
$this->cache->destroy('sql', PORTAL_MODULES_TABLE);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -61,10 +61,10 @@ class phpbb_acp_move_module_test extends \board3\portal\tests\testframework\data
|
||||
$phpbb_container->setParameter('board3.portal.config.table', $table_prefix . 'portal_config');
|
||||
$this->portal_columns = new \board3\portal\portal\columns();
|
||||
$phpbb_container->set('board3.portal.columns', $this->portal_columns);
|
||||
$cache = $this->getMock('\phpbb\cache\cache', array('destroy', 'sql_exists', 'get', 'put'));
|
||||
$cache = $this->getMock('\phpbb\cache\cache', array('destroy', 'sql_exists', 'get', 'put', 'sql_load', 'sql_save'));
|
||||
$cache->expects($this->any())
|
||||
->method('destroy')
|
||||
->with($this->equalTo('portal_modules'));
|
||||
->with($this->equalTo('sql'));
|
||||
$cache->expects($this->any())
|
||||
->method('get')
|
||||
->with($this->anything())
|
||||
@@ -75,6 +75,14 @@ class phpbb_acp_move_module_test extends \board3\portal\tests\testframework\data
|
||||
$cache->expects($this->any())
|
||||
->method('put')
|
||||
->with($this->anything());
|
||||
$cache->expects($this->any())
|
||||
->method('sql_load')
|
||||
->with($this->anything())
|
||||
->will($this->returnValue(false));
|
||||
$cache->expects($this->any())
|
||||
->method('sql_save')
|
||||
->with($this->anything())
|
||||
->will($this->returnArgument(2));
|
||||
$db = $this->db;
|
||||
$user->set(array(
|
||||
'UNABLE_TO_MOVE' => 'UNABLE_TO_MOVE',
|
||||
|
||||
@@ -29,7 +29,7 @@ class phpbb_functions_fetch_news_test extends \board3\portal\tests\testframework
|
||||
$user->add_lang('../../ext/board3/portal/language/en/portal');
|
||||
$request = new \phpbb_mock_request;
|
||||
$phpbb_dispatcher = new phpbb_mock_event_dispatcher();
|
||||
$cache = $this->getMock('\phpbb\cache\cache', array('obtain_word_list', 'get', 'sql_exists', 'put', 'obtain_attach_extensions'));
|
||||
$cache = $this->getMock('\phpbb\cache\cache', array('obtain_word_list', 'get', 'sql_exists', 'put', 'obtain_attach_extensions', 'sql_load', 'sql_save'));
|
||||
$cache->expects($this->any())
|
||||
->method('obtain_word_list')
|
||||
->with()
|
||||
@@ -38,6 +38,14 @@ class phpbb_functions_fetch_news_test extends \board3\portal\tests\testframework
|
||||
->method('get')
|
||||
->with($this->anything())
|
||||
->will($this->returnValue(false));
|
||||
$cache->expects($this->any())
|
||||
->method('sql_load')
|
||||
->with($this->anything())
|
||||
->will($this->returnValue(false));
|
||||
$cache->expects($this->any())
|
||||
->method('sql_save')
|
||||
->with($this->anything())
|
||||
->will($this->returnArgument(2));
|
||||
require_once(dirname(__FILE__) . '/../../../../../../includes/functions_content.php');
|
||||
$this->config = new \phpbb\config\config(array('allow_attachments' => 1));
|
||||
$auth = new \phpbb\auth\auth();
|
||||
|
||||
@@ -29,7 +29,7 @@ class phpbb_portal_fetch_posts_test extends \board3\portal\tests\testframework\d
|
||||
$user->add_lang('common');
|
||||
$user->add_lang('../../ext/board3/portal/language/en/portal');
|
||||
$phpbb_dispatcher = new phpbb_mock_event_dispatcher();
|
||||
$cache = $this->getMock('\phpbb\cache\cache', array('obtain_word_list', 'get', 'sql_exists', 'put', 'obtain_attach_extensions'));
|
||||
$cache = $this->getMock('\phpbb\cache\cache', array('obtain_word_list', 'get', 'sql_exists', 'put', 'obtain_attach_extensions', 'sql_load', 'sql_save'));
|
||||
$cache->expects($this->any())
|
||||
->method('obtain_word_list')
|
||||
->with()
|
||||
@@ -38,6 +38,14 @@ class phpbb_portal_fetch_posts_test extends \board3\portal\tests\testframework\d
|
||||
->method('get')
|
||||
->with($this->anything())
|
||||
->will($this->returnValue(false));
|
||||
$cache->expects($this->any())
|
||||
->method('sql_load')
|
||||
->with($this->anything())
|
||||
->will($this->returnValue(false));
|
||||
$cache->expects($this->any())
|
||||
->method('sql_save')
|
||||
->with($this->anything())
|
||||
->will($this->returnArgument(2));
|
||||
require_once(dirname(__FILE__) . '/../../../../../../includes/functions_content.php');
|
||||
$this->config = new \phpbb\config\config(array('allow_attachments' => 1));
|
||||
$auth = new \phpbb\auth\auth();
|
||||
|
||||
@@ -112,7 +112,7 @@ class modules_manager_confirm_box_test extends \board3\portal\tests\testframewor
|
||||
$this->cache = $this->getMock('\phpbb\cache\cache', array('destroy', 'sql_exists', 'get', 'put', 'purge'));
|
||||
$this->cache->expects($this->any())
|
||||
->method('destroy')
|
||||
->with($this->equalTo('portal_modules'));
|
||||
->with($this->equalTo('sql'));
|
||||
$this->cache->expects($this->any())
|
||||
->method('get')
|
||||
->with($this->anything())
|
||||
|
||||
@@ -44,7 +44,7 @@ class board3_portal_modules_manager_test extends \board3\portal\tests\testframew
|
||||
));
|
||||
|
||||
$this->portal_columns = new \board3\portal\portal\columns();
|
||||
$cache = $this->getMock('\phpbb\cache\cache', array('destroy', 'sql_exists', 'get', 'put'));
|
||||
$cache = $this->getMock('\phpbb\cache\cache', array('destroy', 'sql_exists', 'get', 'put', 'sql_load', 'sql_save'));
|
||||
$cache->expects($this->any())
|
||||
->method('destroy')
|
||||
->with($this->equalTo('portal_modules'));
|
||||
@@ -58,6 +58,14 @@ class board3_portal_modules_manager_test extends \board3\portal\tests\testframew
|
||||
$cache->expects($this->any())
|
||||
->method('put')
|
||||
->with($this->anything());
|
||||
$cache->expects($this->any())
|
||||
->method('sql_load')
|
||||
->with($this->anything())
|
||||
->will($this->returnValue(false));
|
||||
$cache->expects($this->any())
|
||||
->method('sql_save')
|
||||
->with($this->anything())
|
||||
->will($this->returnArgument(2));
|
||||
$db = $this->db;
|
||||
$user->set(array(
|
||||
'UNABLE_TO_MOVE' => 'UNABLE_TO_MOVE',
|
||||
|
||||
Reference in New Issue
Block a user