[ticket/11700] Modify all code to use the new interface names

PHPBB3-11700
This commit is contained in:
Nils Adermann 2013-07-14 13:30:52 -04:00
parent b81613e5e5
commit da2752e400
61 changed files with 207 additions and 207 deletions

View file

@ -1472,7 +1472,7 @@ class acp_attachments
$ip_list = array_unique(explode("\n", $ips));
$ip_list_log = implode(', ', $ip_list);
$ip_exclude = (int) $request->variable('ipexclude', false, false, phpbb_request_interface::POST);
$ip_exclude = (int) $request->variable('ipexclude', false, false, phpbb_request_request_interface::POST);
$iplist = array();
$hostlist = array();

View file

@ -679,7 +679,7 @@ class acp_board
foreach ($auth_providers as $key => $value)
{
if (!($value instanceof phpbb_auth_provider_interface))
if (!($value instanceof phpbb_auth_provider_provider_interface))
{
continue;
}

View file

@ -338,7 +338,7 @@ class acp_icons
$image_display_on_posting = (isset($_POST['display_on_posting'])) ? request_var('display_on_posting', array('' => 0)) : array();
// Ok, add the relevant bits if we are adding new codes to existing emoticons...
if ($request->variable('add_additional_code', false, false, phpbb_request_interface::POST))
if ($request->variable('add_additional_code', false, false, phpbb_request_request_interface::POST))
{
$add_image = request_var('add_image', '');
$add_code = utf8_normalize_nfc(request_var('add_code', '', true));
@ -354,7 +354,7 @@ class acp_icons
$image_width[$add_image] = request_var('add_width', 0);
$image_height[$add_image] = request_var('add_height', 0);
if ($request->variable('add_display_on_posting', false, false, phpbb_request_interface::POST))
if ($request->variable('add_display_on_posting', false, false, phpbb_request_request_interface::POST))
{
$image_display_on_posting[$add_image] = 1;
}

View file

@ -161,7 +161,7 @@ class acp_language
'method' => $method)
);
$hidden_data .= build_hidden_fields(array('entry' => $request->variable('entry', $request_default, true, phpbb_request_interface::POST)));
$hidden_data .= build_hidden_fields(array('entry' => $request->variable('entry', $request_default, true, phpbb_request_request_interface::POST)));
$template->assign_vars(array(
'S_UPLOAD' => true,
@ -218,7 +218,7 @@ class acp_language
trigger_error($user->lang['FORM_INVALID']. adm_back_link($this->u_action), E_USER_WARNING);
}
$entry_value = $request->variable('entry', $request_default, true, phpbb_request_interface::POST);
$entry_value = $request->variable('entry', $request_default, true, phpbb_request_request_interface::POST);
if (!$lang_id || !$entry_value)
{

View file

@ -35,8 +35,8 @@ class acp_logs
$forum_id = request_var('f', 0);
$topic_id = request_var('t', 0);
$start = request_var('start', 0);
$deletemark = $request->variable('delmarked', false, false, phpbb_request_interface::POST);
$deleteall = $request->variable('delall', false, false, phpbb_request_interface::POST);
$deletemark = $request->variable('delmarked', false, false, phpbb_request_request_interface::POST);
$deleteall = $request->variable('delall', false, false, phpbb_request_request_interface::POST);
$marked = request_var('mark', array(0));
// Sort keys

View file

@ -676,7 +676,7 @@ class acp_permissions
list($ug_id, ) = each($psubmit);
list($forum_id, ) = each($psubmit[$ug_id]);
$settings = $request->variable('setting', array(0 => array(0 => array('' => 0))), false, phpbb_request_interface::POST);
$settings = $request->variable('setting', array(0 => array(0 => array('' => 0))), false, phpbb_request_request_interface::POST);
if (empty($settings) || empty($settings[$ug_id]) || empty($settings[$ug_id][$forum_id]))
{
trigger_error('WRONG_PERMISSION_SETTING_FORMAT', E_USER_WARNING);
@ -685,7 +685,7 @@ class acp_permissions
$auth_settings = $settings[$ug_id][$forum_id];
// Do we have a role we want to set?
$roles = $request->variable('role', array(0 => array(0 => 0)), false, phpbb_request_interface::POST);
$roles = $request->variable('role', array(0 => array(0 => 0)), false, phpbb_request_request_interface::POST);
$assigned_role = (isset($roles[$ug_id][$forum_id])) ? (int) $roles[$ug_id][$forum_id] : 0;
// Do the admin want to set these permissions to other items too?
@ -757,8 +757,8 @@ class acp_permissions
trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$auth_settings = $request->variable('setting', array(0 => array(0 => array('' => 0))), false, phpbb_request_interface::POST);
$auth_roles = $request->variable('role', array(0 => array(0 => 0)), false, phpbb_request_interface::POST);
$auth_settings = $request->variable('setting', array(0 => array(0 => array('' => 0))), false, phpbb_request_request_interface::POST);
$auth_roles = $request->variable('role', array(0 => array(0 => 0)), false, phpbb_request_request_interface::POST);
$ug_ids = $forum_ids = array();
// We need to go through the auth settings

View file

@ -510,7 +510,7 @@ class acp_profile
$cp->vars['field_default_value_month'] = $now['mon'];
$cp->vars['field_default_value_year'] = $now['year'];
$var = 'now';
$request->overwrite('field_default_value', $var, phpbb_request_interface::POST);
$request->overwrite('field_default_value', $var, phpbb_request_request_interface::POST);
}
else
{
@ -520,7 +520,7 @@ class acp_profile
$cp->vars['field_default_value_month'] = request_var('field_default_value_month', 0);
$cp->vars['field_default_value_year'] = request_var('field_default_value_year', 0);
$var = sprintf('%2d-%2d-%4d', $cp->vars['field_default_value_day'], $cp->vars['field_default_value_month'], $cp->vars['field_default_value_year']);
$request->overwrite('field_default_value', $var, phpbb_request_interface::POST);
$request->overwrite('field_default_value', $var, phpbb_request_request_interface::POST);
}
else
{

View file

@ -32,7 +32,7 @@ function set_var(&$result, $var, $type, $multibyte = false)
/**
* Wrapper function of phpbb_request::variable which exists for backwards compatability.
* See {@link phpbb_request_interface::variable phpbb_request_interface::variable} for
* See {@link phpbb_request_request_interface::variable phpbb_request_request_interface::variable} for
* documentation of this function's use.
*
* @deprecated
@ -40,20 +40,20 @@ function set_var(&$result, $var, $type, $multibyte = false)
* If the value is an array this may be an array of indizes which will give
* direct access to a value at any depth. E.g. if the value of "var" is array(1 => "a")
* then specifying array("var", 1) as the name will return "a".
* If you pass an instance of {@link phpbb_request_interface phpbb_request_interface}
* If you pass an instance of {@link phpbb_request_request_interface phpbb_request_interface}
* as this parameter it will overwrite the current request class instance. If you do
* not do so, it will create its own instance (but leave superglobals enabled).
* @param mixed $default A default value that is returned if the variable was not set.
* This function will always return a value of the same type as the default.
* @param bool $multibyte If $default is a string this paramater has to be true if the variable may contain any UTF-8 characters
* Default is false, causing all bytes outside the ASCII range (0-127) to be replaced with question marks
* @param bool $cookie This param is mapped to phpbb_request_interface::COOKIE as the last param for
* phpbb_request_interface::variable for backwards compatability reasons.
* @param phpbb_request_interface|null|false If an instance of phpbb_request_interface is given the instance is stored in
* @param bool $cookie This param is mapped to phpbb_request_request_interface::COOKIE as the last param for
* phpbb_request_request_interface::variable for backwards compatability reasons.
* @param phpbb_request_request_interface|null|false If an instance of phpbb_request_request_interface is given the instance is stored in
* a static variable and used for all further calls where this parameters is null. Until
* the function is called with an instance it automatically creates a new phpbb_request
* instance on every call. By passing false this per-call instantiation can be restored
* after having passed in a phpbb_request_interface instance.
* after having passed in a phpbb_request_request_interface instance.
*
* @return mixed The value of $_REQUEST[$var_name] run through {@link set_var set_var} to ensure that the type is the
* the same as that of $default. If the variable is not set $default is returned.
@ -64,7 +64,7 @@ function request_var($var_name, $default, $multibyte = false, $cookie = false, $
// the only real code is the function call which maps this function to a method.
static $static_request = null;
if ($request instanceof phpbb_request_interface)
if ($request instanceof phpbb_request_request_interface)
{
$static_request = $request;
@ -93,7 +93,7 @@ function request_var($var_name, $default, $multibyte = false, $cookie = false, $
$tmp_request = new phpbb_request(new phpbb_request_type_cast_helper(), false);
}
return $tmp_request->variable($var_name, $default, $multibyte, ($cookie) ? phpbb_request_interface::COOKIE : phpbb_request_interface::REQUEST);
return $tmp_request->variable($var_name, $default, $multibyte, ($cookie) ? phpbb_request_request_interface::COOKIE : phpbb_request_request_interface::REQUEST);
}
/**
@ -1391,7 +1391,7 @@ function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $
}
else if ($config['load_anon_lastread'] || $user->data['is_registered'])
{
$tracking_topics = $request->variable($config['cookie_name'] . '_track', '', true, phpbb_request_interface::COOKIE);
$tracking_topics = $request->variable($config['cookie_name'] . '_track', '', true, phpbb_request_request_interface::COOKIE);
$tracking_topics = ($tracking_topics) ? tracking_unserialize($tracking_topics) : array();
unset($tracking_topics['tf']);
@ -1400,7 +1400,7 @@ function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $
$tracking_topics['l'] = base_convert($post_time - $config['board_startdate'], 10, 36);
$user->set_cookie('track', tracking_serialize($tracking_topics), $post_time + 31536000);
$request->overwrite($config['cookie_name'] . '_track', tracking_serialize($tracking_topics), phpbb_request_interface::COOKIE);
$request->overwrite($config['cookie_name'] . '_track', tracking_serialize($tracking_topics), phpbb_request_request_interface::COOKIE);
unset($tracking_topics);
@ -1503,7 +1503,7 @@ function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $
}
else if ($config['load_anon_lastread'] || $user->data['is_registered'])
{
$tracking = $request->variable($config['cookie_name'] . '_track', '', true, phpbb_request_interface::COOKIE);
$tracking = $request->variable($config['cookie_name'] . '_track', '', true, phpbb_request_request_interface::COOKIE);
$tracking = ($tracking) ? tracking_unserialize($tracking) : array();
foreach ($forum_id as $f_id)
@ -1534,7 +1534,7 @@ function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $
}
$user->set_cookie('track', tracking_serialize($tracking), $post_time + 31536000);
$request->overwrite($config['cookie_name'] . '_track', tracking_serialize($tracking), phpbb_request_interface::COOKIE);
$request->overwrite($config['cookie_name'] . '_track', tracking_serialize($tracking), phpbb_request_request_interface::COOKIE);
unset($tracking);
}
@ -1591,7 +1591,7 @@ function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $
}
else if ($config['load_anon_lastread'] || $user->data['is_registered'])
{
$tracking = $request->variable($config['cookie_name'] . '_track', '', true, phpbb_request_interface::COOKIE);
$tracking = $request->variable($config['cookie_name'] . '_track', '', true, phpbb_request_request_interface::COOKIE);
$tracking = ($tracking) ? tracking_unserialize($tracking) : array();
$topic_id36 = base_convert($topic_id, 10, 36);
@ -1605,7 +1605,7 @@ function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $
// If the cookie grows larger than 10000 characters we will remove the smallest value
// This can result in old topics being unread - but most of the time it should be accurate...
if (strlen($request->variable($config['cookie_name'] . '_track', '', true, phpbb_request_interface::COOKIE)) > 10000)
if (strlen($request->variable($config['cookie_name'] . '_track', '', true, phpbb_request_request_interface::COOKIE)) > 10000)
{
//echo 'Cookie grown too large' . print_r($tracking, true);
@ -1650,7 +1650,7 @@ function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $
}
$user->set_cookie('track', tracking_serialize($tracking), $post_time + 31536000);
$request->overwrite($config['cookie_name'] . '_track', tracking_serialize($tracking), phpbb_request_interface::COOKIE);
$request->overwrite($config['cookie_name'] . '_track', tracking_serialize($tracking), phpbb_request_request_interface::COOKIE);
}
return;
@ -1788,7 +1788,7 @@ function get_complete_topic_tracking($forum_id, $topic_ids, $global_announce_lis
if (!isset($tracking_topics) || !sizeof($tracking_topics))
{
$tracking_topics = $request->variable($config['cookie_name'] . '_track', '', true, phpbb_request_interface::COOKIE);
$tracking_topics = $request->variable($config['cookie_name'] . '_track', '', true, phpbb_request_request_interface::COOKIE);
$tracking_topics = ($tracking_topics) ? tracking_unserialize($tracking_topics) : array();
}
@ -1985,7 +1985,7 @@ function update_forum_tracking_info($forum_id, $forum_last_post_time, $f_mark_ti
}
else if ($config['load_anon_lastread'] || $user->data['is_registered'])
{
$tracking_topics = $request->variable($config['cookie_name'] . '_track', '', true, phpbb_request_interface::COOKIE);
$tracking_topics = $request->variable($config['cookie_name'] . '_track', '', true, phpbb_request_request_interface::COOKIE);
$tracking_topics = ($tracking_topics) ? tracking_unserialize($tracking_topics) : array();
if (!$user->data['is_registered'])
@ -3094,7 +3094,7 @@ function confirm_box($check, $title = '', $hidden = '', $html_body = 'confirm_bo
return false;
}
$confirm = ($user->lang['YES'] === $request->variable('confirm', '', true, phpbb_request_interface::POST));
$confirm = ($user->lang['YES'] === $request->variable('confirm', '', true, phpbb_request_request_interface::POST));
if ($check && $confirm)
{
@ -4896,7 +4896,7 @@ function phpbb_http_login($param)
$username = null;
foreach ($username_keys as $k)
{
if ($request->is_set($k, phpbb_request_interface::SERVER))
if ($request->is_set($k, phpbb_request_request_interface::SERVER))
{
$username = htmlspecialchars_decode($request->server($k));
break;
@ -4906,7 +4906,7 @@ function phpbb_http_login($param)
$password = null;
foreach ($password_keys as $k)
{
if ($request->is_set($k, phpbb_request_interface::SERVER))
if ($request->is_set($k, phpbb_request_request_interface::SERVER))
{
$password = htmlspecialchars_decode($request->server($k));
break;
@ -5013,7 +5013,7 @@ function phpbb_quoteattr($data, $entities = null)
*/
function phpbb_build_hidden_fields_for_query_params($request, $exclude = null)
{
$names = $request->variable_names(phpbb_request_interface::GET);
$names = $request->variable_names(phpbb_request_request_interface::GET);
$hidden = '';
foreach ($names as $name)
{
@ -5035,7 +5035,7 @@ function phpbb_build_hidden_fields_for_query_params($request, $exclude = null)
// here. To avoid exposing cookies, skip variables that are
// overwritten somewhere other than GET entirely.
$value = $request->variable($name, '', true);
$get_value = $request->variable($name, '', true, phpbb_request_interface::GET);
$get_value = $request->variable($name, '', true, phpbb_request_request_interface::GET);
if ($value === $get_value)
{
$escaped_value = phpbb_quoteattr($value);

View file

@ -2349,7 +2349,7 @@ function auto_prune($forum_id, $prune_mode, $prune_flags, $prune_days, $prune_fr
* must be carried through for the moderators table.
*
* @param phpbb_db_driver $db Database connection
* @param phpbb_cache_driver_interface Cache driver
* @param phpbb_cache_driver_driver_interface Cache driver
* @param phpbb_auth $auth Authentication object
* @return null
*/

View file

@ -104,7 +104,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
}
else if ($config['load_anon_lastread'] || $user->data['is_registered'])
{
$tracking_topics = $request->variable($config['cookie_name'] . '_track', '', true, phpbb_request_interface::COOKIE);
$tracking_topics = $request->variable($config['cookie_name'] . '_track', '', true, phpbb_request_request_interface::COOKIE);
$tracking_topics = ($tracking_topics) ? tracking_unserialize($tracking_topics) : array();
if (!$user->data['is_registered'])
@ -1164,7 +1164,7 @@ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id,
if ($token && check_link_hash($token, "{$mode}_$match_id") || confirm_box(true))
{
if ($uid != $user_id || $request->variable('unwatch', '', false, phpbb_request_interface::GET) != $mode)
if ($uid != $user_id || $request->variable('unwatch', '', false, phpbb_request_request_interface::GET) != $mode)
{
$redirect_url = append_sid("{$phpbb_root_path}view$mode.$phpEx", "$u_url=$match_id&start=$start");
$message = $user->lang['ERR_UNWATCHING'] . '<br /><br />' . sprintf($user->lang['RETURN_' . strtoupper($mode)], '<a href="' . $redirect_url . '">', '</a>');
@ -1229,7 +1229,7 @@ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id,
if ($token && check_link_hash($token, "{$mode}_$match_id") || confirm_box(true))
{
if ($uid != $user_id || $request->variable('watch', '', false, phpbb_request_interface::GET) != $mode)
if ($uid != $user_id || $request->variable('watch', '', false, phpbb_request_request_interface::GET) != $mode)
{
$redirect_url = append_sid("{$phpbb_root_path}view$mode.$phpEx", "$u_url=$match_id&amp;start=$start");
$message = $user->lang['ERR_WATCHING'] . '<br /><br />' . sprintf($user->lang['RETURN_' . strtoupper($mode)], '<a href="' . $redirect_url . '">', '</a>');
@ -1272,8 +1272,8 @@ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id,
}
else
{
if ((isset($_GET['unwatch']) && $request->variable('unwatch', '', false, phpbb_request_interface::GET) == $mode) ||
(isset($_GET['watch']) && $request->variable('watch', '', false, phpbb_request_interface::GET) == $mode))
if ((isset($_GET['unwatch']) && $request->variable('unwatch', '', false, phpbb_request_request_interface::GET) == $mode) ||
(isset($_GET['watch']) && $request->variable('watch', '', false, phpbb_request_request_interface::GET) == $mode))
{
login_box();
}

View file

@ -713,7 +713,7 @@ class fileupload
}
$this->common_checks($file);
$request->overwrite('local', $upload, phpbb_request_interface::FILES);
$request->overwrite('local', $upload, phpbb_request_request_interface::FILES);
return $file;
}

View file

@ -36,8 +36,8 @@ function mcp_forum_view($id, $mode, $action, $forum_info)
// Fixes a "bug" that makes forum_view use the same ordering as topic_view
$request->overwrite('sk', null);
$request->overwrite('sd', null);
$request->overwrite('sk', null, phpbb_request_interface::POST);
$request->overwrite('sd', null, phpbb_request_interface::POST);
$request->overwrite('sk', null, phpbb_request_request_interface::POST);
$request->overwrite('sd', null, phpbb_request_request_interface::POST);
}
$forum_id = $forum_info['forum_id'];

View file

@ -462,7 +462,7 @@ function mcp_move_topic($topic_ids)
if (!$to_forum_id || $additional_msg)
{
$request->overwrite('confirm', null, phpbb_request_interface::POST);
$request->overwrite('confirm', null, phpbb_request_request_interface::POST);
$request->overwrite('confirm_key', null);
}
@ -694,7 +694,7 @@ function mcp_restore_topic($topic_ids)
}
$topic_id = $request->variable('t', 0);
if (!$request->is_set('quickmod', phpbb_request_interface::REQUEST))
if (!$request->is_set('quickmod', phpbb_request_request_interface::REQUEST))
{
$redirect = $request->variable('redirect', "index.$phpEx");
$redirect = reapply_sid($redirect);
@ -823,7 +823,7 @@ function mcp_delete_topic($topic_ids, $is_soft = false, $soft_delete_reason = ''
}
$topic_id = $request->variable('t', 0);
if (!$request->is_set('quickmod', phpbb_request_interface::REQUEST))
if (!$request->is_set('quickmod', phpbb_request_request_interface::REQUEST))
{
$redirect = $request->variable('redirect', "index.$phpEx");
$redirect = reapply_sid($redirect);
@ -1136,7 +1136,7 @@ function mcp_fork_topic($topic_ids)
if ($additional_msg)
{
$request->overwrite('confirm', null, phpbb_request_interface::POST);
$request->overwrite('confirm', null, phpbb_request_request_interface::POST);
$request->overwrite('confirm_key', null);
}

View file

@ -946,9 +946,9 @@ class mcp_queue
{
$additional_msg = $user->lang['NO_REASON_DISAPPROVAL'];
$request->overwrite('confirm', null, phpbb_request_interface::POST);
$request->overwrite('confirm_key', null, phpbb_request_interface::POST);
$request->overwrite('confirm_key', null, phpbb_request_interface::REQUEST);
$request->overwrite('confirm', null, phpbb_request_request_interface::POST);
$request->overwrite('confirm_key', null, phpbb_request_request_interface::POST);
$request->overwrite('confirm_key', null, phpbb_request_request_interface::REQUEST);
}
else
{

View file

@ -1545,7 +1545,7 @@ class parse_message extends bbcode_firstpass
global $request;
$this->filename_data['filecomment'] = utf8_normalize_nfc(request_var('filecomment', '', true));
$attachment_data = $request->variable('attachment_data', array(0 => array('' => '')), true, phpbb_request_interface::POST);
$attachment_data = $request->variable('attachment_data', array(0 => array('' => '')), true, phpbb_request_request_interface::POST);
$this->attachment_data = array();
$check_user_id = ($check_user_id === false) ? $user->data['user_id'] : $check_user_id;

View file

@ -34,8 +34,8 @@ class ucp_groups
$return_page = '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $this->u_action . '">', '</a>');
$mark_ary = request_var('mark', array(0));
$submit = $request->variable('submit', false, false, phpbb_request_interface::POST);
$delete = $request->variable('delete', false, false, phpbb_request_interface::POST);
$submit = $request->variable('submit', false, false, phpbb_request_request_interface::POST);
$delete = $request->variable('delete', false, false, phpbb_request_request_interface::POST);
$error = $data = array();
switch ($mode)

View file

@ -296,7 +296,7 @@ class ucp_main
}
else
{
$tracking_topics = $request->variable($config['cookie_name'] . '_track', '', true, phpbb_request_interface::COOKIE);
$tracking_topics = $request->variable($config['cookie_name'] . '_track', '', true, phpbb_request_request_interface::COOKIE);
$tracking_topics = ($tracking_topics) ? tracking_unserialize($tracking_topics) : array();
}

View file

@ -34,9 +34,9 @@ class ucp_profile
$user->add_lang('posting');
$preview = $request->variable('preview', false, false, phpbb_request_interface::POST);
$submit = $request->variable('submit', false, false, phpbb_request_interface::POST);
$delete = $request->variable('delete', false, false, phpbb_request_interface::POST);
$preview = $request->variable('preview', false, false, phpbb_request_request_interface::POST);
$submit = $request->variable('submit', false, false, phpbb_request_request_interface::POST);
$delete = $request->variable('delete', false, false, phpbb_request_request_interface::POST);
$error = $data = array();
$s_hidden_fields = '';

View file

@ -248,7 +248,7 @@ class install_update extends module
$this->include_file('includes/diff/renderer.' . $phpEx);
// Make sure we stay at the file check if checking the files again
if ($request->variable('check_again', false, false, phpbb_request_interface::POST))
if ($request->variable('check_again', false, false, phpbb_request_request_interface::POST))
{
$sub = $this->p_master->sub = 'file_check';
}
@ -355,7 +355,7 @@ class install_update extends module
$action = request_var('action', '');
// We are directly within an update. To make sure our update list is correct we check its status.
$update_list = ($request->variable('check_again', false, false, phpbb_request_interface::POST)) ? false : $cache->get('_update_list');
$update_list = ($request->variable('check_again', false, false, phpbb_request_request_interface::POST)) ? false : $cache->get('_update_list');
$modified = ($update_list !== false) ? @filemtime($cache->get_driver()->cache_dir . 'data_update_list.' . $phpEx) : 0;
// Make sure the list is up-to-date

View file

@ -49,7 +49,7 @@ $action = request_var('action', '');
$action_ary = request_var('action', array('' => 0));
$forum_action = request_var('forum_action', '');
if ($forum_action !== '' && $request->variable('sort', false, false, phpbb_request_interface::POST))
if ($forum_action !== '' && $request->variable('sort', false, false, phpbb_request_request_interface::POST))
{
$action = $forum_action;
}

View file

@ -1058,7 +1058,7 @@ switch ($mode)
// We validate form and field here, only id/class allowed
$form = (!preg_match('/^[a-z0-9_-]+$/i', $form)) ? '' : $form;
$field = (!preg_match('/^[a-z0-9_-]+$/i', $field)) ? '' : $field;
if ((($mode == '' || $mode == 'searchuser') || sizeof(array_intersect($request->variable_names(phpbb_request_interface::GET), $search_params)) > 0) && ($config['load_search'] || $auth->acl_get('a_')))
if ((($mode == '' || $mode == 'searchuser') || sizeof(array_intersect($request->variable_names(phpbb_request_request_interface::GET), $search_params)) > 0) && ($config['load_search'] || $auth->acl_get('a_')))
{
$username = request_var('username', '', true);
$email = strtolower(request_var('email', ''));

View file

@ -47,7 +47,7 @@ class phpbb_auth_provider_apache extends phpbb_auth_provider_base
*/
public function init()
{
if (!$this->request->is_set('PHP_AUTH_USER', phpbb_request_interface::SERVER) || $this->user->data['username'] !== htmlspecialchars_decode($this->request->server('PHP_AUTH_USER')))
if (!$this->request->is_set('PHP_AUTH_USER', phpbb_request_request_interface::SERVER) || $this->user->data['username'] !== htmlspecialchars_decode($this->request->server('PHP_AUTH_USER')))
{
return $this->user->lang['APACHE_SETUP_BEFORE_USE'];
}
@ -78,7 +78,7 @@ class phpbb_auth_provider_apache extends phpbb_auth_provider_base
);
}
if (!$this->request->is_set('PHP_AUTH_USER', phpbb_request_interface::SERVER))
if (!$this->request->is_set('PHP_AUTH_USER', phpbb_request_request_interface::SERVER))
{
return array(
'status' => LOGIN_ERROR_EXTERNAL_AUTH,
@ -149,7 +149,7 @@ class phpbb_auth_provider_apache extends phpbb_auth_provider_base
*/
public function autologin()
{
if (!$this->request->is_set('PHP_AUTH_USER', phpbb_request_interface::SERVER))
if (!$this->request->is_set('PHP_AUTH_USER', phpbb_request_request_interface::SERVER))
{
return array();
}
@ -241,7 +241,7 @@ class phpbb_auth_provider_apache extends phpbb_auth_provider_base
public function validate_session($user)
{
// Check if PHP_AUTH_USER is set and handle this case
if ($this->request->is_set('PHP_AUTH_USER', phpbb_request_interface::SERVER))
if ($this->request->is_set('PHP_AUTH_USER', phpbb_request_request_interface::SERVER))
{
$php_auth_user = $this->request->server('PHP_AUTH_USER');

View file

@ -20,7 +20,7 @@ if (!defined('IN_PHPBB'))
*
* @package auth
*/
abstract class phpbb_auth_provider_base implements phpbb_auth_provider_interface
abstract class phpbb_auth_provider_base implements phpbb_auth_provider_provider_interface
{
/**
* {@inheritdoc}

View file

@ -19,7 +19,7 @@ if (!defined('IN_PHPBB'))
* Base class for avatar drivers
* @package phpBB3
*/
abstract class phpbb_avatar_driver implements phpbb_avatar_driver_interface
abstract class phpbb_avatar_driver implements phpbb_avatar_driver_driver_interface
{
/**
* Avatar driver name
@ -47,7 +47,7 @@ abstract class phpbb_avatar_driver implements phpbb_avatar_driver_interface
/**
* Cache driver
* @var phpbb_cache_driver_interface
* @var phpbb_cache_driver_driver_interface
*/
protected $cache;
@ -73,9 +73,9 @@ abstract class phpbb_avatar_driver implements phpbb_avatar_driver_interface
* @param phpbb_request $request Request object
* @param string $phpbb_root_path Path to the phpBB root
* @param string $php_ext PHP file extension
* @param phpbb_cache_driver_interface $cache Cache driver
* @param phpbb_cache_driver_driver_interface $cache Cache driver
*/
public function __construct(phpbb_config $config, $phpbb_root_path, $php_ext, phpbb_cache_driver_interface $cache = null)
public function __construct(phpbb_config $config, $phpbb_root_path, $php_ext, phpbb_cache_driver_driver_interface $cache = null)
{
$this->config = $config;
$this->phpbb_root_path = $phpbb_root_path;

View file

@ -18,6 +18,6 @@ if (!defined('IN_PHPBB'))
/**
* @package acm
*/
abstract class phpbb_cache_driver_base implements phpbb_cache_driver_interface
abstract class phpbb_cache_driver_base implements phpbb_cache_driver_driver_interface
{
}

View file

@ -24,7 +24,7 @@ class phpbb_cache_service
/**
* Cache driver.
*
* @var phpbb_cache_driver_interface
* @var phpbb_cache_driver_driver_interface
*/
protected $driver;
@ -59,13 +59,13 @@ class phpbb_cache_service
/**
* Creates a cache service around a cache driver
*
* @param phpbb_cache_driver_interface $driver The cache driver
* @param phpbb_cache_driver_driver_interface $driver The cache driver
* @param phpbb_config $config The config
* @param phpbb_db_driver $db Database connection
* @param string $phpbb_root_path Root path
* @param string $php_ext PHP extension
*/
public function __construct(phpbb_cache_driver_interface $driver, phpbb_config $config, phpbb_db_driver $db, $phpbb_root_path, $php_ext)
public function __construct(phpbb_cache_driver_driver_interface $driver, phpbb_config $config, phpbb_db_driver $db, $phpbb_root_path, $php_ext)
{
$this->set_driver($driver);
$this->config = $config;
@ -77,7 +77,7 @@ class phpbb_cache_service
/**
* Returns the cache driver used by this cache service.
*
* @return phpbb_cache_driver_interface The cache driver
* @return phpbb_cache_driver_driver_interface The cache driver
*/
public function get_driver()
{
@ -87,9 +87,9 @@ class phpbb_cache_service
/**
* Replaces the cache driver used by this cache service.
*
* @param phpbb_cache_driver_interface $driver The cache driver
* @param phpbb_cache_driver_driver_interface $driver The cache driver
*/
public function set_driver(phpbb_cache_driver_interface $driver)
public function set_driver(phpbb_cache_driver_driver_interface $driver)
{
$this->driver = $driver;
}

View file

@ -50,9 +50,9 @@ class phpbb_class_loader
* @param string $prefix Required class name prefix for files to be loaded
* @param string $path Directory to load files from
* @param string $php_ext The file extension for PHP files
* @param phpbb_cache_driver_interface $cache An implementation of the phpBB cache interface.
* @param phpbb_cache_driver_driver_interface $cache An implementation of the phpBB cache interface.
*/
public function __construct($prefix, $path, $php_ext = 'php', phpbb_cache_driver_interface $cache = null)
public function __construct($prefix, $path, $php_ext = 'php', phpbb_cache_driver_driver_interface $cache = null)
{
$this->prefix = $prefix;
$this->path = $path;
@ -66,9 +66,9 @@ class phpbb_class_loader
* the class loader will resolve paths by checking for the existance of every
* directory in the class name every time.
*
* @param phpbb_cache_driver_interface $cache An implementation of the phpBB cache interface.
* @param phpbb_cache_driver_driver_interface $cache An implementation of the phpBB cache interface.
*/
public function set_cache(phpbb_cache_driver_interface $cache = null)
public function set_cache(phpbb_cache_driver_driver_interface $cache = null)
{
if ($cache)
{

View file

@ -23,7 +23,7 @@ class phpbb_config_db extends phpbb_config
{
/**
* Cache instance
* @var phpbb_cache_driver_interface
* @var phpbb_cache_driver_driver_interface
*/
protected $cache;
@ -43,10 +43,10 @@ class phpbb_config_db extends phpbb_config
* Creates a configuration container with a default set of values
*
* @param phpbb_db_driver $db Database connection
* @param phpbb_cache_driver_interface $cache Cache instance
* @param phpbb_cache_driver_driver_interface $cache Cache instance
* @param string $table Configuration table name
*/
public function __construct(phpbb_db_driver $db, phpbb_cache_driver_interface $cache, $table)
public function __construct(phpbb_db_driver $db, phpbb_cache_driver_driver_interface $cache, $table)
{
$this->db = $db;
$this->cache = $cache;

View file

@ -132,15 +132,15 @@ class phpbb_cron_task_core_prune_forum extends phpbb_cron_task_base implements p
/**
* Parses parameters found in $request, which is an instance of
* phpbb_request_interface.
* phpbb_request_request_interface.
*
* It is expected to have a key f whose value is id of the forum to be pruned.
*
* @param phpbb_request_interface $request Request object.
* @param phpbb_request_request_interface $request Request object.
*
* @return null
*/
public function parse_parameters(phpbb_request_interface $request)
public function parse_parameters(phpbb_request_request_interface $request)
{
$this->forum_data = null;
if ($request->is_set('f'))

View file

@ -29,9 +29,9 @@ class phpbb_cron_task_core_tidy_cache extends phpbb_cron_task_base
* Constructor.
*
* @param phpbb_config $config The config
* @param phpbb_cache_driver_interface $cache The cache driver
* @param phpbb_cache_driver_driver_interface $cache The cache driver
*/
public function __construct(phpbb_config $config, phpbb_cache_driver_interface $cache)
public function __construct(phpbb_config $config, phpbb_cache_driver_driver_interface $cache)
{
$this->config = $config;
$this->cache = $cache;

View file

@ -39,14 +39,14 @@ interface phpbb_cron_task_parametrized extends phpbb_cron_task
/**
* Parses parameters found in $request, which is an instance of
* phpbb_request_interface.
* phpbb_request_request_interface.
*
* $request contains user input and must not be trusted.
* Cron task must validate all data before using it.
*
* @param phpbb_request_interface $request Request object.
* @param phpbb_request_request_interface $request Request object.
*
* @return null
*/
public function parse_parameters(phpbb_request_interface $request);
public function parse_parameters(phpbb_request_request_interface $request);
}

View file

@ -12,7 +12,7 @@
*
* @package db
*/
class phpbb_db_migration_tool_config implements phpbb_db_migration_tool_interface
class phpbb_db_migration_tool_config implements phpbb_db_migration_tool_tool_interface
{
/** @var phpbb_config */
protected $config;

View file

@ -12,7 +12,7 @@
*
* @package db
*/
class phpbb_db_migration_tool_module implements phpbb_db_migration_tool_interface
class phpbb_db_migration_tool_module implements phpbb_db_migration_tool_tool_interface
{
/** @var phpbb_cache_service */
protected $cache;

View file

@ -12,7 +12,7 @@
*
* @package db
*/
class phpbb_db_migration_tool_permission implements phpbb_db_migration_tool_interface
class phpbb_db_migration_tool_permission implements phpbb_db_migration_tool_tool_interface
{
/** @var phpbb_auth */
protected $auth;

View file

@ -22,7 +22,7 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
*
* @package extension
*/
class phpbb_extension_base implements phpbb_extension_interface
class phpbb_extension_base implements phpbb_extension_extension_interface
{
/** @var ContainerInterface */
protected $container;

View file

@ -57,12 +57,12 @@ class phpbb_extension_finder
* extensions and their locations
* @param phpbb_filesystem $filesystem Filesystem instance
* @param string $phpbb_root_path Path to the phpbb root directory
* @param phpbb_cache_driver_interface $cache A cache instance or null
* @param phpbb_cache_driver_driver_interface $cache A cache instance or null
* @param string $php_ext php file extension
* @param string $cache_name The name of the cache variable, defaults to
* _ext_finder
*/
public function __construct(phpbb_extension_manager $extension_manager, phpbb_filesystem $filesystem, $phpbb_root_path = '', phpbb_cache_driver_interface $cache = null, $php_ext = 'php', $cache_name = '_ext_finder')
public function __construct(phpbb_extension_manager $extension_manager, phpbb_filesystem $filesystem, $phpbb_root_path = '', phpbb_cache_driver_driver_interface $cache = null, $php_ext = 'php', $cache_name = '_ext_finder')
{
$this->extension_manager = $extension_manager;
$this->filesystem = $filesystem;

View file

@ -46,10 +46,10 @@ class phpbb_extension_manager
* @param string $extension_table The name of the table holding extensions
* @param string $phpbb_root_path Path to the phpbb includes directory.
* @param string $php_ext php file extension
* @param phpbb_cache_driver_interface $cache A cache instance or null
* @param phpbb_cache_driver_driver_interface $cache A cache instance or null
* @param string $cache_name The name of the cache variable, defaults to _ext
*/
public function __construct(ContainerInterface $container, phpbb_db_driver $db, phpbb_config $config, phpbb_filesystem $filesystem, $extension_table, $phpbb_root_path, $php_ext = 'php', phpbb_cache_driver_interface $cache = null, $cache_name = '_ext')
public function __construct(ContainerInterface $container, phpbb_db_driver $db, phpbb_config $config, phpbb_filesystem $filesystem, $extension_table, $phpbb_root_path, $php_ext = 'php', phpbb_cache_driver_driver_interface $cache = null, $cache_name = '_ext')
{
$this->container = $container;
$this->phpbb_root_path = $phpbb_root_path;
@ -126,7 +126,7 @@ class phpbb_extension_manager
* Instantiates the extension meta class for the extension with the given name
*
* @param string $name The extension name
* @return phpbb_extension_interface Instance of the extension meta class or
* @return phpbb_extension_extension_interface Instance of the extension meta class or
* phpbb_extension_base if the class does not exist
*/
public function get_extension($name)

View file

@ -34,7 +34,7 @@ abstract class phpbb_feed_base
/** @var phpbb_db_driver */
protected $db;
/** @var phpbb_cache_driver_interface */
/** @var phpbb_cache_driver_driver_interface */
protected $cache;
/** @var phpbb_user */
@ -77,14 +77,14 @@ abstract class phpbb_feed_base
* @param phpbb_feed_helper $helper Feed helper
* @param phpbb_config $config Config object
* @param phpbb_db_driver $db Database connection
* @param phpbb_cache_driver_interface $cache Cache object
* @param phpbb_cache_driver_driver_interface $cache Cache object
* @param phpbb_user $user User object
* @param phpbb_auth $auth Auth object
* @param phpbb_content_visibility $content_visibility Auth object
* @param string $phpEx php file extension
* @return null
*/
function __construct(phpbb_feed_helper $helper, phpbb_config $config, phpbb_db_driver $db, phpbb_cache_driver_interface $cache, phpbb_user $user, phpbb_auth $auth, phpbb_content_visibility $content_visibility, $phpEx)
function __construct(phpbb_feed_helper $helper, phpbb_config $config, phpbb_db_driver $db, phpbb_cache_driver_driver_interface $cache, phpbb_user $user, phpbb_auth $auth, phpbb_content_visibility $content_visibility, $phpEx)
{
$this->config = $config;
$this->helper = $helper;

View file

@ -23,7 +23,7 @@ if (!defined('IN_PHPBB'))
*
* @package phpBB3
*/
class phpbb_groupposition_legend implements phpbb_groupposition_interface
class phpbb_groupposition_legend implements phpbb_groupposition_groupposition_interface
{
/**
* Group is not displayed

View file

@ -22,7 +22,7 @@ if (!defined('IN_PHPBB'))
*
* @package phpBB3
*/
class phpbb_groupposition_teampage implements phpbb_groupposition_interface
class phpbb_groupposition_teampage implements phpbb_groupposition_groupposition_interface
{
/**
* Group is not displayed
@ -48,7 +48,7 @@ class phpbb_groupposition_teampage implements phpbb_groupposition_interface
/**
* Cache object
* @var phpbb_cache_driver_interface
* @var phpbb_cache_driver_driver_interface
*/
protected $cache;
@ -57,9 +57,9 @@ class phpbb_groupposition_teampage implements phpbb_groupposition_interface
*
* @param phpbb_db_driver $db Database object
* @param phpbb_user $user User object
* @param phpbb_cache_driver_interface $cache Cache object
* @param phpbb_cache_driver_driver_interface $cache Cache object
*/
public function __construct(phpbb_db_driver $db, phpbb_user $user, phpbb_cache_driver_interface $cache)
public function __construct(phpbb_db_driver $db, phpbb_user $user, phpbb_cache_driver_driver_interface $cache)
{
$this->db = $db;
$this->user = $user;

View file

@ -31,9 +31,9 @@ class phpbb_hook_finder
*
* @param string $phpbb_root_path Path to the phpbb root directory
* @param string $php_ext php file extension
* @param phpbb_cache_driver_interface $cache A cache instance or null
* @param phpbb_cache_driver_driver_interface $cache A cache instance or null
*/
public function __construct($phpbb_root_path, $php_ext, phpbb_cache_driver_interface $cache = null)
public function __construct($phpbb_root_path, $php_ext, phpbb_cache_driver_driver_interface $cache = null)
{
$this->phpbb_root_path = $phpbb_root_path;
$this->cache = $cache;

View file

@ -20,7 +20,7 @@ if (!defined('IN_PHPBB'))
*
* @package phpbb_log
*/
class phpbb_log implements phpbb_log_interface
class phpbb_log implements phpbb_log_log_interface
{
/**
* If set, administrative user profile links will be returned and messages

View file

@ -525,7 +525,7 @@ class phpbb_notification_manager
{
$type = $this->get_item_type_class($type_name);
if ($type instanceof phpbb_notification_type_interface && $type->is_available())
if ($type instanceof phpbb_notification_type_type_interface && $type->is_available())
{
$options = array_merge(array(
'id' => $type->get_type(),
@ -561,7 +561,7 @@ class phpbb_notification_manager
{
$method = $this->get_method_class($method_name);
if ($method instanceof phpbb_notification_method_interface && $method->is_available())
if ($method instanceof phpbb_notification_method_method_interface && $method->is_available())
{
$subscription_methods[$method_name] = array(
'id' => $method->get_type(),

View file

@ -19,7 +19,7 @@ if (!defined('IN_PHPBB'))
* Base notifications method class
* @package notifications
*/
abstract class phpbb_notification_method_base implements phpbb_notification_method_interface
abstract class phpbb_notification_method_base implements phpbb_notification_method_method_interface
{
/** @var phpbb_notification_manager */
protected $notification_manager;
@ -30,7 +30,7 @@ abstract class phpbb_notification_method_base implements phpbb_notification_meth
/** @var phpbb_db_driver */
protected $db;
/** @var phpbb_cache_driver_interface */
/** @var phpbb_cache_driver_driver_interface */
protected $cache;
/** @var phpbb_template */
@ -66,7 +66,7 @@ abstract class phpbb_notification_method_base implements phpbb_notification_meth
*
* @param phpbb_user_loader $user_loader
* @param phpbb_db_driver $db
* @param phpbb_cache_driver_interface $cache
* @param phpbb_cache_driver_driver_interface $cache
* @param phpbb_user $user
* @param phpbb_auth $auth
* @param phpbb_config $config
@ -74,7 +74,7 @@ abstract class phpbb_notification_method_base implements phpbb_notification_meth
* @param string $php_ext
* @return phpbb_notification_method_base
*/
public function __construct(phpbb_user_loader $user_loader, phpbb_db_driver $db, phpbb_cache_driver_interface $cache, $user, phpbb_auth $auth, phpbb_config $config, $phpbb_root_path, $php_ext)
public function __construct(phpbb_user_loader $user_loader, phpbb_db_driver $db, phpbb_cache_driver_driver_interface $cache, $user, phpbb_auth $auth, phpbb_config $config, $phpbb_root_path, $php_ext)
{
$this->user_loader = $user_loader;
$this->db = $db;
@ -99,9 +99,9 @@ abstract class phpbb_notification_method_base implements phpbb_notification_meth
/**
* Add a notification to the queue
*
* @param phpbb_notification_type_interface $notification
* @param phpbb_notification_type_type_interface $notification
*/
public function add_to_queue(phpbb_notification_type_interface $notification)
public function add_to_queue(phpbb_notification_type_type_interface $notification)
{
$this->queue[] = $notification;
}

View file

@ -37,9 +37,9 @@ interface phpbb_notification_method_method_interface
/**
* Add a notification to the queue
*
* @param phpbb_notification_type_interface $notification
* @param phpbb_notification_type_type_interface $notification
*/
public function add_to_queue(phpbb_notification_type_interface $notification);
public function add_to_queue(phpbb_notification_type_type_interface $notification);
/**
* Parse the queue and notify the users

View file

@ -19,7 +19,7 @@ if (!defined('IN_PHPBB'))
* Base notifications class
* @package notifications
*/
abstract class phpbb_notification_type_base implements phpbb_notification_type_interface
abstract class phpbb_notification_type_base implements phpbb_notification_type_type_interface
{
/** @var phpbb_notification_manager */
protected $notification_manager;
@ -30,7 +30,7 @@ abstract class phpbb_notification_type_base implements phpbb_notification_type_i
/** @var phpbb_db_driver */
protected $db;
/** @var phpbb_cache_driver_interface */
/** @var phpbb_cache_driver_driver_interface */
protected $cache;
/** @var phpbb_template */
@ -96,7 +96,7 @@ abstract class phpbb_notification_type_base implements phpbb_notification_type_i
*
* @param phpbb_user_loader $user_loader
* @param phpbb_db_driver $db
* @param phpbb_cache_driver_interface $cache
* @param phpbb_cache_driver_driver_interface $cache
* @param phpbb_user $user
* @param phpbb_auth $auth
* @param phpbb_config $config
@ -107,7 +107,7 @@ abstract class phpbb_notification_type_base implements phpbb_notification_type_i
* @param string $user_notifications_table
* @return phpbb_notification_type_base
*/
public function __construct(phpbb_user_loader $user_loader, phpbb_db_driver $db, phpbb_cache_driver_interface $cache, $user, phpbb_auth $auth, phpbb_config $config, $phpbb_root_path, $php_ext, $notification_types_table, $notifications_table, $user_notifications_table)
public function __construct(phpbb_user_loader $user_loader, phpbb_db_driver $db, phpbb_cache_driver_driver_interface $cache, $user, phpbb_auth $auth, phpbb_config $config, $phpbb_root_path, $php_ext, $notification_types_table, $notifications_table, $user_notifications_table)
{
$this->user_loader = $user_loader;
$this->db = $db;

View file

@ -29,23 +29,23 @@ class phpbb_request_deactivated_super_global implements ArrayAccess, Countable,
private $name;
/**
* @var phpbb_request_interface::POST|GET|REQUEST|COOKIE Super global constant.
* @var phpbb_request_request_interface::POST|GET|REQUEST|COOKIE Super global constant.
*/
private $super_global;
/**
* @var phpbb_request_interface The request class instance holding the actual request data.
* @var phpbb_request_request_interface The request class instance holding the actual request data.
*/
private $request;
/**
* Constructor generates an error message fitting the super global to be used within the other functions.
*
* @param phpbb_request_interface $request A request class instance holding the real super global data.
* @param phpbb_request_request_interface $request A request class instance holding the real super global data.
* @param string $name Name of the super global this is a replacement for - e.g. '_GET'.
* @param phpbb_request_interface::POST|GET|REQUEST|COOKIE $super_global The variable's super global constant.
* @param phpbb_request_request_interface::POST|GET|REQUEST|COOKIE $super_global The variable's super global constant.
*/
public function __construct(phpbb_request_interface $request, $name, $super_global)
public function __construct(phpbb_request_request_interface $request, $name, $super_global)
{
$this->request = $request;
$this->name = $name;

View file

@ -23,18 +23,18 @@ if (!defined('IN_PHPBB'))
*
* @package phpbb_request
*/
class phpbb_request implements phpbb_request_interface
class phpbb_request implements phpbb_request_request_interface
{
/**
* @var array The names of super global variables that this class should protect if super globals are disabled.
*/
protected $super_globals = array(
phpbb_request_interface::POST => '_POST',
phpbb_request_interface::GET => '_GET',
phpbb_request_interface::REQUEST => '_REQUEST',
phpbb_request_interface::COOKIE => '_COOKIE',
phpbb_request_interface::SERVER => '_SERVER',
phpbb_request_interface::FILES => '_FILES',
phpbb_request_request_interface::POST => '_POST',
phpbb_request_request_interface::GET => '_GET',
phpbb_request_request_interface::REQUEST => '_REQUEST',
phpbb_request_request_interface::COOKIE => '_COOKIE',
phpbb_request_request_interface::SERVER => '_SERVER',
phpbb_request_request_interface::FILES => '_FILES',
);
/**
@ -78,8 +78,8 @@ class phpbb_request implements phpbb_request_interface
}
// simulate request_order = GP
$this->original_request = $this->input[phpbb_request_interface::REQUEST];
$this->input[phpbb_request_interface::REQUEST] = $this->input[phpbb_request_interface::POST] + $this->input[phpbb_request_interface::GET];
$this->original_request = $this->input[phpbb_request_request_interface::REQUEST];
$this->input[phpbb_request_request_interface::REQUEST] = $this->input[phpbb_request_request_interface::POST] + $this->input[phpbb_request_request_interface::GET];
if ($disable_super_globals)
{
@ -144,10 +144,10 @@ class phpbb_request implements phpbb_request_interface
* @param string $var_name The name of the variable that shall be overwritten
* @param mixed $value The value which the variable shall contain.
* If this is null the variable will be unset.
* @param phpbb_request_interface::POST|GET|REQUEST|COOKIE $super_global
* @param phpbb_request_request_interface::POST|GET|REQUEST|COOKIE $super_global
* Specifies which super global shall be changed
*/
public function overwrite($var_name, $value, $super_global = phpbb_request_interface::REQUEST)
public function overwrite($var_name, $value, $super_global = phpbb_request_request_interface::REQUEST)
{
if (!isset($this->super_globals[$super_global]))
{
@ -193,13 +193,13 @@ class phpbb_request implements phpbb_request_interface
* This function will always return a value of the same type as the default.
* @param bool $multibyte If $default is a string this paramater has to be true if the variable may contain any UTF-8 characters
* Default is false, causing all bytes outside the ASCII range (0-127) to be replaced with question marks
* @param phpbb_request_interface::POST|GET|REQUEST|COOKIE $super_global
* @param phpbb_request_request_interface::POST|GET|REQUEST|COOKIE $super_global
* Specifies which super global should be used
*
* @return mixed The value of $_REQUEST[$var_name] run through {@link set_var set_var} to ensure that the type is the
* the same as that of $default. If the variable is not set $default is returned.
*/
public function variable($var_name, $default, $multibyte = false, $super_global = phpbb_request_interface::REQUEST)
public function variable($var_name, $default, $multibyte = false, $super_global = phpbb_request_request_interface::REQUEST)
{
return $this->_variable($var_name, $default, $multibyte, $super_global, true);
}
@ -217,13 +217,13 @@ class phpbb_request implements phpbb_request_interface
* This function will always return a value of the same type as the default.
* @param bool $multibyte If $default is a string this paramater has to be true if the variable may contain any UTF-8 characters
* Default is false, causing all bytes outside the ASCII range (0-127) to be replaced with question marks
* @param phpbb_request_interface::POST|GET|REQUEST|COOKIE $super_global
* @param phpbb_request_request_interface::POST|GET|REQUEST|COOKIE $super_global
* Specifies which super global should be used
*
* @return mixed The value of $_REQUEST[$var_name] run through {@link set_var set_var} to ensure that the type is the
* the same as that of $default. If the variable is not set $default is returned.
*/
public function untrimmed_variable($var_name, $default, $multibyte, $super_global = phpbb_request_interface::REQUEST)
public function untrimmed_variable($var_name, $default, $multibyte, $super_global = phpbb_request_request_interface::REQUEST)
{
return $this->_variable($var_name, $default, $multibyte, $super_global, false);
}
@ -234,8 +234,8 @@ class phpbb_request implements phpbb_request_interface
* Also fall back to getenv(), some CGI setups may need it (probably not, but
* whatever).
*
* @param string|array $var_name See phpbb_request_interface::variable
* @param mixed $Default See phpbb_request_interface::variable
* @param string|array $var_name See phpbb_request_request_interface::variable
* @param mixed $Default See phpbb_request_request_interface::variable
*
* @return mixed The server variable value.
*/
@ -243,9 +243,9 @@ class phpbb_request implements phpbb_request_interface
{
$multibyte = true;
if ($this->is_set($var_name, phpbb_request_interface::SERVER))
if ($this->is_set($var_name, phpbb_request_request_interface::SERVER))
{
return $this->variable($var_name, $default, $multibyte, phpbb_request_interface::SERVER);
return $this->variable($var_name, $default, $multibyte, phpbb_request_request_interface::SERVER);
}
else
{
@ -259,7 +259,7 @@ class phpbb_request implements phpbb_request_interface
* Shortcut method to retrieve the value of client HTTP headers.
*
* @param string|array $header_name The name of the header to retrieve.
* @param mixed $default See phpbb_request_interface::variable
* @param mixed $default See phpbb_request_request_interface::variable
*
* @return mixed The header value.
*/
@ -279,7 +279,7 @@ class phpbb_request implements phpbb_request_interface
*/
public function file($form_name)
{
return $this->variable($form_name, array('name' => 'none'), false, phpbb_request_interface::FILES);
return $this->variable($form_name, array('name' => 'none'), false, phpbb_request_request_interface::FILES);
}
/**
@ -294,7 +294,7 @@ class phpbb_request implements phpbb_request_interface
*/
public function is_set_post($name)
{
return $this->is_set($name, phpbb_request_interface::POST);
return $this->is_set($name, phpbb_request_request_interface::POST);
}
/**
@ -302,12 +302,12 @@ class phpbb_request implements phpbb_request_interface
* arrays.
*
* @param string $var Name of the variable
* @param phpbb_request_interface::POST|GET|REQUEST|COOKIE $super_global
* @param phpbb_request_request_interface::POST|GET|REQUEST|COOKIE $super_global
* Specifies the super global which shall be checked
*
* @return bool True if the variable was sent as input
*/
public function is_set($var, $super_global = phpbb_request_interface::REQUEST)
public function is_set($var, $super_global = phpbb_request_request_interface::REQUEST)
{
return isset($this->input[$super_global][$var]);
}
@ -335,13 +335,13 @@ class phpbb_request implements phpbb_request_interface
/**
* Returns all variable names for a given super global
*
* @param phpbb_request_interface::POST|GET|REQUEST|COOKIE $super_global
* @param phpbb_request_request_interface::POST|GET|REQUEST|COOKIE $super_global
* The super global from which names shall be taken
*
* @return array All variable names that are set for the super global.
* Pay attention when using these, they are unsanitised!
*/
public function variable_names($super_global = phpbb_request_interface::REQUEST)
public function variable_names($super_global = phpbb_request_request_interface::REQUEST)
{
if (!isset($this->input[$super_global]))
{
@ -362,14 +362,14 @@ class phpbb_request implements phpbb_request_interface
* This function will always return a value of the same type as the default.
* @param bool $multibyte If $default is a string this paramater has to be true if the variable may contain any UTF-8 characters
* Default is false, causing all bytes outside the ASCII range (0-127) to be replaced with question marks
* @param phpbb_request_interface::POST|GET|REQUEST|COOKIE $super_global
* @param phpbb_request_request_interface::POST|GET|REQUEST|COOKIE $super_global
* Specifies which super global should be used
* @param bool $trim Indicates whether trim() should be applied to string values.
*
* @return mixed The value of $_REQUEST[$var_name] run through {@link set_var set_var} to ensure that the type is the
* the same as that of $default. If the variable is not set $default is returned.
*/
protected function _variable($var_name, $default, $multibyte = false, $super_global = phpbb_request_interface::REQUEST, $trim = true)
protected function _variable($var_name, $default, $multibyte = false, $super_global = phpbb_request_request_interface::REQUEST, $trim = true)
{
$path = false;

View file

@ -43,10 +43,10 @@ interface phpbb_request_request_interface
* @param string $var_name The name of the variable that shall be overwritten
* @param mixed $value The value which the variable shall contain.
* If this is null the variable will be unset.
* @param phpbb_request_interface::POST|GET|REQUEST|COOKIE $super_global
* @param phpbb_request_request_interface::POST|GET|REQUEST|COOKIE $super_global
* Specifies which super global shall be changed
*/
public function overwrite($var_name, $value, $super_global = phpbb_request_interface::REQUEST);
public function overwrite($var_name, $value, $super_global = phpbb_request_request_interface::REQUEST);
/**
* Central type safe input handling function.
@ -60,19 +60,19 @@ interface phpbb_request_request_interface
* This function will always return a value of the same type as the default.
* @param bool $multibyte If $default is a string this paramater has to be true if the variable may contain any UTF-8 characters
* Default is false, causing all bytes outside the ASCII range (0-127) to be replaced with question marks
* @param phpbb_request_interface::POST|GET|REQUEST|COOKIE $super_global
* @param phpbb_request_request_interface::POST|GET|REQUEST|COOKIE $super_global
* Specifies which super global should be used
*
* @return mixed The value of $_REQUEST[$var_name] run through {@link set_var set_var} to ensure that the type is the
* the same as that of $default. If the variable is not set $default is returned.
*/
public function variable($var_name, $default, $multibyte = false, $super_global = phpbb_request_interface::REQUEST);
public function variable($var_name, $default, $multibyte = false, $super_global = phpbb_request_request_interface::REQUEST);
/**
* Shortcut method to retrieve SERVER variables.
*
* @param string|array $var_name See phpbb_request_interface::variable
* @param mixed $default See phpbb_request_interface::variable
* @param string|array $var_name See phpbb_request_request_interface::variable
* @param mixed $default See phpbb_request_request_interface::variable
*
* @return mixed The server variable value.
*/
@ -82,7 +82,7 @@ interface phpbb_request_request_interface
* Shortcut method to retrieve the value of client HTTP headers.
*
* @param string|array $header_name The name of the header to retrieve.
* @param mixed $default See phpbb_request_interface::variable
* @param mixed $default See phpbb_request_request_interface::variable
*
* @return mixed The header value.
*/
@ -105,12 +105,12 @@ interface phpbb_request_request_interface
* arrays.
*
* @param string $var Name of the variable
* @param phpbb_request_interface::POST|GET|REQUEST|COOKIE $super_global
* @param phpbb_request_request_interface::POST|GET|REQUEST|COOKIE $super_global
* Specifies the super global which shall be checked
*
* @return bool True if the variable was sent as input
*/
public function is_set($var, $super_global = phpbb_request_interface::REQUEST);
public function is_set($var, $super_global = phpbb_request_request_interface::REQUEST);
/**
* Checks whether the current request is an AJAX request (XMLHttpRequest)
@ -129,11 +129,11 @@ interface phpbb_request_request_interface
/**
* Returns all variable names for a given super global
*
* @param phpbb_request_interface::POST|GET|REQUEST|COOKIE $super_global
* @param phpbb_request_request_interface::POST|GET|REQUEST|COOKIE $super_global
* The super global from which names shall be taken
*
* @return array All variable names that are set for the super global.
* Pay attention when using these, they are unsanitised!
*/
public function variable_names($super_global = phpbb_request_interface::REQUEST);
public function variable_names($super_global = phpbb_request_request_interface::REQUEST);
}

View file

@ -243,7 +243,7 @@ class phpbb_session
$this->forwarded_for = '';
}
if ($request->is_set($config['cookie_name'] . '_sid', phpbb_request_interface::COOKIE) || $request->is_set($config['cookie_name'] . '_u', phpbb_request_interface::COOKIE))
if ($request->is_set($config['cookie_name'] . '_sid', phpbb_request_request_interface::COOKIE) || $request->is_set($config['cookie_name'] . '_u', phpbb_request_request_interface::COOKIE))
{
$this->cookie_data['u'] = request_var($config['cookie_name'] . '_u', 0, false, true);
$this->cookie_data['k'] = request_var($config['cookie_name'] . '_k', '', false, true);
@ -405,9 +405,9 @@ class phpbb_session
$provider = $phpbb_container->get('auth.provider.' . $method);
if (!($provider instanceof phpbb_auth_provider_interface))
if (!($provider instanceof phpbb_auth_provider_provider_interface))
{
throw new \RuntimeException($provider . ' must implement phpbb_auth_provider_interface');
throw new \RuntimeException($provider . ' must implement phpbb_auth_provider_provider_interface');
}
$ret = $provider->validate_session($this->data);

View file

@ -15,7 +15,7 @@ if (!defined('IN_PHPBB'))
exit;
}
abstract class phpbb_tree_nestedset implements phpbb_tree_interface
abstract class phpbb_tree_nestedset implements phpbb_tree_tree_interface
{
/** @var phpbb_db_driver */
protected $db;

View file

@ -697,7 +697,7 @@ if ($submit || $preview || $refresh)
$message_parser->message = utf8_normalize_nfc(request_var('message', '', true));
$post_data['username'] = utf8_normalize_nfc(request_var('username', $post_data['username'], true));
$post_data['post_edit_reason'] = ($request->variable('edit_reason', false, false, phpbb_request_interface::POST) && $mode == 'edit' && $auth->acl_get('m_edit', $forum_id)) ? utf8_normalize_nfc(request_var('edit_reason', '', true)) : '';
$post_data['post_edit_reason'] = ($request->variable('edit_reason', false, false, phpbb_request_request_interface::POST) && $mode == 'edit' && $auth->acl_get('m_edit', $forum_id)) ? utf8_normalize_nfc(request_var('edit_reason', '', true)) : '';
$post_data['orig_topic_type'] = $post_data['topic_type'];
$post_data['topic_type'] = request_var('topic_type', (($mode != 'post') ? (int) $post_data['topic_type'] : POST_NORMAL));

View file

@ -683,7 +683,7 @@ if ($keywords || $author || $author_id || $search_id || $submit)
if ($config['load_anon_lastread'] || ($user->data['is_registered'] && !$config['load_db_lastread']))
{
$tracking_topics = $request->variable($config['cookie_name'] . '_track', '', true, phpbb_request_interface::COOKIE);
$tracking_topics = $request->variable($config['cookie_name'] . '_track', '', true, phpbb_request_request_interface::COOKIE);
$tracking_topics = ($tracking_topics) ? tracking_unserialize($tracking_topics) : array();
}

View file

@ -139,9 +139,9 @@ switch ($mode)
{
$set_time = time() - 31536000;
foreach ($request->variable_names(phpbb_request_interface::COOKIE) as $cookie_name)
foreach ($request->variable_names(phpbb_request_request_interface::COOKIE) as $cookie_name)
{
$cookie_data = $request->variable($cookie_name, '', true, phpbb_request_interface::COOKIE);
$cookie_data = $request->variable($cookie_name, '', true, phpbb_request_request_interface::COOKIE);
// Only delete board cookies, no other ones...
if (strpos($cookie_name, $config['cookie_name'] . '_') !== 0)

View file

@ -716,9 +716,9 @@ if (!empty($topic_data['poll_start']))
// Cookie based guest tracking ... I don't like this but hum ho
// it's oft requested. This relies on "nice" users who don't feel
// the need to delete cookies to mess with results.
if ($request->is_set($config['cookie_name'] . '_poll_' . $topic_id, phpbb_request_interface::COOKIE))
if ($request->is_set($config['cookie_name'] . '_poll_' . $topic_id, phpbb_request_request_interface::COOKIE))
{
$cur_voted_id = explode(',', $request->variable($config['cookie_name'] . '_poll_' . $topic_id, '', true, phpbb_request_interface::COOKIE));
$cur_voted_id = explode(',', $request->variable($config['cookie_name'] . '_poll_' . $topic_id, '', true, phpbb_request_request_interface::COOKIE));
$cur_voted_id = array_map('intval', $cur_voted_id);
}
}

View file

@ -43,7 +43,7 @@ class phpbb_auth_provider_apache_test extends phpbb_database_test_case
$this->request->expects($this->once())
->method('is_set')
->with('PHP_AUTH_USER',
phpbb_request_interface::SERVER)
phpbb_request_request_interface::SERVER)
->will($this->returnValue(true));
$this->request->expects($this->once())
->method('server')
@ -61,7 +61,7 @@ class phpbb_auth_provider_apache_test extends phpbb_database_test_case
$this->request->expects($this->once())
->method('is_set')
->with('PHP_AUTH_USER',
phpbb_request_interface::SERVER)
phpbb_request_request_interface::SERVER)
->will($this->returnValue(true));
$this->request->expects($this->at(1))
->method('server')
@ -93,7 +93,7 @@ class phpbb_auth_provider_apache_test extends phpbb_database_test_case
$this->request->expects($this->once())
->method('is_set')
->with('PHP_AUTH_USER',
phpbb_request_interface::SERVER)
phpbb_request_request_interface::SERVER)
->will($this->returnValue(true));
$this->request->expects($this->at(1))
->method('server')
@ -194,7 +194,7 @@ class phpbb_auth_provider_apache_test extends phpbb_database_test_case
$this->request->expects($this->once())
->method('is_set')
->with('PHP_AUTH_USER',
phpbb_request_interface::SERVER)
phpbb_request_request_interface::SERVER)
->will($this->returnValue(true));
$this->request->expects($this->once())
->method('server')

View file

@ -24,7 +24,7 @@ class phpbb_avatar_manager_test extends PHPUnit_Framework_TestCase
// Prepare dependencies for avatar manager and driver
$config = new phpbb_config(array());
$request = $this->getMock('phpbb_request');
$cache = $this->getMock('phpbb_cache_driver_interface');
$cache = $this->getMock('phpbb_cache_driver_driver_interface');
// $this->avatar_foobar will be needed later on
$this->avatar_foobar = $this->getMock('phpbb_avatar_driver_foobar', array('get_name'), array($config, $phpbb_root_path, $phpEx, $cache));

View file

@ -7,7 +7,7 @@
*
*/
class phpbb_mock_cache implements phpbb_cache_driver_interface
class phpbb_mock_cache implements phpbb_cache_driver_driver_interface
{
protected $data;

View file

@ -7,33 +7,33 @@
*
*/
class phpbb_mock_request implements phpbb_request_interface
class phpbb_mock_request implements phpbb_request_request_interface
{
protected $data;
public function __construct($get = array(), $post = array(), $cookie = array(), $server = array(), $request = false, $files = array())
{
$this->data[phpbb_request_interface::GET] = $get;
$this->data[phpbb_request_interface::POST] = $post;
$this->data[phpbb_request_interface::COOKIE] = $cookie;
$this->data[phpbb_request_interface::REQUEST] = ($request === false) ? $post + $get : $request;
$this->data[phpbb_request_interface::SERVER] = $server;
$this->data[phpbb_request_interface::FILES] = $files;
$this->data[phpbb_request_request_interface::GET] = $get;
$this->data[phpbb_request_request_interface::POST] = $post;
$this->data[phpbb_request_request_interface::COOKIE] = $cookie;
$this->data[phpbb_request_request_interface::REQUEST] = ($request === false) ? $post + $get : $request;
$this->data[phpbb_request_request_interface::SERVER] = $server;
$this->data[phpbb_request_request_interface::FILES] = $files;
}
public function overwrite($var_name, $value, $super_global = phpbb_request_interface::REQUEST)
public function overwrite($var_name, $value, $super_global = phpbb_request_request_interface::REQUEST)
{
$this->data[$super_global][$var_name] = $value;
}
public function variable($var_name, $default, $multibyte = false, $super_global = phpbb_request_interface::REQUEST)
public function variable($var_name, $default, $multibyte = false, $super_global = phpbb_request_request_interface::REQUEST)
{
return isset($this->data[$super_global][$var_name]) ? $this->data[$super_global][$var_name] : $default;
}
public function server($var_name, $default = '')
{
$super_global = phpbb_request_interface::SERVER;
$super_global = phpbb_request_request_interface::SERVER;
return isset($this->data[$super_global][$var_name]) ? $this->data[$super_global][$var_name] : $default;
}
@ -45,16 +45,16 @@ class phpbb_mock_request implements phpbb_request_interface
public function file($form_name)
{
$super_global = phpbb_request_interface::FILES;
$super_global = phpbb_request_request_interface::FILES;
return isset($this->data[$super_global][$form_name]) ? $this->data[$super_global][$form_name] : array();
}
public function is_set_post($name)
{
return $this->is_set($name, phpbb_request_interface::POST);
return $this->is_set($name, phpbb_request_request_interface::POST);
}
public function is_set($var, $super_global = phpbb_request_interface::REQUEST)
public function is_set($var, $super_global = phpbb_request_request_interface::REQUEST)
{
return isset($this->data[$super_global][$var]);
}
@ -69,7 +69,7 @@ class phpbb_mock_request implements phpbb_request_interface
return false;
}
public function variable_names($super_global = phpbb_request_interface::REQUEST)
public function variable_names($super_global = phpbb_request_request_interface::REQUEST)
{
return array_keys($this->data[$super_global]);
}
@ -79,10 +79,10 @@ class phpbb_mock_request implements phpbb_request_interface
public function set_header($header_name, $value)
{
$var_name = 'HTTP_' . str_replace('-', '_', strtoupper($header_name));
$this->data[phpbb_request_interface::SERVER][$var_name] = $value;
$this->data[phpbb_request_request_interface::SERVER][$var_name] = $value;
}
public function merge($super_global = phpbb_request_interface::REQUEST, $values)
public function merge($super_global = phpbb_request_request_interface::REQUEST, $values)
{
$this->data[$super_global] = array_merge($this->data[$super_global], $values);
}

View file

@ -16,7 +16,7 @@ class phpbb_deactivated_super_global_test extends phpbb_test_case
public function test_write_triggers_error()
{
$this->setExpectedTriggerError(E_USER_ERROR);
$obj = new phpbb_request_deactivated_super_global($this->getMock('phpbb_request_interface'), 'obj', phpbb_request_interface::POST);
$obj = new phpbb_request_deactivated_super_global($this->getMock('phpbb_request_request_interface'), 'obj', phpbb_request_request_interface::POST);
$obj->offsetSet(0, 0);
}
}

View file

@ -28,7 +28,7 @@ class phpbb_security_extract_current_page_test extends phpbb_security_test_base
{
global $request;
$request->merge(phpbb_request_interface::SERVER, array(
$request->merge(phpbb_request_request_interface::SERVER, array(
'PHP_SELF' => $url,
'QUERY_STRING' => $query_string,
));
@ -46,7 +46,7 @@ class phpbb_security_extract_current_page_test extends phpbb_security_test_base
{
global $request;
$request->merge(phpbb_request_interface::SERVER, array(
$request->merge(phpbb_request_request_interface::SERVER, array(
'PHP_SELF' => $url,
'QUERY_STRING' => $query_string,
));