Merge pull request #5846 from rubencm/ticket/19346

[ticket/16346] Small improvements
This commit is contained in:
Marc Alexander 2020-08-19 21:10:07 +02:00 committed by GitHub
commit cb3bd5528f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
310 changed files with 1467 additions and 1023 deletions

View file

@ -36,7 +36,7 @@
var j = 0;
<!-- BEGIN m_names -->
if (value == '{m_names.A_NAME}')
{
<!-- BEGIN modes -->
@ -60,13 +60,6 @@
<p>{L_EDIT_MODULE_EXPLAIN}</p>
<!-- IF S_ERROR -->
<div class="errorbox">
<h3>{L_WARNING}</h3>
<p>{ERROR_MSG}</p>
</div>
<!-- ENDIF -->
<form id="moduleedit" method="post" action="{U_EDIT_ACTION}">
<fieldset>
@ -111,7 +104,7 @@
<p class="submit-buttons">
<input type="hidden" name="action" value="{ACTION}" />
<input type="hidden" name="m" value="{MODULE_ID}" />
<input class="button1" type="submit" id="submit" name="submit" value="{L_SUBMIT}" />&nbsp;
<input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}" />
</p>
@ -125,13 +118,6 @@
<p>{L_ACP_MODULE_MANAGEMENT_EXPLAIN}</p>
<!-- IF S_ERROR -->
<div class="errorbox">
<h3>{L_WARNING}</h3>
<p>{ERROR_MSG}</p>
</div>
<!-- ENDIF -->
<table class="table1">
<tbody>
<tr>
@ -154,7 +140,7 @@
<span class="up"><a href="{modules.U_MOVE_UP}" data-ajax="row_up">{ICON_MOVE_UP}</a></span>
<span class="down-disabled" style="display:none;">{ICON_MOVE_DOWN_DISABLED}</span>
<span class="down"><a href="{modules.U_MOVE_DOWN}" data-ajax="row_down">{ICON_MOVE_DOWN}</a></span>
<a href="{modules.U_EDIT}">{ICON_EDIT}</a>
<a href="{modules.U_EDIT}">{ICON_EDIT}</a>
<a href="{modules.U_DELETE}" data-ajax="row_delete">{ICON_DELETE}</a>
</td>
</tr>
@ -173,7 +159,7 @@
<select name="quick_install">{S_INSTALL_OPTIONS}</select>
<input class="button2" name="quickadd" type="submit" value="{L_ADD_MODULE}" />
</fieldset>
</form>
<form id="module" method="post" action="{U_ACTION}">
@ -182,17 +168,17 @@
<input type="hidden" name="action" value="add" />
<input type="hidden" name="module_parent_id" value="{PARENT_ID}" />
<input type="text" name="module_langname" maxlength="255" />
<input type="text" name="module_langname" maxlength="255" />
<input class="button2" name="addmodule" type="submit" value="{L_CREATE_MODULE}" />
</fieldset>
</form>
<div class="clearfix">&nbsp;</div><br style="clear: both;" />
<form id="mselect" method="post" action="{U_SEL_ACTION}">
<fieldset class="quick">
{L_SELECT_MODULE}{L_COLON} <select name="parent_id" onchange="if(this.options[this.selectedIndex].value != -1){ this.form.submit(); }">{MODULE_BOX}</select>
{L_SELECT_MODULE}{L_COLON} <select name="parent_id" onchange="if(this.options[this.selectedIndex].value != -1){ this.form.submit(); }">{MODULE_BOX}</select>
<input class="button2" type="submit" value="{L_GO}" />
</fieldset>

View file

@ -32,7 +32,6 @@ services:
- '@config'
- '@files.upload'
- '@language'
- '@mimetype.guesser'
- '@dispatcher'
- '@plupload'
- '@storage.attachment'

View file

@ -19,10 +19,7 @@ services:
- '@config'
- '@dbal.conn'
- '@passwords.manager'
- '@request'
- '@user'
- '%core.root_path%'
- '%core.php_ext%'
tags:
- { name: auth.provider }

View file

@ -289,7 +289,6 @@ services:
class: phpbb\console\command\user\activate
arguments:
- '@user'
- '@dbal.conn'
- '@config'
- '@language'
- '@log'
@ -317,7 +316,6 @@ services:
class: phpbb\console\command\user\delete
arguments:
- '@user'
- '@dbal.conn'
- '@language'
- '@log'
- '@user_loader'

View file

@ -18,13 +18,11 @@ services:
class: phpbb\groupposition\legend
arguments:
- '@dbal.conn'
- '@user'
groupposition.teampage:
class: phpbb\groupposition\teampage
arguments:
- '@dbal.conn'
- '@user'
- '@cache.driver'
message.form.admin:

View file

@ -167,7 +167,6 @@ services:
class: phpbb\cron\task\text_reparser\reparser
arguments:
- '@config'
- '@config_text'
- '@text_reparser.lock'
- '@text_reparser.manager'
- '@text_reparser_collection'
@ -181,7 +180,6 @@ services:
class: phpbb\cron\task\text_reparser\reparser
arguments:
- '@config'
- '@config_text'
- '@text_reparser.lock'
- '@text_reparser.manager'
- '@text_reparser_collection'
@ -195,7 +193,6 @@ services:
class: phpbb\cron\task\text_reparser\reparser
arguments:
- '@config'
- '@config_text'
- '@text_reparser.lock'
- '@text_reparser.manager'
- '@text_reparser_collection'
@ -209,7 +206,6 @@ services:
class: phpbb\cron\task\text_reparser\reparser
arguments:
- '@config'
- '@config_text'
- '@text_reparser.lock'
- '@text_reparser.manager'
- '@text_reparser_collection'
@ -223,7 +219,6 @@ services:
class: phpbb\cron\task\text_reparser\reparser
arguments:
- '@config'
- '@config_text'
- '@text_reparser.lock'
- '@text_reparser.manager'
- '@text_reparser_collection'

View file

@ -21,7 +21,6 @@ services:
shared: false
arguments:
- '@language'
- '@php_ini'
- '@upload_imagesize'
- '@mimetype.guesser'
- '@plupload'
@ -30,7 +29,6 @@ services:
class: phpbb\files\upload
shared: false
arguments:
- '@filesystem'
- '@files.factory'
- '@language'
- '@php_ini'

View file

@ -44,11 +44,8 @@ services:
class: phpbb\db\migration\tool\module
arguments:
- '@dbal.conn'
- '@cache'
- '@user'
- '@module.manager'
- '%core.root_path%'
- '%core.php_ext%'
- '%tables.modules%'
tags:
- { name: migrator.tool }

View file

@ -9,7 +9,6 @@ services:
- '@dispatcher'
- '@language'
- '@log'
- '@request'
- '@template'
- '@profilefields.type_collection'
- '@user'

View file

@ -27,7 +27,6 @@ services:
arguments:
- '@installer.helper.config'
- '@installer.helper.database'
- '@filesystem'
- '%core.root_path%'
tags:
- { name: install_database_install, order: 30 }

View file

@ -41,7 +41,6 @@ services:
- '@installer.helper.iohandler'
- '@installer.file_updater.factory'
- '@installer.helper.update_helper'
- '%core.root_path%'
tags:
- { name: update_filesystem, order: 40 }

View file

@ -24,7 +24,7 @@ srand ((double) microtime() * 1000000);
set_time_limit(240*60);
// Here's the text we stick in posts..
$bigass_text = '
$bigass_text = '
phpBB BBCode test suite v0.0.2
auto-linkification:
http://something.com
@ -37,22 +37,22 @@ Simple code block with some <html> <tags>.
[b]bolded[/b], [i]italic[/i]
[email]james@totalgeek.org[/email]
[url=http://www.totalgeek.org]totalgeek.org[/url]
[url]www.totalgeek.org[/url]
[list]
[url]www.totalgeek.org[/url]
[list]
[*] This is the first bulleted item.
[*] This is the second bulleted item.
[/list]
[list=A]
[/list]
[list=A]
[*] This is the first bulleted item.
[*] This is the second bulleted item.
[/list]
[/list]
[quote]
And a quote!
[/quote]
';
// The script expects the ID's in the tables to sequential (1,2,3,4,5),
// The script expects the ID's in the tables to sequential (1,2,3,4,5),
// so no holes please (1,4,5,8)...
$nr_of_users = nrof(USERS_TABLE);
$nr_of_cats = nrof(CATEGORIES_TABLE);
@ -78,7 +78,7 @@ while($users > 0)
echo "status: $usercreationcount <br>\n";
flush();
}
}
if ($posts > 0)
@ -110,14 +110,14 @@ What do you want to create?<p>
</form>
<?php
}
else
}
else
{
list ($starttime_msec,$starttime_sec) = explode(" ",$starttime);
list ($endtime_msec,$endtime_sec) = explode(" ",$endtime);
$timetaken_sec = ($endtime_sec+$endtime_msec) - ($starttime_sec+$starttime_msec);
print "<B>TIME TAKEN : ".$timetaken_sec."s</B><BR>\n";
print "<B>TIME TAKEN : ".$timetaken_sec."s</B><BR>\n";
print "<p>\n<a href=\"$PHP_SELF\">Back to the overview page</a>\n";
}
@ -127,38 +127,38 @@ function filldb($newposts)
{
global $nr_of_forums;
global $nr_of_users;
$forum_topic_counts = array();
for ($i = 1; $i <= $nr_of_forums; $i++)
{
$forum_topic_counts[$i] = get_topic_count($i);
}
for($i = 0; $i < $newposts; $i++)
{
$userid = rand(2, $nr_of_users - 1);
$forum = rand(1,$nr_of_forums);
if ((rand(0,30) < 1) || ($forum_topic_count[$forum] == 0))
if ((rand(0,30) < 1) || ($forum_topic_counts[$forum] == 0))
{
// create a new topic 1 in 30 times (or when there are none);
make_topic($userid, "Testing topic $i", $forum);
$forum_topic_count[$forum]++;
}
else
$forum_topic_counts[$forum]++;
}
else
{
// Otherwise create a reply(posting) somewhere.
$topic = get_smallest_topic($forum);
create_posting($userid, $topic, $forum, "reply");
}
if (($i % 1000) == 0)
{
echo "status: $i <br>";
flush();
}
}
}
@ -166,7 +166,7 @@ function filldb($newposts)
function get_smallest_topic($forum_id)
{
global $db;
$sql = "SELECT topic_id
FROM " . TOPICS_TABLE . "
WHERE (forum_id = $forum_id)
@ -184,14 +184,14 @@ function get_smallest_topic($forum_id)
{
message_die(GENERAL_ERROR, "Couldn't get smallest topic.", "", __LINE__, __FILE__, $sql);
}
}
function get_topic_count($forum_id)
{
global $db;
$sql = "SELECT forum_topics_approved
FROM " . FORUMS_TABLE . "
WHERE (forum_id = $forum_id)";
@ -208,7 +208,7 @@ function get_topic_count($forum_id)
{
message_die(GENERAL_ERROR, "Couldn't get topic count.", "", __LINE__, __FILE__, $sql);
}
}
@ -218,7 +218,7 @@ function make_topic($user_id, $subject, $forum_id)
$topic_type = POST_NORMAL;
$topic_vote = 0;
$current_time = time();
$sql = "INSERT INTO " . TOPICS_TABLE . " (topic_title, topic_poster, topic_time, forum_id, topic_status, topic_type, topic_vote)
VALUES ('$subject', $user_id, $current_time, $forum_id, " . TOPIC_UNLOCKED . ", $topic_type, $topic_vote)";
@ -230,9 +230,9 @@ function make_topic($user_id, $subject, $forum_id)
{
message_die(GENERAL_ERROR, "Error inserting data into topics table", "", __LINE__, __FILE__, $sql);
}
create_posting($user_id, $new_topic_id, $forum_id);
return $new_topic_id;
}
@ -258,19 +258,19 @@ function make_post($new_topic_id, $forum_id, $user_id, $post_username, $text, $m
$smilies_on = 1;
$attach_sig = 1;
$bbcode_uid = make_bbcode_uid();
$post_subject = 'random subject';
$post_message = prepare_message($text, $html_on, $bbcode_on, $smilies_on, $bbcode_uid);
$post_message = prepare_message($text, $html_on, $bbcode_on, $smilies_on, $bbcode_uid);
$sql = "INSERT INTO " . POSTS_TABLE . " (topic_id, forum_id, poster_id, attach_id, icon_id, post_username, post_time, poster_ip, post_visibility, bbcode_uid, enable_bbcode, enable_html, enable_smilies, enable_sig, post_subject, post_text)
VALUES ($new_topic_id, $forum_id, $user_id, 0, 0, '$post_username', $current_time, '$user_ip', 1, '$bbcode_uid', $bbcode_on, $html_on, $smilies_on, $attach_sig, '$post_subject', '$post_message')";
$result = $db->sql_query($sql);
if ($result)
{
$new_post_id = $db->sql_nextid();
$sql = "UPDATE " . TOPICS_TABLE . "
SET topic_last_post_id = $new_post_id";
if($mode == "reply")
@ -288,13 +288,13 @@ function make_post($new_topic_id, $forum_id, $user_id, $post_username, $text, $m
$sql .= ", forum_topics_approved = forum_topics_approved + 1";
}
$sql .= " WHERE forum_id = $forum_id";
if($db->sql_query($sql))
{
$sql = "UPDATE " . USERS_TABLE . "
SET user_posts = user_posts + 1
WHERE user_id = " . $user_id;
if($db->sql_query($sql, END_TRANSACTION))
{
// SUCCESS.
@ -325,7 +325,7 @@ function make_post($new_topic_id, $forum_id, $user_id, $post_username, $text, $m
else
{
message_die(GENERAL_ERROR, "Error inserting data into posts table", "", __LINE__, __FILE__, $sql);
}
}
}
@ -334,9 +334,10 @@ function generatepost($size=850)
global $bigass_text;
// Returns a string with a length between $size and $size*0.2
$size = rand(0.2*$size, $size);
$textsize = strlen($bigass_text);
$currentsize = 0;
$message = '';
// Add whole $text multiple times
while($currentsize < $size && $size-$currentsize <= $textsize)
{
@ -348,8 +349,8 @@ function generatepost($size=850)
return (addslashes($message));
}
function nrof($table)
{
global $db;
@ -417,9 +418,9 @@ function make_user($username)
$sql = "INSERT INTO " . USERS_TABLE . " (user_id, username, user_regdate, user_password, user_email, user_sig, user_sig_bbcode_uid, user_avatar, user_viewemail, user_attachsig, user_allowsmilies, user_allowhtml, user_allowbbcode, user_allow_viewonline, user_notify, user_notify_pm, user_timezone, user_dateformat, user_lang, user_style, user_level, user_allow_pm, user_active, user_actkey)
VALUES ($new_user_id, '$username', " . time() . ", '$password', '$email', '$signature', '$signature_bbcode_uid', '$avatar_filename', $viewemail, $attachsig, $allowsmilies, $allowhtml, $allowbbcode, $allowviewonline, $notifyreply, $notifypm, $user_timezone, '$user_dateformat', '$user_lang', $user_style, 0, 1, ";
$sql .= "1, '')";
if($result = $db->sql_query($sql, BEGIN_TRANSACTION))
{
$sql = "INSERT INTO " . GROUPS_TABLE . " (group_id, group_name, group_description, group_single_user, group_moderator)
@ -430,7 +431,7 @@ function make_user($username)
VALUES ($new_user_id, $new_group_id, 0)";
if($result = $db->sql_query($sql, END_TRANSACTION))
{
// SUCCESS.
return true;
}

View file

@ -2,7 +2,7 @@
/*
Converts imageset to CSS code
Change style name and path below, open in browser.
*/
@ -145,8 +145,6 @@ for ($i=0; $i<count($list); $i++)
}
echo ob_get_clean();
return;
/*
Functions
@ -155,7 +153,7 @@ function get_imageset($path, $lang = '')
{
$cfg = $path . ($lang ? '/' . $lang : '') . '/imageset.cfg';
if (!@file_exists($cfg))
{
{
return false;
}
$data = file($cfg);
@ -163,12 +161,12 @@ function get_imageset($path, $lang = '')
for ($i=0; $i<count($data); $i++)
{
$str = trim($data[$i]);
if (substr($str, 0, 4) != 'img_')
if (substr($str, 0, 4) != 'img_')
{
continue;
}
$list = explode('=', $data[$i]);
if (count($list) != 2)
if (count($list) != 2)
{
continue;
}
@ -371,4 +369,3 @@ function css($list, $path = './', $bidi = false)
}
return $code;
}

View file

@ -36,13 +36,13 @@ include($phpbb_root_path . 'db/' . $dbms . '.'.$phpEx);
$cache = new acm();
$db = new sql_db($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false);
// Just Do it (tm)
// Just Do it (tm)
$sql = "RENAME TABLE {$table_prefix}posts TO {$table_prefix}posts_temp";
$db->sql_query($sql);
$sql = "CREATE TABLE {$table_prefix}posts
SELECT p.*, pt.post_subject, pt.post_text, pt.post_checksum, pt.bbcode_bitfield, pt.bbcode_uid
FROM {$table_prefix}posts_temp p, {$table_prefix}posts_text pt
$sql = "CREATE TABLE {$table_prefix}posts
SELECT p.*, pt.post_subject, pt.post_text, pt.post_checksum, pt.bbcode_bitfield, pt.bbcode_uid
FROM {$table_prefix}posts_temp p, {$table_prefix}posts_text pt
WHERE pt.post_id = p.post_id";
$db->sql_query($sql);
@ -50,13 +50,13 @@ switch ($db->get_sql_layer())
{
case 'mysql':
case 'mysql4':
$sql = 'ALTER TABLE ' . $table_prefix . 'posts
ADD PRIMARY KEY (post_id),
ADD INDEX topic_id (topic_id),
ADD INDEX poster_ip (poster_ip),
ADD INDEX post_visibility (post_visibility),
MODIFY COLUMN post_id mediumint(8) UNSIGNED NOT NULL auto_increment,
ADD COLUMN post_encoding varchar(11) DEFAULT \'iso-8859-15\' NOT NULL';
$sql = 'ALTER TABLE ' . $table_prefix . 'posts
ADD PRIMARY KEY (post_id),
ADD INDEX topic_id (topic_id),
ADD INDEX poster_ip (poster_ip),
ADD INDEX post_visibility (post_visibility),
MODIFY COLUMN post_id mediumint(8) UNSIGNED NOT NULL auto_increment,
ADD COLUMN post_encoding varchar(11) DEFAULT \'iso-8859-15\' NOT NULL';
break;
case 'mssql':
@ -78,9 +78,9 @@ $db->sql_query($sql);
$sql = "UPDATE {$table_prefix}users SET user_id = 1 WHERE user_id = 0";
$db->sql_query($sql);
$sql = "SELECT t.topic_id
FROM {$table_prefix}topics t
LEFT JOIN {$table_prefix}posts p ON p.topic_id = t.topic_id
$sql = "SELECT t.topic_id
FROM {$table_prefix}topics t
LEFT JOIN {$table_prefix}posts p ON p.topic_id = t.topic_id
WHERE p.topic_id IS NULL";
$result = $db->sql_query($sql);
@ -93,15 +93,15 @@ if ($row = $db->sql_fetchrow($result))
}
while ($row = $db->sql_fetchrow($result));
$sql = "DELETE FROM {$table_prefix}topics
$sql = "DELETE FROM {$table_prefix}topics
WHERE topic_id IN ($del_sql)";
$db->sql_query($sql);
}
$db->sql_freeresult($result);
$del_sql = '';
$sql = "SELECT topic_id, MIN(post_id) AS first_post_id, MAX(post_id) AS last_post_id, COUNT(post_id) AS total_posts
FROM {$table_prefix}posts
$sql = "SELECT topic_id, MIN(post_id) AS first_post_id, MAX(post_id) AS last_post_id, COUNT(post_id) AS total_posts
FROM {$table_prefix}posts
GROUP BY topic_id";
$result = $db->sql_query($sql);
@ -109,7 +109,7 @@ while ($row = $db->sql_fetchrow($result))
{
$del_sql .= (($del_sql != '') ? ', ' : '') . $row['topic_id'];
$sql = "UPDATE {$table_prefix}topics
$sql = "UPDATE {$table_prefix}topics
SET topic_first_post_id = " . $row['first_post_id'] . ", topic_last_post_id = " . $row['last_post_id'] . ", topic_replies = " . ($row['total_posts'] - 1) . "
WHERE topic_id = " . $row['topic_id'];
$db->sql_query($sql);
@ -120,8 +120,8 @@ $sql = "DELETE FROM {$table_prefix}topics WHERE topic_id NOT IN ($del_sql)";
$db->sql_query($sql);
$topic_count = $post_count = array();
$sql = "SELECT forum_id, COUNT(topic_id) AS topics
FROM {$table_prefix}topics
$sql = "SELECT forum_id, COUNT(topic_id) AS topics
FROM {$table_prefix}topics
GROUP BY forum_id";
$result = $db->sql_query($sql);
@ -131,8 +131,8 @@ while ($row = $db->sql_fetchrow($result))
}
$db->sql_freeresult($result);
$sql = "SELECT forum_id, COUNT(post_id) AS posts
FROM {$table_prefix}posts
$sql = "SELECT forum_id, COUNT(post_id) AS posts
FROM {$table_prefix}posts
GROUP BY forum_id";
$result = $db->sql_query($sql);
@ -166,13 +166,13 @@ while ($row = $db->sql_fetchrow($result))
$forum_id = $row['forum_id'];
$sql_ary[] = "UPDATE " . $table_prefix . "forums
SET forum_last_poster_id = " . ((!empty($row['user_id']) && $row['user_id'] != ANONYMOUS) ? $row['user_id'] : ANONYMOUS) . ", forum_last_poster_name = '" . ((!empty($row['user_id']) && $row['user_id'] != ANONYMOUS) ? addslashes($row['username']) : addslashes($row['post_username'])) . "', forum_last_post_time = " . $row['post_time'] . ", forum_posts_approved = " . (($post_count[$forum_id]) ? $post_count[$forum_id] : 0) . ", forum_topics_approved = " . (($topic_count[$forum_id]) ? $topic_count[$forum_id] : 0) . "
SET forum_last_poster_id = " . ((!empty($row['user_id']) && $row['user_id'] != ANONYMOUS) ? $row['user_id'] : ANONYMOUS) . ", forum_last_poster_name = '" . ((!empty($row['user_id']) && $row['user_id'] != ANONYMOUS) ? addslashes($row['username']) : addslashes($row['post_username'])) . "', forum_last_post_time = " . $row['post_time'] . ", forum_posts_approved = " . (($post_count[$forum_id]) ? $post_count[$forum_id] : 0) . ", forum_topics_approved = " . (($topic_count[$forum_id]) ? $topic_count[$forum_id] : 0) . "
WHERE forum_id = $forum_id";
$sql = "SELECT t.topic_id, u.username, u.user_id, u2.username as user2, u2.user_id as id2, p.post_username, p2.post_username AS post_username2, p2.post_time
FROM " . $table_prefix . "topics t, " . $table_prefix . "users u, " . $table_prefix . "posts p, " . $table_prefix . "posts p2, " . $table_prefix . "users u2
WHERE t.forum_id = $forum_id
AND u.user_id = t.topic_poster
WHERE t.forum_id = $forum_id
AND u.user_id = t.topic_poster
AND p.post_id = t.topic_first_post_id
AND p2.post_id = t.topic_last_post_id
AND u2.user_id = p2.poster_id";
@ -192,7 +192,7 @@ $db->sql_freeresult($result);
foreach ($sql_ary as $sql)
{
$sql . "<br />";
echo $sql . "<br />";
$db->sql_query($sql);
}

View file

@ -335,7 +335,7 @@ class acp_styles
$uninstalled = array();
foreach ($rows as $style)
{
$result = $this->uninstall_style($style, $delete_files);
$result = $this->uninstall_style($style);
if (is_string($result))
{

View file

@ -33,6 +33,8 @@ class bbcode
var $template_bitfield;
protected $template_filename;
/**
* Constructor
*/
@ -149,7 +151,7 @@ class bbcode
*/
function bbcode_cache_init()
{
global $user, $phpbb_dispatcher, $phpbb_extension_manager, $phpbb_container, $phpbb_filesystem;
global $user, $phpbb_dispatcher, $phpbb_extension_manager, $phpbb_container;
if (empty($this->template_filename))
{

View file

@ -61,7 +61,6 @@ define('ACL_YES', 1);
define('ACL_NO', -1);
// Login error codes
define('LOGIN_CONTINUE', 1);
define('LOGIN_BREAK', 2);
define('LOGIN_SUCCESS', 3);
define('LOGIN_SUCCESS_CREATE_PROFILE', 20);
@ -121,10 +120,6 @@ define('POST_STICKY', 1);
define('POST_ANNOUNCE', 2);
define('POST_GLOBAL', 3);
// Lastread types
define('TRACK_NORMAL', 0);
define('TRACK_POSTED', 1);
// Notify methods
define('NOTIFY_EMAIL', 0);
define('NOTIFY_IM', 1);

View file

@ -915,7 +915,7 @@ function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $
/**
* Get topic tracking info by using already fetched info
*/
function get_topic_tracking($forum_id, $topic_ids, &$rowset, $forum_mark_time, $global_announce_list = false)
function get_topic_tracking($forum_id, $topic_ids, &$rowset, $forum_mark_time)
{
global $user;
@ -959,7 +959,7 @@ function get_topic_tracking($forum_id, $topic_ids, &$rowset, $forum_mark_time, $
/**
* Get topic tracking info from db (for cookie based tracking only this function is used)
*/
function get_complete_topic_tracking($forum_id, $topic_ids, $global_announce_list = false)
function get_complete_topic_tracking($forum_id, $topic_ids)
{
global $config, $user, $request;
@ -3216,8 +3216,6 @@ function msg_handler($errno, $msg_text, $errfile, $errline)
*/
function phpbb_filter_root_path($errfile)
{
global $phpbb_filesystem;
static $root_path;
if (empty($root_path))
@ -4098,25 +4096,6 @@ function page_header($page_title = '', $display_online_list = false, $item_id =
return;
}
/**
* Check and display the SQL report if requested.
*
* @param \phpbb\request\request_interface $request Request object
* @param \phpbb\auth\auth $auth Auth object
* @param \phpbb\db\driver\driver_interface $db Database connection
*
* @deprecated 3.3.1 (To be removed: 4.0.0-a1); use controller helper's display_sql_report()
*/
function phpbb_check_and_display_sql_report(\phpbb\request\request_interface $request, \phpbb\auth\auth $auth, \phpbb\db\driver\driver_interface $db)
{
global $phpbb_container;
/** @var \phpbb\controller\helper $controller_helper */
$controller_helper = $phpbb_container->get('controller.helper');
$controller_helper->display_sql_report();
}
/**
* Generate the debug output string
*
@ -4316,19 +4295,6 @@ function exit_handler()
exit;
}
/**
* Casts a numeric string $input to an appropriate numeric type (i.e. integer or float)
*
* @param string $input A numeric string.
*
* @return int|float Integer $input if $input fits integer,
* float $input otherwise.
*/
function phpbb_to_numeric($input)
{
return ($input > PHP_INT_MAX) ? (float) $input : (int) $input;
}
/**
* Get the board contact details (e.g. for emails)
*

View file

@ -152,8 +152,11 @@ function adm_page_header($page_title)
function adm_page_footer($copyright_html = true)
{
global $db, $config, $template, $user, $auth;
global $phpbb_root_path;
global $request, $phpbb_dispatcher;
global $phpbb_root_path, $phpbb_container;
global $phpbb_dispatcher;
/** @var \phpbb\controller\helper $controller_helper */
$controller_helper = $phpbb_container->get('controller.helper');
// A listener can set this variable to `true` when it overrides this function
$adm_page_footer_override = false;
@ -175,7 +178,7 @@ function adm_page_footer($copyright_html = true)
return;
}
phpbb_check_and_display_sql_report($request, $auth, $db);
$controller_helper->display_sql_report();
$template->assign_vars(array(
'DEBUG_OUTPUT' => phpbb_generate_debug_output($db, $config, $auth, $user, $phpbb_dispatcher),
@ -707,6 +710,7 @@ function validate_range($value_ary, &$error)
/**
* Inserts new config display_vars into an exisiting display_vars array
* at the given position.
* Used by extensions.
*
* @param array $display_vars An array of existing config display vars
* @param array $add_config_vars An array of new config display vars

View file

@ -978,7 +978,7 @@ function delete_posts($where_type, $where_ids, $auto_sync = true, $posted_sync =
}
$approved_posts = 0;
$post_ids = $topic_ids = $forum_ids = $post_counts = $remove_topics = array();
$post_ids = $poster_ids = $topic_ids = $forum_ids = $post_counts = $remove_topics = array();
$sql = 'SELECT post_id, poster_id, post_visibility, post_postcount, topic_id, forum_id
FROM ' . POSTS_TABLE . '
@ -1518,7 +1518,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false,
// $post_reported should be empty by now, if it's not it contains
// posts that are falsely flagged as reported
foreach ($post_reported as $post_id => $void)
foreach (array_keys($post_reported) as $post_id)
{
$post_ids[] = $post_id;
}
@ -1623,7 +1623,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false,
// $post_attachment should be empty by now, if it's not it contains
// posts that are falsely flagged as having attachments
foreach ($post_attachment as $post_id => $void)
foreach (array_keys($post_attachment) as $post_id)
{
$post_ids[] = $post_id;
}
@ -1696,7 +1696,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false,
$where_sql";
$result = $db->sql_query($sql);
$forum_data = $forum_ids = $post_ids = $last_post_id = $post_info = array();
$forum_data = $forum_ids = $post_ids = $post_info = array();
while ($row = $db->sql_fetchrow($result))
{
if ($row['forum_type'] == FORUM_LINK)
@ -2031,7 +2031,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false,
if (count($delete_topics))
{
$delete_topic_ids = array();
foreach ($delete_topics as $topic_id => $void)
foreach (array_keys($delete_topics) as $topic_id)
{
unset($topic_data[$topic_id]);
$delete_topic_ids[] = $topic_id;
@ -2605,7 +2605,7 @@ function phpbb_cache_moderators($db, $cache, $auth)
* @param mixed $forum_id Restrict the log entries to the given forum_id (can also be an array of forum_ids)
* @param int $topic_id Restrict the log entries to the given topic_id
* @param int $user_id Restrict the log entries to the given user_id
* @param int $log_time Only get log entries newer than the given timestamp
* @param int $limit_days Only get log entries newer than the given timestamp
* @param string $sort_by SQL order option, e.g. 'l.log_time DESC'
* @param string $keywords Will only return log entries that have the keywords in log_operation or log_data
*

View file

@ -847,3 +847,37 @@ function phpbb_delete_user_pms($user_id)
return phpbb_delete_users_pms(array($user_id));
}
/**
* Casts a numeric string $input to an appropriate numeric type (i.e. integer or float)
*
* @param string $input A numeric string.
*
* @return int|float Integer $input if $input fits integer,
* float $input otherwise.
*
* @deprecated 3.2.10 (To be removed 4.0.0)
*/
function phpbb_to_numeric($input)
{
return ($input > PHP_INT_MAX) ? (float) $input : (int) $input;
}
/**
* Check and display the SQL report if requested.
*
* @param \phpbb\request\request_interface $request Request object
* @param \phpbb\auth\auth $auth Auth object
* @param \phpbb\db\driver\driver_interface $db Database connection
*
* @deprecated 3.3.1 (To be removed: 4.0.0-a1); use controller helper's display_sql_report()
*/
function phpbb_check_and_display_sql_report(\phpbb\request\request_interface $request, \phpbb\auth\auth $auth, \phpbb\db\driver\driver_interface $db)
{
global $phpbb_container;
/** @var \phpbb\controller\helper $controller_helper */
$controller_helper = $phpbb_container->get('controller.helper');
$controller_helper->display_sql_report();
}

View file

@ -320,7 +320,7 @@ function bump_topic_allowed($forum_id, $topic_bumped, $last_post_time, $topic_po
* Generates a text with approx. the specified length which contains the specified words and their context
*
* @param string $text The full text from which context shall be extracted
* @param string $words An array of words which should be contained in the result, has to be a valid part of a PCRE pattern (escape with preg_quote!)
* @param array $words An array of words which should be contained in the result, has to be a valid part of a PCRE pattern (escape with preg_quote!)
* @param int $length The desired length of the resulting text, however the result might be shorter or longer than this value
*
* @return string Context of the specified words separated by "..."
@ -845,7 +845,6 @@ function make_clickable_callback($type, $whitespace, $url, $relative_url, $class
$relative_url = substr($relative_url, 0, $split);
}
}
// if the last character of the url is a punctuation mark, exclude it from the url
$last_char = ($relative_url) ? $relative_url[strlen($relative_url) - 1] : $url[strlen($url) - 1];
@ -1344,7 +1343,7 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count_a
preg_match_all('#<!\-\- ia([0-9]+) \-\->(.*?)<!\-\- ia\1 \-\->#', $message, $matches, PREG_PATTERN_ORDER);
$replace = array();
foreach ($matches[0] as $num => $capture)
foreach (array_keys($matches[0]) as $num)
{
$index = $matches[1][$num];

View file

@ -767,7 +767,7 @@ function generate_forum_nav(&$forum_data_ary)
return;
}
$navlinks_parents = $forum_template_data = array();
$navlinks_parents = array();
// Get forum parents
$forum_parents = get_forum_parents($forum_data_ary);

View file

@ -535,7 +535,6 @@ function phpbb_mcp_sorting($mode, &$sort_days_val, &$sort_key_val, &$sort_dir_va
$sort_key_val = $request->variable('sk', $default_key);
$sort_dir_val = $request->variable('sd', $default_dir);
$sort_dir_text = array('a' => $user->lang['ASCENDING'], 'd' => $user->lang['DESCENDING']);
switch ($type)
{
@ -680,11 +679,11 @@ function phpbb_mcp_sorting($mode, &$sort_days_val, &$sort_key_val, &$sort_dir_va
/**
* Validate ids
*
* @param array &$ids The relevant ids to check
* @param string $table The table to find the ids in
* @param string $sql_id The ids relevant column name
* @param array $acl_list A list of permissions the user need to have
* @param mixed $singe_forum Limit to one forum id (int) or the first forum found (true)
* @param array &$ids The relevant ids to check
* @param string $table The table to find the ids in
* @param string $sql_id The ids relevant column name
* @param array|false $acl_list A list of permissions the user need to have
* @param mixed $single_forum Limit to one forum id (int) or the first forum found (true)
*
* @return mixed False if no ids were able to be retrieved, true if at least one id left.
* Additionally, this value can be the forum_id assigned if $single_forum was set.

View file

@ -469,7 +469,7 @@ class messenger
$domain = ($config['server_name']) ?: $request->server('SERVER_NAME', 'phpbb.generated');
return md5(unique_id(time())) . '@' . $domain;
return md5(unique_id()) . '@' . $domain;
}
/**

View file

@ -327,7 +327,7 @@ function update_post_information($type, $ids, $return_update_sql = false)
{
$empty_forums = array_merge($empty_forums, array_diff($ids, $not_empty_forums));
foreach ($empty_forums as $void => $forum_id)
foreach ($empty_forums as $forum_id)
{
$update_sql[$forum_id][] = 'forum_last_post_id = 0';
$update_sql[$forum_id][] = "forum_last_post_subject = ''";
@ -838,7 +838,7 @@ function load_drafts($topic_id = 0, $forum_id = 0, $id = 0, $pm_action = '', $ms
global $user, $db, $template, $auth;
global $phpbb_root_path, $phpbb_dispatcher, $phpEx;
$topic_ids = $forum_ids = $draft_rows = array();
$topic_ids = $draft_rows = array();
// Load those drafts not connected to forums/topics
// If forum_id == 0 AND topic_id == 0 then this is a PM draft
@ -1619,7 +1619,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll_ary, &$data
$data_ary['topic_title'] = truncate_string($data_ary['topic_title'], 120);
// Collect some basic information about which tables and which rows to update/insert
$sql_data = $topic_row = array();
$sql_data = array();
$poster_id = ($mode == 'edit') ? $data_ary['poster_id'] : (int) $user->data['user_id'];
// Retrieve some additional information if not present
@ -2098,7 +2098,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll_ary, &$data
$space_taken = $files_added = 0;
$orphan_rows = array();
foreach ($data_ary['attachment_data'] as $pos => $attach_row)
foreach ($data_ary['attachment_data'] as $attach_row)
{
$orphan_rows[(int) $attach_row['attach_id']] = array();
}
@ -2120,7 +2120,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll_ary, &$data
$db->sql_freeresult($result);
}
foreach ($data_ary['attachment_data'] as $pos => $attach_row)
foreach ($data_ary['attachment_data'] as $attach_row)
{
if ($attach_row['is_orphan'] && !isset($orphan_rows[$attach_row['attach_id']]))
{

View file

@ -455,7 +455,7 @@ function place_pm_into_folder(&$global_privmsgs_rules, $release = false)
}
else
{
$user_rules = $zebra = $check_rows = array();
$zebra = $check_rows = array();
$user_ids = $memberships = array();
// First of all, grab all rules and retrieve friends/foes
@ -551,7 +551,7 @@ function place_pm_into_folder(&$global_privmsgs_rules, $release = false)
// It is allowed to execute actions more than once, except placing messages into folder
$folder_action = $message_removed = false;
foreach ($msg_ary as $pos => $rule_ary)
foreach ($msg_ary as $rule_ary)
{
if ($folder_action && $rule_ary['action'] == ACTION_PLACE_INTO_FOLDER)
{
@ -1598,7 +1598,7 @@ function get_folder_status($folder_id, $folder)
*/
function submit_pm($mode, $subject, &$data_ary, $put_in_outbox = true)
{
global $db, $auth, $config, $user, $phpbb_root_path, $phpbb_container, $phpbb_dispatcher, $request;
global $db, $auth, $config, $user, $phpbb_container, $phpbb_dispatcher, $request;
$attachment_storage = $phpbb_container->get('storage.attachment');
@ -1827,7 +1827,7 @@ function submit_pm($mode, $subject, &$data_ary, $put_in_outbox = true)
$space_taken = $files_added = 0;
$orphan_rows = array();
foreach ($data_ary['attachment_data'] as $pos => $attach_row)
foreach ($data_ary['attachment_data'] as $attach_row)
{
$orphan_rows[(int) $attach_row['attach_id']] = array();
}
@ -1850,7 +1850,7 @@ function submit_pm($mode, $subject, &$data_ary, $put_in_outbox = true)
$db->sql_freeresult($result);
}
foreach ($data_ary['attachment_data'] as $pos => $attach_row)
foreach ($data_ary['attachment_data'] as $attach_row)
{
if ($attach_row['is_orphan'] && !isset($orphan_rows[$attach_row['attach_id']]))
{

View file

@ -180,7 +180,7 @@ function user_update_name($old_name, $new_name)
* @param mixed $user_row An array containing the following keys (and the appropriate values): username, group_id (the group to place the user in), user_email and the user_type(usually 0). Additional entries not overridden by defaults will be forwarded.
* @param array $cp_data custom profile fields, see custom_profile::build_insert_sql_array
* @param array $notifications_data The notifications settings for the new user
* @return the new user's ID.
* @return int The new user's ID.
*/
function user_add($user_row, $cp_data = false, $notifications_data = null)
{
@ -1610,7 +1610,8 @@ function validate_num($num, $optional = false, $min = 0, $max = 1E99)
/**
* Validate Date
* @param String $string a date in the dd-mm-yyyy format
* @param string $date_string a date in the dd-mm-yyyy format
* @param bool $optional
* @return boolean
*/
function validate_date($date_string, $optional = false)
@ -1646,7 +1647,6 @@ function validate_date($date_string, $optional = false)
return false;
}
/**
* Validate Match
*
@ -2216,7 +2216,7 @@ function phpbb_style_is_active($style_id)
*/
function avatar_delete($mode, $row, $clean_db = false)
{
global $config, $phpbb_container;
global $phpbb_container;
$storage = $phpbb_container->get('storage.avatar');
@ -2576,7 +2576,7 @@ function group_correct_avatar($group_id, $old_entry)
try
{
$this->storage->rename($old_filename, $new_filename);
$storage->rename($old_filename, $new_filename);
$sql = 'UPDATE ' . GROUPS_TABLE . '
SET group_avatar = \'' . $db->sql_escape($new_entry) . "'

View file

@ -29,8 +29,6 @@ if (version_compare(PHP_VERSION, '7.1.3', '<'))
{
die('You are running an unsupported PHP version. Please upgrade to PHP 7.1.3 or higher before trying to install or update to phpBB 3.3');
}
// Register globals and magic quotes have been dropped in PHP 5.4 so no need for extra checks
// In PHP 5.3.0 the error level has been raised to E_WARNING which causes problems
// because we show E_WARNING errors and do not set a default timezone.

View file

@ -81,7 +81,6 @@ switch ($mode)
login_box('', ((isset($user->lang['LOGIN_EXPLAIN_' . strtoupper($mode)])) ? $user->lang['LOGIN_EXPLAIN_' . strtoupper($mode)] : $user->lang['LOGIN_EXPLAIN_MEMBERLIST']));
}
break;
}
/** @var \phpbb\group\helper $group_helper */

View file

@ -18,7 +18,6 @@ use \phpbb\cache\service;
use \phpbb\config\config;
use \phpbb\event\dispatcher;
use \phpbb\language\language;
use \phpbb\mimetype\guesser;
use \phpbb\plupload\plupload;
use \phpbb\storage\storage;
use \phpbb\filesystem\temp;
@ -44,9 +43,6 @@ class upload
/** @var language */
protected $language;
/** @var guesser Mimetype guesser */
protected $mimetype_guesser;
/** @var dispatcher */
protected $phpbb_dispatcher;
@ -62,7 +58,7 @@ class upload
/** @var user */
protected $user;
/** @var \phpbb\files\filespec Current filespec instance */
/** @var \phpbb\files\filespec_storage Current filespec instance */
private $file;
/** @var array File data */
@ -81,21 +77,19 @@ class upload
* @param config $config
* @param \phpbb\files\upload $files_upload
* @param language $language
* @param guesser $mimetype_guesser
* @param dispatcher $phpbb_dispatcher
* @param plupload $plupload
* @param storage $storage
* @param temp $temp
* @param user $user
*/
public function __construct(auth $auth, service $cache, config $config, \phpbb\files\upload $files_upload, language $language, guesser $mimetype_guesser, dispatcher $phpbb_dispatcher, plupload $plupload, storage $storage, temp $temp, user $user)
public function __construct(auth $auth, service $cache, config $config, \phpbb\files\upload $files_upload, language $language, dispatcher $phpbb_dispatcher, plupload $plupload, storage $storage, temp $temp, user $user)
{
$this->auth = $auth;
$this->cache = $cache;
$this->config = $config;
$this->files_upload = $files_upload;
$this->language = $language;
$this->mimetype_guesser = $mimetype_guesser;
$this->phpbb_dispatcher = $phpbb_dispatcher;
$this->plupload = $plupload;
$this->storage = $storage;
@ -233,8 +227,6 @@ class upload
/**
* Create thumbnail for file if necessary
*
* @return array Updated $filedata
*/
protected function create_thumbnail()
{

View file

@ -95,8 +95,6 @@ class auth
$this->acl_cache($userdata);
$this->_fill_acl($userdata['user_permissions']);
}
return;
}
/**
@ -213,7 +211,7 @@ class auth
* @param bool $clean set to true if only values needs to be returned which are set/unset
*
* @return array Contains the forum ids with the specified permission set to true.
This is a nested array: array => forum_id => permission => true
* This is a nested array: array => forum_id => permission => true
*/
function acl_getf($opt, $clean = false)
{
@ -524,19 +522,19 @@ class auth
ORDER BY role_id ASC';
$result = $db->sql_query($sql);
$this->role_cache = array();
$role_cache = array();
while ($row = $db->sql_fetchrow($result))
{
$this->role_cache[$row['role_id']][$row['auth_option_id']] = (int) $row['auth_setting'];
$role_cache[$row['role_id']][$row['auth_option_id']] = (int) $row['auth_setting'];
}
$db->sql_freeresult($result);
foreach ($this->role_cache as $role_id => $role_options)
foreach ($role_cache as $role_id => $role_options)
{
$this->role_cache[$role_id] = serialize($role_options);
$role_cache[$role_id] = serialize($role_options);
}
$cache->put('_role_cache', $this->role_cache);
$cache->put('_role_cache', $role_cache);
// Now empty user permissions
$where_sql = '';
@ -562,8 +560,6 @@ class auth
*/
$vars = array('user_id');
extract($phpbb_dispatcher->trigger_event('core.acl_clear_prefetch_after', compact($vars)));
return;
}
/**
@ -828,9 +824,9 @@ class auth
global $db, $cache;
// Check if the role-cache is there
if (($this->role_cache = $cache->get('_role_cache')) === false)
if (($role_cache = $cache->get('_role_cache')) === false)
{
$this->role_cache = array();
$role_cache = array();
// We pre-fetch roles
$sql = 'SELECT *
@ -840,16 +836,16 @@ class auth
while ($row = $db->sql_fetchrow($result))
{
$this->role_cache[$row['role_id']][$row['auth_option_id']] = (int) $row['auth_setting'];
$role_cache[$row['role_id']][$row['auth_option_id']] = (int) $row['auth_setting'];
}
$db->sql_freeresult($result);
foreach ($this->role_cache as $role_id => $role_options)
foreach ($role_cache as $role_id => $role_options)
{
$this->role_cache[$role_id] = serialize($role_options);
$role_cache[$role_id] = serialize($role_options);
}
$cache->put('_role_cache', $this->role_cache);
$cache->put('_role_cache', $role_cache);
}
$hold_ary = array();
@ -865,7 +861,7 @@ class auth
// If a role is assigned, assign all options included within this role. Else, only set this one option.
if ($row['auth_role_id'])
{
$hold_ary[$row['forum_id']] = (empty($hold_ary[$row['forum_id']])) ? unserialize($this->role_cache[$row['auth_role_id']]) : $hold_ary[$row['forum_id']] + unserialize($this->role_cache[$row['auth_role_id']]);
$hold_ary[$row['forum_id']] = (empty($hold_ary[$row['forum_id']])) ? unserialize($role_cache[$row['auth_role_id']]) : $hold_ary[$row['forum_id']] + unserialize($role_cache[$row['auth_role_id']]);
}
else
{
@ -890,9 +886,9 @@ class auth
{
$this->_set_group_hold_ary($hold_ary[$row['forum_id']], $row['auth_option_id'], $row['auth_setting']);
}
else if (!empty($this->role_cache[$row['auth_role_id']]))
else if (!empty($role_cache[$row['auth_role_id']]))
{
foreach (unserialize($this->role_cache[$row['auth_role_id']]) as $option_id => $setting)
foreach (unserialize($role_cache[$row['auth_role_id']]) as $option_id => $setting)
{
$this->_set_group_hold_ary($hold_ary[$row['forum_id']], $option_id, $setting);
}

View file

@ -17,7 +17,6 @@ use phpbb\captcha\factory;
use phpbb\config\config;
use phpbb\db\driver\driver_interface;
use phpbb\passwords\manager;
use phpbb\request\request_interface;
use phpbb\user;
/**
@ -35,18 +34,9 @@ class db extends base
/** @var driver_interface DBAL driver instance */
protected $db;
/** @var request_interface Request object */
protected $request;
/** @var user User object */
protected $user;
/** @var string phpBB root path */
protected $phpbb_root_path;
/** @var string PHP file extension */
protected $php_ext;
/**
* phpBB passwords manager
*
@ -61,21 +51,15 @@ class db extends base
* @param config $config
* @param driver_interface $db
* @param manager $passwords_manager
* @param request_interface $request
* @param user $user
* @param string $phpbb_root_path
* @param string $php_ext
*/
public function __construct(factory $captcha_factory, config $config, driver_interface $db, manager $passwords_manager, request_interface $request, user $user, $phpbb_root_path, $php_ext)
public function __construct(factory $captcha_factory, config $config, driver_interface $db, manager $passwords_manager, user $user)
{
$this->captcha_factory = $captcha_factory;
$this->config = $config;
$this->db = $db;
$this->passwords_manager = $passwords_manager;
$this->request = $request;
$this->user = $user;
$this->phpbb_root_path = $phpbb_root_path;
$this->php_ext = $php_ext;
}
/**

View file

@ -80,7 +80,7 @@ abstract class driver implements \phpbb\avatar\driver\driver_interface
* @param string $phpbb_root_path Path to the phpBB root
* @param string $php_ext PHP file extension
* @param \phpbb\path_helper $path_helper phpBB path helper
* @param \phpbb\cache\driver\driver_interface $cache Cache driver
* @param \phpbb\cache\driver\driver_interface|null $cache Cache driver
*/
public function __construct(\phpbb\config\config $config, \FastImageSize\FastImageSize $imagesize, $phpbb_root_path, $php_ext, \phpbb\path_helper $path_helper, \phpbb\cache\driver\driver_interface $cache = null)
{

View file

@ -114,7 +114,7 @@ class gravatar extends \phpbb\avatar\driver\driver
return false;
}
if (!empty($image_data) && ($image_data['width'] <= 0 || $image_data['width'] <= 0))
if (!empty($image_data) && ($image_data['width'] <= 0 || $image_data['height'] <= 0))
{
$error[] = 'AVATAR_NO_SIZE';
return false;

View file

@ -40,7 +40,7 @@ class local extends \phpbb\avatar\driver\driver
$avatar_list = $this->get_avatar_list($user);
$category = $request->variable('avatar_local_cat', key($avatar_list));
foreach ($avatar_list as $cat => $null)
foreach (array_keys($avatar_list) as $cat)
{
if (!empty($avatar_list[$cat]))
{
@ -63,7 +63,7 @@ class local extends \phpbb\avatar\driver\driver
));
$table_cols = isset($row['avatar_gallery_cols']) ? $row['avatar_gallery_cols'] : 4;
$row_count = $col_count = $avatar_pos = 0;
$col_count = $avatar_pos = 0;
$avatar_count = count($avatar_list[$category]);
reset($avatar_list[$category]);
@ -75,7 +75,6 @@ class local extends \phpbb\avatar\driver\driver
if ($col_count == 0)
{
++$row_count;
$template->assign_block_vars('avatar_local_row', array(
));
}

View file

@ -29,7 +29,7 @@ class manager
/**
* Array that contains a list of enabled drivers
* @var array
* @var array|bool
*/
static protected $enabled_drivers = false;

View file

@ -90,7 +90,7 @@ class gd
}
}
if ($config['captcha_gd_wave'] && ($config['captcha_gd_y_grid'] || $config['captcha_gd_y_grid']))
if ($config['captcha_gd_wave'] && ($config['captcha_gd_x_grid'] || $config['captcha_gd_y_grid']))
{
$this->wave($img);
}

View file

@ -235,7 +235,7 @@ abstract class captcha_abstract
global $db, $user;
$this->code = gen_rand_string_friendly(mt_rand(CAPTCHA_MIN_CHARS, CAPTCHA_MAX_CHARS));
$this->confirm_id = md5(unique_id($user->ip));
$this->confirm_id = md5(unique_id());
$this->seed = hexdec(substr(unique_id(), 4, 10));
$this->solved = 0;
// compute $seed % 0x7fffffff

View file

@ -442,7 +442,7 @@ class qa
{
return;
}
$this->confirm_id = md5(unique_id($user->ip));
$this->confirm_id = md5(unique_id());
$this->question = (int) array_rand($this->question_ids);
$sql = 'INSERT INTO ' . $this->table_qa_confirm . ' ' . $db->sql_build_array('INSERT', array(

View file

@ -46,7 +46,7 @@ class class_loader
* @param string $namespace Required namespace 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\driver_interface $cache An implementation of the phpBB cache interface.
* @param \phpbb\cache\driver\driver_interface|null $cache An implementation of the phpBB cache interface.
*/
public function __construct($namespace, $path, $php_ext = 'php', \phpbb\cache\driver\driver_interface $cache = null)
{
@ -67,7 +67,7 @@ class class_loader
* the class loader will resolve paths by checking for the existence of every
* directory in the class name every time.
*
* @param \phpbb\cache\driver\driver_interface $cache An implementation of the phpBB cache interface.
* @param \phpbb\cache\driver\driver_interface|null $cache An implementation of the phpBB cache interface.
*/
public function set_cache(\phpbb\cache\driver\driver_interface $cache = null)
{

View file

@ -24,7 +24,7 @@ class managed_with_clean_error_exception extends managed_with_error_exception
* @param string $prefix The language string prefix
* @param string $message The Exception message to throw (must be a language variable).
* @param array $parameters The parameters to use with the language var.
* @param \Exception $previous The previous runtime_exception used for the runtime_exception chaining.
* @param \Exception|null $previous The previous runtime_exception used for the runtime_exception chaining.
* @param integer $code The Exception code.
*/
public function __construct($prefix, $message = '', array $parameters = [], \Exception $previous = null, $code = 0)

View file

@ -24,7 +24,7 @@ class managed_with_enable_error_exception extends managed_with_error_exception
* @param string $prefix The language string prefix
* @param string $message The Exception message to throw (must be a language variable).
* @param array $parameters The parameters to use with the language var.
* @param \Exception $previous The previous runtime_exception used for the runtime_exception chaining.
* @param \Exception|null $previous The previous runtime_exception used for the runtime_exception chaining.
* @param integer $code The Exception code.
*/
public function __construct($prefix, $message = '', array $parameters = [], \Exception $previous = null, $code = 0)

View file

@ -24,7 +24,7 @@ class managed_with_error_exception extends runtime_exception
* @param string $prefix The language string prefix
* @param string $message The Exception message to throw (must be a language variable).
* @param array $parameters The parameters to use with the language var.
* @param \Exception $previous The previous runtime_exception used for the runtime_exception chaining.
* @param \Exception|null $previous The previous runtime_exception used for the runtime_exception chaining.
* @param integer $code The Exception code.
*/
public function __construct($prefix, $message = '', array $parameters = [], \Exception $previous = null, $code = 0)

View file

@ -26,7 +26,7 @@ class runtime_exception extends base
* @param string $prefix The language string prefix
* @param string $message The Exception message to throw (must be a language variable).
* @param array $parameters The parameters to use with the language var.
* @param \Exception $previous The previous runtime_exception used for the runtime_exception chaining.
* @param \Exception|null $previous The previous runtime_exception used for the runtime_exception chaining.
* @param integer $code The Exception code.
*/
public function __construct($prefix, $message = '', array $parameters = [], \Exception $previous = null, $code = 0)

View file

@ -38,6 +38,11 @@ class extension_manager extends manager
*/
protected $filesystem;
/**
* @var string
*/
protected $root_path;
/**
* @var array
*/
@ -61,7 +66,7 @@ class extension_manager extends manager
* @param string $package_type Composer type of managed packages
* @param string $exception_prefix Exception prefix to use
* @param string $root_path phpBB root path
* @param config $config Config object
* @param config|null $config Config object
*/
public function __construct(installer $installer, driver_interface $cache, ext_manager $extension_manager, filesystem $filesystem, $package_type, $exception_prefix, $root_path, config $config = null)
{

View file

@ -69,12 +69,12 @@ class installer
protected $root_path;
/**
* @var string Stores the original working directory in case it has been changed through move_to_root()
* @var string|null Stores the original working directory in case it has been changed through move_to_root()
*/
private $original_cwd;
/**
* @var array Stores the content of the ext json file before generate_ext_json_file() overrides it
* @var array|null Stores the content of the ext json file before generate_ext_json_file() overrides it
*/
private $ext_json_file_backup;
@ -83,11 +83,16 @@ class installer
*/
private $request;
/**
* @var filesystem phpBB filesystem
*/
private $filesystem;
/**
* @param string $root_path phpBB root path
* @param filesystem $filesystem Filesystem object
* @param request $request phpBB request object
* @param config $config Config object
* @param config|null $config Config object
*/
public function __construct($root_path, filesystem $filesystem, request $request, config $config = null)
{
@ -108,6 +113,7 @@ class installer
$this->root_path = $root_path;
$this->request = $request;
$this->filesystem = $filesystem;
putenv('COMPOSER_HOME=' . filesystem_helper::realpath($root_path) . '/store/composer');
}
@ -118,7 +124,7 @@ class installer
* @param array $packages Packages to install.
* Each entry may be a name or an array associating a version constraint to a name
* @param array $whitelist White-listed packages (packages that can be installed/updated/removed)
* @param IOInterface $io IO object used for the output
* @param IOInterface|null $io IO object used for the output
*
* @throws runtime_exception
*/
@ -137,7 +143,7 @@ class installer
* @param array $packages Packages to install.
* Each entry may be a name or an array associating a version constraint to a name
* @param array $whitelist White-listed packages (packages that can be installed/updated/removed)
* @param IOInterface $io IO object used for the output
* @param IOInterface|null $io IO object used for the output
*
* @throws runtime_exception
*/
@ -402,9 +408,7 @@ class installer
*/
public function check_requirements()
{
$filesystem = new \phpbb\filesystem\filesystem();
return $filesystem->is_writable([
return $this->filesystem->is_writable([
$this->root_path . $this->composer_filename,
$this->root_path . $this->packages_vendor_dir,
$this->root_path . substr($this->composer_filename, 0, -5) . '.lock',

View file

@ -26,7 +26,7 @@ class web_io extends BufferIO implements io_interface
* @param language $language Language object
* @param string $input Input string
* @param int $verbosity Verbosity level
* @param OutputFormatterInterface $formatter Output formatter
* @param OutputFormatterInterface|null $formatter Output formatter
*/
public function __construct(language $language, $input = '', $verbosity = StreamOutput::VERBOSITY_NORMAL, OutputFormatterInterface $formatter = null)
{

View file

@ -43,17 +43,17 @@ class manager implements manager_interface
protected $exception_prefix;
/**
* @var array Caches the managed packages list (for the current type)
* @var array|null Caches the managed packages list (for the current type)
*/
private $managed_packages;
/**
* @var array Caches the managed packages list (for all phpBB types)
* @var array|null Caches the managed packages list (for all phpBB types)
*/
private $all_managed_packages;
/**
* @var array Caches the available packages list
* @var array|null Caches the available packages list
*/
private $available_packages;
@ -101,7 +101,7 @@ class manager implements manager_interface
*
* @param array $packages Packages to update.
* Each entry may be a name or an array associating a version constraint to a name
* @param IOInterface $io IO object used for the output
* @param IOInterface|null $io IO object used for the output
*/
protected function pre_install(array $packages, IOInterface $io = null)
{
@ -112,7 +112,7 @@ class manager implements manager_interface
*
* @param array $packages Packages to update.
* Each entry may be a name or an array associating a version constraint to a name
* @param IOInterface $io IO object used for the output
* @param IOInterface|null $io IO object used for the output
*/
protected function post_install(array $packages, IOInterface $io = null)
{
@ -146,7 +146,7 @@ class manager implements manager_interface
*
* @param array $packages Packages to update.
* Each entry may be a name or an array associating a version constraint to a name
* @param IOInterface $io IO object used for the output
* @param IOInterface|null $io IO object used for the output
*/
protected function pre_update(array $packages, IOInterface $io = null)
{
@ -157,7 +157,7 @@ class manager implements manager_interface
*
* @param array $packages Packages to update.
* Each entry may be a name or an array associating a version constraint to a name
* @param IOInterface $io IO object used for the output
* @param IOInterface|null $io IO object used for the output
*/
protected function post_update(array $packages, IOInterface $io = null)
{
@ -193,7 +193,7 @@ class manager implements manager_interface
*
* @param array $packages Packages to update.
* Each entry may be a name or an array associating a version constraint to a name
* @param IOInterface $io IO object used for the output
* @param IOInterface|null $io IO object used for the output
*/
protected function pre_remove(array $packages, IOInterface $io = null)
{
@ -204,7 +204,7 @@ class manager implements manager_interface
*
* @param array $packages Packages to update.
* Each entry may be a name or an array associating a version constraint to a name
* @param IOInterface $io IO object used for the output
* @param IOInterface|null $io IO object used for the output
*/
protected function post_remove(array $packages, IOInterface $io = null)
{

View file

@ -26,7 +26,7 @@ interface manager_interface
*
* @param array $packages Packages to install.
* Each entry may be a name or an array associating a version constraint to a name
* @param IOInterface $io IO object used for the output
* @param IOInterface|null $io IO object used for the output
*
* @throws runtime_exception
*/
@ -37,7 +37,7 @@ interface manager_interface
*
* @param array $packages Packages to update.
* Each entry may be a name or an array associating a version constraint to a name
* @param IOInterface $io IO object used for the output
* @param IOInterface|null $io IO object used for the output
*
* @throws runtime_exception
*/
@ -48,7 +48,7 @@ interface manager_interface
*
* @param array $packages Packages to remove.
* Each entry may be a name or an array associating a version constraint to a name
* @param IOInterface $io IO object used for the output
* @param IOInterface|null $io IO object used for the output
*
* @throws runtime_exception
*/

View file

@ -42,8 +42,6 @@ class config_php_file
*/
protected $config_file;
private $defined_vars;
/**
* Constructor
*
@ -102,10 +100,11 @@ class config_php_file
{
if (!$this->config_loaded && file_exists($this->config_file))
{
$this->defined_vars = get_defined_vars();
$defined_vars = null; // Define variable before call get_defined_vars
$defined_vars = get_defined_vars();
require($this->config_file);
$this->config_data = array_diff_key(get_defined_vars(), $this->defined_vars);
$this->config_data = array_diff_key(get_defined_vars(), $defined_vars);
$this->config_loaded = true;
}

View file

@ -61,7 +61,7 @@ class set_atomic extends command
* @param InputInterface $input An InputInterface instance
* @param OutputInterface $output An OutputInterface instance
*
* @return bool True if the value was changed, false otherwise.
* @return int 0 if the value was changed, 1 otherwise.
* @see \phpbb\config\config::set_atomic()
*/
protected function execute(InputInterface $input, OutputInterface $output)

View file

@ -37,7 +37,7 @@ class delete extends \phpbb\console\command\command
/**
* Constructor
*
* @param \config\config $config The config
* @param \phpbb\config\config $config The config
* @param \phpbb\user $user The user object (used to get language information)
* @param \phpbb\db\driver\driver_interface $db Database connection
* @param string $phpbb_root_path Root path

View file

@ -50,7 +50,7 @@ class generate extends \phpbb\console\command\command
/**
* Constructor
*
* @param \config\config $config The config
* @param \phpbb\config\config $config The config
* @param \phpbb\user $user The user object (used to get language information)
* @param \phpbb\db\driver\driver_interface $db Database connection
* @param \phpbb\cache\service $cache The cache service

View file

@ -29,7 +29,7 @@ class check extends \phpbb\console\command\command
/** @var \phpbb\config\config */
protected $config;
/** @var \Symfony\Component\DependencyInjection\ContainerBuilder */
/** @var ContainerInterface */
protected $phpbb_container;
/**
* @var language

View file

@ -15,7 +15,6 @@ namespace phpbb\console\command\user;
use phpbb\config\config;
use phpbb\console\command\command;
use phpbb\db\driver\driver_interface;
use phpbb\language\language;
use phpbb\log\log_interface;
use phpbb\notification\manager;
@ -29,9 +28,6 @@ use Symfony\Component\Console\Style\SymfonyStyle;
class activate extends command
{
/** @var driver_interface */
protected $db;
/** @var config */
protected $config;
@ -65,7 +61,6 @@ class activate extends command
* Construct method
*
* @param user $user
* @param driver_interface $db
* @param config $config
* @param language $language
* @param log_interface $log
@ -74,9 +69,8 @@ class activate extends command
* @param string $phpbb_root_path
* @param string $php_ext
*/
public function __construct(user $user, driver_interface $db, config $config, language $language, log_interface $log, manager $notifications, user_loader $user_loader, $phpbb_root_path, $php_ext)
public function __construct(user $user, config $config, language $language, log_interface $log, manager $notifications, user_loader $user_loader, $phpbb_root_path, $php_ext)
{
$this->db = $db;
$this->config = $config;
$this->language = $language;
$this->log = $log;

View file

@ -14,7 +14,6 @@
namespace phpbb\console\command\user;
use phpbb\console\command\command;
use phpbb\db\driver\driver_interface;
use phpbb\language\language;
use phpbb\log\log_interface;
use phpbb\user;
@ -28,9 +27,6 @@ use Symfony\Component\Console\Style\SymfonyStyle;
class delete extends command
{
/** @var driver_interface */
protected $db;
/** @var language */
protected $language;
@ -58,16 +54,14 @@ class delete extends command
* Construct method
*
* @param user $user
* @param driver_interface $db
* @param language $language
* @param log_interface $log
* @param user_loader $user_loader
* @param string $phpbb_root_path
* @param string $php_ext
*/
public function __construct(user $user, driver_interface $db, language $language, log_interface $log, user_loader $user_loader, $phpbb_root_path, $php_ext)
public function __construct(user $user, language $language, log_interface $log, user_loader $user_loader, $phpbb_root_path, $php_ext)
{
$this->db = $db;
$this->language = $language;
$this->log = $log;
$this->user_loader = $user_loader;

View file

@ -61,6 +61,26 @@ class content_visibility
*/
protected $php_ext;
/**
* @var string
*/
protected $forums_table;
/**
* @var string
*/
protected $posts_table;
/**
* @var string
*/
protected $topics_table;
/**
* @var string
*/
protected $users_table;
/**
* Constructor
*

View file

@ -30,7 +30,7 @@ class resolver implements ControllerResolverInterface
/**
* phpbb\template\template object
* @var \phpbb\template\template
* @var \phpbb\template\template|null
*/
protected $template;
@ -51,7 +51,7 @@ class resolver implements ControllerResolverInterface
*
* @param ContainerInterface $container ContainerInterface object
* @param string $phpbb_root_path Relative path to phpBB root
* @param \phpbb\template\template $template
* @param \phpbb\template\template|null $template
*/
public function __construct(ContainerInterface $container, $phpbb_root_path, \phpbb\template\template $template = null)
{

View file

@ -159,6 +159,6 @@ class manager
*/
public function wrap_task(\phpbb\cron\task\task $task)
{
return new wrapper($task, $this->routing_helper, $this->phpbb_root_path, $this->php_ext);
return new wrapper($task, $this->routing_helper);
}
}

View file

@ -26,11 +26,6 @@ class reparser extends \phpbb\cron\task\base
*/
protected $config;
/**
* @var \phpbb\config\db_text
*/
protected $config_text;
/**
* @var \phpbb\lock\db
*/
@ -60,15 +55,13 @@ class reparser extends \phpbb\cron\task\base
* Constructor
*
* @param \phpbb\config\config $config
* @param \phpbb\config\db_text $config_text
* @param \phpbb\lock\db $reparse_lock
* @param \phpbb\textreparser\manager $reparser_manager
* @param \phpbb\di\service_collection $reparsers
*/
public function __construct(\phpbb\config\config $config, \phpbb\config\db_text $config_text, \phpbb\lock\db $reparse_lock, \phpbb\textreparser\manager $reparser_manager, \phpbb\di\service_collection $reparsers)
public function __construct(\phpbb\config\config $config, \phpbb\lock\db $reparse_lock, \phpbb\textreparser\manager $reparser_manager, \phpbb\di\service_collection $reparsers)
{
$this->config = $config;
$this->config_text = $config_text;
$this->reparse_lock = $reparse_lock;
$this->reparser_manager = $reparser_manager;
$this->reparsers = $reparsers;

View file

@ -31,16 +31,6 @@ class wrapper
*/
protected $task;
/**
* @var string
*/
protected $phpbb_root_path;
/**
* @var string
*/
protected $php_ext;
/**
* Constructor.
*
@ -48,15 +38,11 @@ class wrapper
*
* @param task $task The cron task to wrap.
* @param helper $routing_helper Routing helper for route generation
* @param string $phpbb_root_path Relative path to phpBB root
* @param string $php_ext PHP file extension
*/
public function __construct(task $task, helper $routing_helper, $phpbb_root_path, $php_ext)
public function __construct(task $task, helper $routing_helper)
{
$this->task = $task;
$this->routing_helper = $routing_helper;
$this->phpbb_root_path = $phpbb_root_path;
$this->php_ext = $php_ext;
}
/**
@ -96,6 +82,7 @@ class wrapper
*/
public function get_url()
{
$params = [];
$params['cron_type'] = $this->get_name();
if ($this->is_parametrized())
{

View file

@ -40,7 +40,7 @@ class datetime extends \DateTime
*
* @param user $user object for context.
* @param string $time String in a format accepted by strtotime().
* @param \DateTimeZone $timezone Time zone of the time.
* @param \DateTimeZone|null $timezone Time zone of the time.
*/
public function __construct($user, $time = 'now', \DateTimeZone $timezone = null)
{

View file

@ -46,7 +46,7 @@ class local_url_bbcode extends \phpbb\db\migration\migration
{
if (function_exists('phpbb_require_updated'))
{
phpbb_require_updated('includes/acp/acp_bbcodes.' . $this->php_ext);
phpbb_require_updated('includes/acp/acp_bbcodes.' . $this->php_ext, $this->phpbb_root_path);
}
else
{

View file

@ -121,7 +121,7 @@ class release_3_0_4_rc1 extends \phpbb\db\migration\migration
$sql_ary['field_show_profile'] = 1;
}
$this->sql_query('UPDATE ' . $this->table_prefix . 'profile_fields SET ' . $this->db->sql_build_array('UPDATE', $sql_ary) . ' WHERE field_id = ' . $row['field_id'], $errored, $error_ary);
$this->sql_query('UPDATE ' . $this->table_prefix . 'profile_fields SET ' . $this->db->sql_build_array('UPDATE', $sql_ary) . ' WHERE field_id = ' . $row['field_id']);
}
$this->db->sql_freeresult($result);

View file

@ -16,7 +16,7 @@ namespace phpbb\db\migration\data\v310;
class avatar_types extends \phpbb\db\migration\migration
{
/**
* @var avatar type map
* @var array avatar type map
*/
protected $avatar_type_map = array(
AVATAR_UPLOAD => 'avatar.driver.upload',

View file

@ -54,6 +54,7 @@ class bot_update extends \phpbb\db\migration\migration
if (!$group_row)
{
// default fallback, should never get here
$group_row = [];
$group_row['group_id'] = 6;
$group_row['group_colour'] = '9E8DA7';
}

View file

@ -122,7 +122,7 @@ class notification_options_reconvert extends \phpbb\db\migration\migration
* @param string $item_type
* @param int $item_id
* @param int $user_id
* @param string $methods
* @param array $methods
*/
protected function add_method_rows(\phpbb\db\sql_insert_buffer $insert_buffer, $item_type, $item_id, $user_id, array $methods)
{

View file

@ -83,7 +83,7 @@ class style_update extends \phpbb\db\migration\migration
// Set prosilver to default style
$this->config->set('default_style', $style_id);
}
else if (empty($styles) && empty($available_styles))
else if (empty($styles) && empty($style_paths))
{
throw new \RuntimeException('No valid styles available');
}

View file

@ -20,9 +20,6 @@ use phpbb\module\exception\module_exception;
*/
class module implements \phpbb\db\migration\tool\tool_interface
{
/** @var \phpbb\cache\service */
protected $cache;
/** @var \phpbb\db\driver\driver_interface */
protected $db;
@ -32,12 +29,6 @@ class module implements \phpbb\db\migration\tool\tool_interface
/** @var \phpbb\module\module_manager */
protected $module_manager;
/** @var string */
protected $phpbb_root_path;
/** @var string */
protected $php_ext;
/** @var string */
protected $modules_table;
@ -48,21 +39,15 @@ class module implements \phpbb\db\migration\tool\tool_interface
* Constructor
*
* @param \phpbb\db\driver\driver_interface $db
* @param \phpbb\cache\service $cache
* @param \phpbb\user $user
* @param \phpbb\module\module_manager $module_manager
* @param string $phpbb_root_path
* @param string $php_ext
* @param string $modules_table
*/
public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\cache\service $cache, \phpbb\user $user, \phpbb\module\module_manager $module_manager, $phpbb_root_path, $php_ext, $modules_table)
public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\user $user, \phpbb\module\module_manager $module_manager, $modules_table)
{
$this->db = $db;
$this->cache = $cache;
$this->user = $user;
$this->module_manager = $module_manager;
$this->phpbb_root_path = $phpbb_root_path;
$this->php_ext = $php_ext;
$this->modules_table = $modules_table;
}

View file

@ -115,9 +115,6 @@ class permission implements \phpbb\db\migration\tool\tool_interface
return;
}
// We've added permissions, so set to true to notify the user.
$this->permissions_added = true;
if (!class_exists('auth_admin'))
{
include($this->phpbb_root_path . 'includes/acp/auth.' . $this->php_ext);

View file

@ -50,6 +50,9 @@ class migrator
/** @var array */
protected $tables;
/** @var array */
protected $tools;
/** @var string */
protected $phpbb_root_path;
@ -87,7 +90,7 @@ class migrator
*
* 'effectively_installed' set and set to true if the migration was effectively_installed
*
* @var array
* @var array|bool
*/
protected $last_run_migration = false;
@ -130,6 +133,7 @@ class migrator
$this->output_handler = new null_migrator_output_handler();
$this->tools = [];
foreach ($tools as $tool)
{
$this->tools[$tool->get_name()] = $tool;
@ -699,7 +703,7 @@ class migrator
}
// Reverse the step that was run
$result = $this->run_step($reverse_step, false, !$revert);
$this->run_step($reverse_step, false, !$revert);
}
throw $e;

View file

@ -31,7 +31,7 @@ class log_wrapper_migrator_output_handler implements migrator_output_handler_int
/**
* Log file handle
* @var resource
* @var resource|bool
*/
protected $file_handle = false;

View file

@ -21,7 +21,7 @@ use Symfony\Component\HttpKernel\DependencyInjection\Extension;
*/
class config extends Extension
{
/** @var array */
/** @var \phpbb\config_php_file */
protected $config_php;
public function __construct(\phpbb\config_php_file $config_php)

View file

@ -93,7 +93,7 @@ class service_collection extends \ArrayObject
* Returns the service associated to a class
*
* @return mixed
* @throw \RuntimeException if the
* @throws \RuntimeException if the service isn't found
*/
public function get_by_class($class)
{

View file

@ -39,6 +39,9 @@ class md_exporter
/** @var array */
protected $events;
/** @var array */
protected $events_by_file;
/**
* @param string $phpbb_root_path
* @param mixed $extension String 'vendor/ext' to filter, null for phpBB core
@ -203,7 +206,7 @@ class md_exporter
if (!$this->version_is_filtered($since))
{
$is_filtered = false;
foreach ($changes as $version => $null)
foreach (array_keys($changes) as $version)
{
if ($this->version_is_filtered($version))
{

View file

@ -40,7 +40,7 @@ class http_exception extends runtime_exception implements HttpExceptionInterface
* @param integer $status_code The http status code.
* @param string $message The Exception message to throw (must be a language variable).
* @param array $parameters The parameters to use with the language var.
* @param \Exception $previous The previous exception used for the exception chaining.
* @param \Exception|null $previous The previous exception used for the exception chaining.
* @param array $headers Additional headers to set in the response.
* @param integer $code The Exception code.
*/

View file

@ -32,7 +32,7 @@ class runtime_exception extends \RuntimeException implements exception_interface
*
* @param string $message The Exception message to throw (must be a language variable).
* @param array $parameters The parameters to use with the language var.
* @param \Exception $previous The previous runtime_exception used for the runtime_exception chaining.
* @param \Exception|null $previous The previous runtime_exception used for the runtime_exception chaining.
* @param integer $code The Exception code.
*/
public function __construct($message = "", array $parameters = array(), \Exception $previous = null, $code = 0)

View file

@ -35,7 +35,7 @@ class base implements \phpbb\extension\extension_interface
/** @var string */
protected $extension_path;
/** @var string[] */
/** @var string[]|bool */
private $migrations = false;
/**

View file

@ -43,7 +43,7 @@ class 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, defaults to php
* @param \phpbb\cache\service $cache A cache instance or null
* @param \phpbb\cache\service|null $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\driver_interface $db, \phpbb\config\config $config, $extension_table, $phpbb_root_path, $php_ext = 'php', \phpbb\cache\service $cache = null, $cache_name = '_ext')

View file

@ -290,7 +290,7 @@ class feed
*
* @return Response
*
* @throw exception\feed_exception
* @throws exception\feed_exception
*/
protected function send_feed_do(feed_interface $feed)
{
@ -401,7 +401,7 @@ class feed
/**
* Throw and exception saying that the feed isn't available
*
* @throw http_exception
* @throws http_exception
*/
protected function send_unavailable()
{

View file

@ -61,7 +61,6 @@ interface feed_interface
*
* @param $item_row
* @param $row
* @return array
*/
public function adjust_item(&$item_row, &$row);
}

View file

@ -18,6 +18,8 @@ use phpbb\language\language;
/**
* Responsible for holding all file relevant information, as well as doing file-specific operations.
* The {@link fileupload fileupload class} can be used to upload several files, each of them being this object to operate further on.
*
* @deprecated 4.0.0 Use phpbb\files\filespec_storage instead
*/
class filespec
{
@ -84,10 +86,10 @@ class filespec
/** @var string phpBB root path */
protected $phpbb_root_path;
/** @var \phpbb\plupload\plupload The plupload object */
/** @var \phpbb\plupload\plupload|null The plupload object */
protected $plupload;
/** @var \phpbb\mimetype\guesser phpBB Mimetype guesser */
/** @var \phpbb\mimetype\guesser|null phpBB Mimetype guesser */
protected $mimetype_guesser;
/**
@ -98,8 +100,8 @@ class filespec
* @param \bantu\IniGetWrapper\IniGetWrapper $php_ini ini_get() wrapper
* @param \FastImageSize\FastImageSize $imagesize Imagesize class
* @param string $phpbb_root_path phpBB root path
* @param \phpbb\mimetype\guesser $mimetype_guesser Mime type guesser
* @param \phpbb\plupload\plupload $plupload Plupload
* @param \phpbb\mimetype\guesser|null $mimetype_guesser Mime type guesser
* @param \phpbb\plupload\plupload|null $plupload Plupload
*/
public function __construct(\phpbb\filesystem\filesystem_interface $phpbb_filesystem, language $language, \bantu\IniGetWrapper\IniGetWrapper $php_ini, \FastImageSize\FastImageSize $imagesize, $phpbb_root_path, \phpbb\mimetype\guesser $mimetype_guesser = null, \phpbb\plupload\plupload $plupload = null)
{

View file

@ -66,34 +66,29 @@ class filespec_storage
/** @var upload Instance of upload class */
public $upload;
/** @var \bantu\IniGetWrapper\IniGetWrapper ini_get() wrapper class */
protected $php_ini;
/** @var \FastImageSize\FastImageSize */
protected $imagesize;
/** @var language Language class */
protected $language;
/** @var \phpbb\plupload\plupload The plupload object */
/** @var \phpbb\plupload\plupload|null The plupload object */
protected $plupload;
/** @var \phpbb\mimetype\guesser phpBB Mimetype guesser */
/** @var \phpbb\mimetype\guesser|null phpBB Mimetype guesser */
protected $mimetype_guesser;
/**
* File upload class
*
* @param language $language Language
* @param \bantu\IniGetWrapper\IniGetWrapper $php_ini ini_get() wrapper
* @param \FastImageSize\FastImageSize $imagesize Imagesize class
* @param \phpbb\mimetype\guesser $mimetype_guesser Mime type guesser
* @param \phpbb\plupload\plupload $plupload Plupload
* @param \phpbb\mimetype\guesser|null $mimetype_guesser Mime type guesser
* @param \phpbb\plupload\plupload|null $plupload Plupload
*/
public function __construct(language $language, \bantu\IniGetWrapper\IniGetWrapper $php_ini, \FastImageSize\FastImageSize $imagesize, \phpbb\mimetype\guesser $mimetype_guesser = null, \phpbb\plupload\plupload $plupload = null)
public function __construct(language $language, \FastImageSize\FastImageSize $imagesize, \phpbb\mimetype\guesser $mimetype_guesser = null, \phpbb\plupload\plupload $plupload = null)
{
$this->language = $language;
$this->php_ini = $php_ini;
$this->imagesize = $imagesize;
$this->plupload = $plupload;
$this->mimetype_guesser = $mimetype_guesser;

View file

@ -99,7 +99,7 @@ class local extends base
* Retrieve upload array
*
* @param string $source_file Source file name
* @param array $filedata File data array
* @param array|bool $filedata File data array
*
* @return array Upload array
*/

View file

@ -108,7 +108,7 @@ class local_storage extends base
* Retrieve upload array
*
* @param string $source_file Source file name
* @param array $filedata File data array
* @param array|bool $filedata File data array
*
* @return array Upload array
*/

View file

@ -29,7 +29,7 @@ class remote extends base
/** @var factory Files factory */
protected $factory;
/** @var filesystem Filesystem temp */
/** @var temp Filesystem temp */
protected $temp;
/** @var language */

View file

@ -13,7 +13,6 @@
namespace phpbb\files;
use phpbb\filesystem\filesystem_interface;
use phpbb\language\language;
use phpbb\request\request_interface;
@ -50,9 +49,6 @@ class upload
/** @var int Timeout for remote upload */
public $upload_timeout = 6;
/** @var filesystem_interface */
protected $filesystem;
/** @var \phpbb\files\factory Files factory */
protected $factory;
@ -68,15 +64,13 @@ class upload
/**
* Init file upload class.
*
* @param filesystem_interface $filesystem
* @param factory $factory Files factory
* @param language $language Language class
* @param \bantu\IniGetWrapper\IniGetWrapper $php_ini ini_get() wrapper
* @param request_interface $request Request class
*/
public function __construct(filesystem_interface $filesystem, factory $factory, language $language, \bantu\IniGetWrapper\IniGetWrapper $php_ini, request_interface $request)
public function __construct(factory $factory, language $language, \bantu\IniGetWrapper\IniGetWrapper $php_ini, request_interface $request)
{
$this->filesystem = $filesystem;
$this->factory = $factory;
$this->language = $language;
$this->php_ini = $php_ini;
@ -98,13 +92,13 @@ class upload
/**
* Set allowed extensions
*
* @param array $allowed_extensions Allowed file extensions
* @param array|bool $allowed_extensions Allowed file extensions
*
* @return \phpbb\files\upload This instance of upload
*/
public function set_allowed_extensions($allowed_extensions)
{
if ($allowed_extensions !== false && is_array($allowed_extensions))
if ($allowed_extensions !== false)
{
$this->allowed_extensions = $allowed_extensions;
}
@ -152,13 +146,13 @@ class upload
/**
* Set disallowed strings
*
* @param array $disallowed_content Disallowed content
* @param array|bool $disallowed_content Disallowed content
*
* @return \phpbb\files\upload This instance of upload
*/
public function set_disallowed_content($disallowed_content)
{
if ($disallowed_content !== false && is_array($disallowed_content))
if ($disallowed_content !== false)
{
$this->disallowed_content = array_diff($disallowed_content, array(''));
}
@ -185,7 +179,7 @@ class upload
*
* @param string $type Upload type
*
* @return \phpbb\files\filespec|bool A filespec instance if upload was
* @return \phpbb\files\filespec_storage|bool A filespec instance if upload was
* successful, false if there were issues or the type is not supported
*/
public function handle_upload($type)
@ -259,7 +253,7 @@ class upload
/**
* Perform common file checks
*
* @param filespec $file Instance of filespec class
* @param filespec_storage $file Instance of filespec class
*/
public function common_checks($file)
{
@ -293,7 +287,7 @@ class upload
/**
* Check for allowed extension
*
* @param filespec $file Instance of filespec class
* @param filespec_storage $file Instance of filespec class
*
* @return bool True if extension is allowed, false if not
*/
@ -305,7 +299,7 @@ class upload
/**
* Check for allowed dimension
*
* @param filespec $file Instance of filespec class
* @param filespec_storage $file Instance of filespec class
*
* @return bool True if dimensions are valid or no constraints set, false
* if not
@ -346,7 +340,7 @@ class upload
/**
* Check for bad content (IE mime-sniffing)
*
* @param filespec $file Instance of filespec class
* @param filespec_storage $file Instance of filespec class
*
* @return bool True if content is valid, false if not
*/

View file

@ -20,11 +20,11 @@ class filesystem_exception extends runtime_exception
/**
* Constructor
*
* @param string $message The Exception message to throw (must be a language variable).
* @param string $filename The file that caused the error.
* @param array $parameters The parameters to use with the language var.
* @param \Exception $previous The previous runtime_exception used for the runtime_exception chaining.
* @param integer $code The Exception code.
* @param string $message The Exception message to throw (must be a language variable).
* @param string $filename The file that caused the error.
* @param array $parameters The parameters to use with the language var.
* @param \Exception|null $previous The previous runtime_exception used for the runtime_exception chaining.
* @param integer $code The Exception code.
*/
public function __construct($message = '', $filename = '', $parameters = array(), \Exception $previous = null, $code = 0)
{

View file

@ -31,7 +31,7 @@ class filesystem implements filesystem_interface
/**
* Stores current working directory
*
* @var string|bool current working directory or false if it cannot be recovered
* @var string|bool|null current working directory or false if it cannot be recovered
*/
protected $working_directory;

View file

@ -177,14 +177,14 @@ interface filesystem_interface
/**
* Mirrors a directory to another.
*
* @param string $origin_dir The origin directory
* @param string $target_dir The target directory
* @param \Traversable $iterator A Traversable instance
* @param array $options An array of boolean options
* Valid options are:
* - $options['override'] Whether to override an existing file on copy or not (see copy())
* - $options['copy_on_windows'] Whether to copy files instead of links on Windows (see symlink())
* - $options['delete'] Whether to delete files that are not in the source directory (defaults to false)
* @param string $origin_dir The origin directory
* @param string $target_dir The target directory
* @param \Traversable|null $iterator A Traversable instance
* @param array $options An array of boolean options
* Valid options are:
* - $options['override'] Whether to override an existing file on copy or not (see copy())
* - $options['copy_on_windows'] Whether to copy files instead of links on Windows (see symlink())
* - $options['delete'] Whether to delete files that are not in the source directory (defaults to false)
*
* @throws \phpbb\filesystem\exception\filesystem_exception When the file cannot be copied.
* The filename which triggered the error can be

View file

@ -233,7 +233,7 @@ class helper
$path = str_replace(DIRECTORY_SEPARATOR, '/', $path);
}
trim($path, '/');
//$path = trim($path, '/'); // TODO: Check this
$path_parts = explode('/', $path);
$resolved = array();
$resolved_path = $prefix;

View file

@ -50,7 +50,7 @@ class finder
* Creates a new finder instance with its dependencies
*
* @param string $phpbb_root_path Path to the phpbb root directory
* @param \phpbb\cache\service $cache A cache instance or null
* @param \phpbb\cache\service|null $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

View file

@ -32,22 +32,15 @@ class legend implements \phpbb\groupposition\groupposition_interface
*/
protected $db;
/**
* User object
* @var \phpbb\user
*/
protected $user;
/**
* Constructor
*
* @param \phpbb\db\driver\driver_interface $db Database object
* @param \phpbb\user $user User object
*/
public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\user $user)
public function __construct(\phpbb\db\driver\driver_interface $db)
{
$this->db = $db;
$this->user = $user;
}
/**

View file

@ -36,12 +36,6 @@ class teampage implements \phpbb\groupposition\groupposition_interface
*/
protected $db;
/**
* User object
* @var \phpbb\user
*/
protected $user;
/**
* Cache object
* @var \phpbb\cache\driver\driver_interface
@ -52,13 +46,11 @@ class teampage implements \phpbb\groupposition\groupposition_interface
* Constructor
*
* @param \phpbb\db\driver\driver_interface $db Database object
* @param \phpbb\user $user User object
* @param \phpbb\cache\driver\driver_interface $cache Cache object
*/
public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\user $user, \phpbb\cache\driver\driver_interface $cache)
public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\cache\driver\driver_interface $cache)
{
$this->db = $db;
$this->user = $user;
$this->cache = $cache;
}

View file

@ -21,6 +21,7 @@ use phpbb\install\installer;
use phpbb\language\language;
use phpbb\request\request_interface;
use phpbb\template\template;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\StreamedResponse;
/**

View file

@ -47,7 +47,7 @@ class container_factory
/**
* The full phpBB container
*
* @var \Symfony\Component\DependencyInjection\ContainerInterface
* @var \Symfony\Component\DependencyInjection\ContainerInterface|null
*/
protected $container;

View file

@ -388,6 +388,7 @@ class database
OR PARAMETER = 'NLS_CHARACTERSET'";
$result = $db->sql_query($sql);
$stats = [];
while ($row = $db->sql_fetchrow($result))
{
$stats[$row['parameter']] = $row['value'];

View file

@ -21,7 +21,7 @@ use phpbb\install\helper\update_helper;
class compression_file_updater implements file_updater_interface
{
/**
* @var \compress
* @var \compress|null
*/
protected $compress;

View file

@ -21,7 +21,7 @@ use phpbb\install\helper\update_helper;
class ftp_file_updater implements file_updater_interface
{
/**
* @var \transfer
* @var \transfer|null
*/
protected $transfer;

Some files were not shown because too many files have changed in this diff Show more