From e11ae7e9cd5573658b763b1ef72cb889f547f2dd Mon Sep 17 00:00:00 2001 From: JoshyPHP Date: Fri, 1 May 2015 05:32:48 +0200 Subject: [ticket/13803] Hyphenated class names PHPBB3-13803 --- .../default/container/services_text_reparser.yml | 18 +++---- phpBB/phpbb/textreparser/forum_description.php | 63 ++++++++++++++++++++++ phpBB/phpbb/textreparser/forum_rules.php | 63 ++++++++++++++++++++++ phpBB/phpbb/textreparser/forumdescription.php | 63 ---------------------- phpBB/phpbb/textreparser/forumrules.php | 63 ---------------------- phpBB/phpbb/textreparser/group_description.php | 63 ++++++++++++++++++++++ phpBB/phpbb/textreparser/groupdescription.php | 63 ---------------------- phpBB/phpbb/textreparser/pm_text.php | 56 +++++++++++++++++++ phpBB/phpbb/textreparser/pmtext.php | 56 ------------------- phpBB/phpbb/textreparser/post_text.php | 56 +++++++++++++++++++ phpBB/phpbb/textreparser/posttext.php | 56 ------------------- 11 files changed, 310 insertions(+), 310 deletions(-) create mode 100644 phpBB/phpbb/textreparser/forum_description.php create mode 100644 phpBB/phpbb/textreparser/forum_rules.php delete mode 100644 phpBB/phpbb/textreparser/forumdescription.php delete mode 100644 phpBB/phpbb/textreparser/forumrules.php create mode 100644 phpBB/phpbb/textreparser/group_description.php delete mode 100644 phpBB/phpbb/textreparser/groupdescription.php create mode 100644 phpBB/phpbb/textreparser/pm_text.php delete mode 100644 phpBB/phpbb/textreparser/pmtext.php create mode 100644 phpBB/phpbb/textreparser/post_text.php delete mode 100644 phpBB/phpbb/textreparser/posttext.php (limited to 'phpBB') diff --git a/phpBB/config/default/container/services_text_reparser.yml b/phpBB/config/default/container/services_text_reparser.yml index 3113c02f6d..c458be12ac 100644 --- a/phpBB/config/default/container/services_text_reparser.yml +++ b/phpBB/config/default/container/services_text_reparser.yml @@ -1,62 +1,62 @@ services: text_reparser.admin_contact_info: - class: phpbb\textreparser\admincontactinfo + class: phpbb\textreparser\admin_contact_info arguments: - @dbal.conn tags: - { name: text_reparser.plugin } text_reparser.forum_description: - class: phpbb\textreparser\forumdescription + class: phpbb\textreparser\forum_description arguments: - @dbal.conn tags: - { name: text_reparser.plugin } text_reparser.forum_rules: - class: phpbb\textreparser\forumrules + class: phpbb\textreparser\forum_rules arguments: - @dbal.conn tags: - { name: text_reparser.plugin } text_reparser.group_description: - class: phpbb\textreparser\groupdescription + class: phpbb\textreparser\group_description arguments: - @dbal.conn tags: - { name: text_reparser.plugin } text_reparser.pm_text: - class: phpbb\textreparser\pmtext + class: phpbb\textreparser\pm_text arguments: - @dbal.conn tags: - { name: text_reparser.plugin } text_reparser.poll_option: - class: phpbb\textreparser\polloption + class: phpbb\textreparser\poll_option arguments: - @dbal.conn tags: - { name: text_reparser.plugin } text_reparser.poll_title: - class: phpbb\textreparser\polltitle + class: phpbb\textreparser\poll_title arguments: - @dbal.conn tags: - { name: text_reparser.plugin } text_reparser.post_text: - class: phpbb\textreparser\posttext + class: phpbb\textreparser\post_text arguments: - @dbal.conn tags: - { name: text_reparser.plugin } text_reparser.user_signature: - class: phpbb\textreparser\usersignature + class: phpbb\textreparser\user_signature arguments: - @dbal.conn tags: diff --git a/phpBB/phpbb/textreparser/forum_description.php b/phpBB/phpbb/textreparser/forum_description.php new file mode 100644 index 0000000000..493f8d6c94 --- /dev/null +++ b/phpBB/phpbb/textreparser/forum_description.php @@ -0,0 +1,63 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\textreparser; + +class forum_description extends base +{ + /** + * {@inheritdoc} + */ + public function get_max_id() + { + $sql = 'SELECT MAX(forum_id) AS max_id FROM ' . FORUMS_TABLE; + $result = $this->db->sql_query($sql); + $max_id = (int) $this->db->sql_fetchfield('max_id'); + $this->db->sql_freeresult($result); + + return $max_id; + } + + /** + * {@inheritdoc} + */ + protected function get_records($min_id, $max_id) + { + $sql = 'SELECT forum_id AS id, forum_desc AS text, forum_desc_uid AS bbcode_uid + FROM ' . FORUMS_TABLE . ' + WHERE forum_id BETWEEN ' . $min_id . ' AND ' . $max_id; + $result = $this->db->sql_query($sql); + while ($row = $this->db->sql_fetchrow($result)) + { + // Those fields are not saved to the database, we need to guess their original value + $row['enable_bbcode'] = !empty($row['bbcode_uid']); + $row['enable_smilies'] = (strpos($row['text'], '') !== false); + } + $records = $this->db->sql_fetchrowset($result); + $this->db->sql_freeresult($result); + + return $records; + } + + /** + * {@inheritdoc} + */ + protected function save_record(array $record) + { + $sql = 'UPDATE ' . FORUMS_TABLE . " + SET forum_desc = '" . $this->db->sql_escape($record['text']) . "' + WHERE forum_id = " . $record['id']; + $this->db->sql_query($sql); + } +} diff --git a/phpBB/phpbb/textreparser/forum_rules.php b/phpBB/phpbb/textreparser/forum_rules.php new file mode 100644 index 0000000000..5a3cc7b405 --- /dev/null +++ b/phpBB/phpbb/textreparser/forum_rules.php @@ -0,0 +1,63 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\textreparser; + +class forum_rules extends base +{ + /** + * {@inheritdoc} + */ + public function get_max_id() + { + $sql = 'SELECT MAX(forum_id) AS max_id FROM ' . FORUMS_TABLE; + $result = $this->db->sql_query($sql); + $max_id = (int) $this->db->sql_fetchfield('max_id'); + $this->db->sql_freeresult($result); + + return $max_id; + } + + /** + * {@inheritdoc} + */ + protected function get_records($min_id, $max_id) + { + $sql = 'SELECT forum_id AS id, forum_rules AS text, forum_rules_uid AS bbcode_uid + FROM ' . FORUMS_TABLE . ' + WHERE forum_id BETWEEN ' . $min_id . ' AND ' . $max_id; + $result = $this->db->sql_query($sql); + while ($row = $this->db->sql_fetchrow($result)) + { + // Those fields are not saved to the database, we need to guess their original value + $row['enable_bbcode'] = !empty($row['bbcode_uid']); + $row['enable_smilies'] = (strpos($row['text'], '') !== false); + } + $records = $this->db->sql_fetchrowset($result); + $this->db->sql_freeresult($result); + + return $records; + } + + /** + * {@inheritdoc} + */ + protected function save_record(array $record) + { + $sql = 'UPDATE ' . FORUMS_TABLE . " + SET forum_rules = '" . $this->db->sql_escape($record['text']) . "' + WHERE forum_id = " . $record['id']; + $this->db->sql_query($sql); + } +} diff --git a/phpBB/phpbb/textreparser/forumdescription.php b/phpBB/phpbb/textreparser/forumdescription.php deleted file mode 100644 index b715abd825..0000000000 --- a/phpBB/phpbb/textreparser/forumdescription.php +++ /dev/null @@ -1,63 +0,0 @@ - -* @license GNU General Public License, version 2 (GPL-2.0) -* -* For full copyright and license information, please see -* the docs/CREDITS.txt file. -* -*/ - -namespace phpbb\textreparser; - -class forumdescription extends base -{ - /** - * {@inheritdoc} - */ - public function get_max_id() - { - $sql = 'SELECT MAX(forum_id) AS max_id FROM ' . FORUMS_TABLE; - $result = $this->db->sql_query($sql); - $max_id = (int) $this->db->sql_fetchfield('max_id'); - $this->db->sql_freeresult($result); - - return $max_id; - } - - /** - * {@inheritdoc} - */ - protected function get_records($min_id, $max_id) - { - $sql = 'SELECT forum_id AS id, forum_desc AS text, forum_desc_uid AS bbcode_uid - FROM ' . FORUMS_TABLE . ' - WHERE forum_id BETWEEN ' . $min_id . ' AND ' . $max_id; - $result = $this->db->sql_query($sql); - while ($row = $this->db->sql_fetchrow($result)) - { - // Those fields are not saved to the database, we need to guess their original value - $row['enable_bbcode'] = !empty($row['bbcode_uid']); - $row['enable_smilies'] = (strpos($row['text'], '') !== false); - } - $records = $this->db->sql_fetchrowset($result); - $this->db->sql_freeresult($result); - - return $records; - } - - /** - * {@inheritdoc} - */ - protected function save_record(array $record) - { - $sql = 'UPDATE ' . FORUMS_TABLE . " - SET forum_desc = '" . $this->db->sql_escape($record['text']) . "' - WHERE forum_id = " . $record['id']; - $this->db->sql_query($sql); - } -} diff --git a/phpBB/phpbb/textreparser/forumrules.php b/phpBB/phpbb/textreparser/forumrules.php deleted file mode 100644 index c0538f6cce..0000000000 --- a/phpBB/phpbb/textreparser/forumrules.php +++ /dev/null @@ -1,63 +0,0 @@ - -* @license GNU General Public License, version 2 (GPL-2.0) -* -* For full copyright and license information, please see -* the docs/CREDITS.txt file. -* -*/ - -namespace phpbb\textreparser; - -class forumrules extends base -{ - /** - * {@inheritdoc} - */ - public function get_max_id() - { - $sql = 'SELECT MAX(forum_id) AS max_id FROM ' . FORUMS_TABLE; - $result = $this->db->sql_query($sql); - $max_id = (int) $this->db->sql_fetchfield('max_id'); - $this->db->sql_freeresult($result); - - return $max_id; - } - - /** - * {@inheritdoc} - */ - protected function get_records($min_id, $max_id) - { - $sql = 'SELECT forum_id AS id, forum_rules AS text, forum_rules_uid AS bbcode_uid - FROM ' . FORUMS_TABLE . ' - WHERE forum_id BETWEEN ' . $min_id . ' AND ' . $max_id; - $result = $this->db->sql_query($sql); - while ($row = $this->db->sql_fetchrow($result)) - { - // Those fields are not saved to the database, we need to guess their original value - $row['enable_bbcode'] = !empty($row['bbcode_uid']); - $row['enable_smilies'] = (strpos($row['text'], '') !== false); - } - $records = $this->db->sql_fetchrowset($result); - $this->db->sql_freeresult($result); - - return $records; - } - - /** - * {@inheritdoc} - */ - protected function save_record(array $record) - { - $sql = 'UPDATE ' . FORUMS_TABLE . " - SET forum_rules = '" . $this->db->sql_escape($record['text']) . "' - WHERE forum_id = " . $record['id']; - $this->db->sql_query($sql); - } -} diff --git a/phpBB/phpbb/textreparser/group_description.php b/phpBB/phpbb/textreparser/group_description.php new file mode 100644 index 0000000000..61354c832b --- /dev/null +++ b/phpBB/phpbb/textreparser/group_description.php @@ -0,0 +1,63 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\textreparser; + +class group_description extends base +{ + /** + * {@inheritdoc} + */ + public function get_max_id() + { + $sql = 'SELECT MAX(group_id) AS max_id FROM ' . GROUPS_TABLE; + $result = $this->db->sql_query($sql); + $max_id = (int) $this->db->sql_fetchfield('max_id'); + $this->db->sql_freeresult($result); + + return $max_id; + } + + /** + * {@inheritdoc} + */ + protected function get_records($min_id, $max_id) + { + $sql = 'SELECT group_id AS id, group_desc AS text, group_desc_uid AS bbcode_uid + FROM ' . GROUPS_TABLE . ' + WHERE group_id BETWEEN ' . $min_id . ' AND ' . $max_id; + $result = $this->db->sql_query($sql); + while ($row = $this->db->sql_fetchrow($result)) + { + // Those fields are not saved to the database, we need to guess their original value + $row['enable_bbcode'] = !empty($row['bbcode_uid']); + $row['enable_smilies'] = (strpos($row['text'], '') !== false); + } + $records = $this->db->sql_fetchrowset($result); + $this->db->sql_freeresult($result); + + return $records; + } + + /** + * {@inheritdoc} + */ + protected function save_record(array $record) + { + $sql = 'UPDATE ' . GROUPS_TABLE . " + SET group_desc = '" . $this->db->sql_escape($record['text']) . "' + WHERE group_id = " . $record['id']; + $this->db->sql_query($sql); + } +} diff --git a/phpBB/phpbb/textreparser/groupdescription.php b/phpBB/phpbb/textreparser/groupdescription.php deleted file mode 100644 index 608cc806b6..0000000000 --- a/phpBB/phpbb/textreparser/groupdescription.php +++ /dev/null @@ -1,63 +0,0 @@ - -* @license GNU General Public License, version 2 (GPL-2.0) -* -* For full copyright and license information, please see -* the docs/CREDITS.txt file. -* -*/ - -namespace phpbb\textreparser; - -class groupdescription extends base -{ - /** - * {@inheritdoc} - */ - public function get_max_id() - { - $sql = 'SELECT MAX(group_id) AS max_id FROM ' . GROUPS_TABLE; - $result = $this->db->sql_query($sql); - $max_id = (int) $this->db->sql_fetchfield('max_id'); - $this->db->sql_freeresult($result); - - return $max_id; - } - - /** - * {@inheritdoc} - */ - protected function get_records($min_id, $max_id) - { - $sql = 'SELECT group_id AS id, group_desc AS text, group_desc_uid AS bbcode_uid - FROM ' . GROUPS_TABLE . ' - WHERE group_id BETWEEN ' . $min_id . ' AND ' . $max_id; - $result = $this->db->sql_query($sql); - while ($row = $this->db->sql_fetchrow($result)) - { - // Those fields are not saved to the database, we need to guess their original value - $row['enable_bbcode'] = !empty($row['bbcode_uid']); - $row['enable_smilies'] = (strpos($row['text'], '') !== false); - } - $records = $this->db->sql_fetchrowset($result); - $this->db->sql_freeresult($result); - - return $records; - } - - /** - * {@inheritdoc} - */ - protected function save_record(array $record) - { - $sql = 'UPDATE ' . GROUPS_TABLE . " - SET group_desc = '" . $this->db->sql_escape($record['text']) . "' - WHERE group_id = " . $record['id']; - $this->db->sql_query($sql); - } -} diff --git a/phpBB/phpbb/textreparser/pm_text.php b/phpBB/phpbb/textreparser/pm_text.php new file mode 100644 index 0000000000..b02cb0083f --- /dev/null +++ b/phpBB/phpbb/textreparser/pm_text.php @@ -0,0 +1,56 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\textreparser; + +class pm_text extends base +{ + /** + * {@inheritdoc} + */ + public function get_max_id() + { + $sql = 'SELECT MAX(msg_id) AS max_id FROM ' . PRIVMSGS_TABLE; + $result = $this->db->sql_query($sql); + $max_id = (int) $this->db->sql_fetchfield('max_id'); + $this->db->sql_freeresult($result); + + return $max_id; + } + + /** + * {@inheritdoc} + */ + protected function get_records($min_id, $max_id) + { + $sql = 'SELECT msg_id AS id, enable_bbcode, enable_smilies, enable_magic_url, message_text AS text, bbcode_uid + FROM ' . PRIVMSGS_TABLE . ' + WHERE msg_id BETWEEN ' . $min_id . ' AND ' . $max_id; + $result = $this->db->sql_query($sql); + $records = $this->db->sql_fetchrowset($result); + $this->db->sql_freeresult($result); + + return $records; + } + + /** + * {@inheritdoc} + */ + protected function save_record(array $record) + { + $sql = 'UPDATE ' . PRIVMSGS_TABLE . " + SET message_text = '" . $this->db->sql_escape($record['text']) . "' + WHERE msg_id = " . $record['id']; + $this->db->sql_query($sql); + } +} diff --git a/phpBB/phpbb/textreparser/pmtext.php b/phpBB/phpbb/textreparser/pmtext.php deleted file mode 100644 index e1b27e60fe..0000000000 --- a/phpBB/phpbb/textreparser/pmtext.php +++ /dev/null @@ -1,56 +0,0 @@ - -* @license GNU General Public License, version 2 (GPL-2.0) -* -* For full copyright and license information, please see -* the docs/CREDITS.txt file. -* -*/ - -namespace phpbb\textreparser; - -class pmtext extends base -{ - /** - * {@inheritdoc} - */ - public function get_max_id() - { - $sql = 'SELECT MAX(msg_id) AS max_id FROM ' . PRIVMSGS_TABLE; - $result = $this->db->sql_query($sql); - $max_id = (int) $this->db->sql_fetchfield('max_id'); - $this->db->sql_freeresult($result); - - return $max_id; - } - - /** - * {@inheritdoc} - */ - protected function get_records($min_id, $max_id) - { - $sql = 'SELECT msg_id AS id, enable_bbcode, enable_smilies, enable_magic_url, message_text AS text, bbcode_uid - FROM ' . PRIVMSGS_TABLE . ' - WHERE msg_id BETWEEN ' . $min_id . ' AND ' . $max_id; - $result = $this->db->sql_query($sql); - $records = $this->db->sql_fetchrowset($result); - $this->db->sql_freeresult($result); - - return $records; - } - - /** - * {@inheritdoc} - */ - protected function save_record(array $record) - { - $sql = 'UPDATE ' . PRIVMSGS_TABLE . " - SET message_text = '" . $this->db->sql_escape($record['text']) . "' - WHERE msg_id = " . $record['id']; - $this->db->sql_query($sql); - } -} diff --git a/phpBB/phpbb/textreparser/post_text.php b/phpBB/phpbb/textreparser/post_text.php new file mode 100644 index 0000000000..288bb0966b --- /dev/null +++ b/phpBB/phpbb/textreparser/post_text.php @@ -0,0 +1,56 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\textreparser; + +class post_text extends base +{ + /** + * {@inheritdoc} + */ + public function get_max_id() + { + $sql = 'SELECT MAX(post_id) AS max_id FROM ' . POSTS_TABLE; + $result = $this->db->sql_query($sql); + $max_id = (int) $this->db->sql_fetchfield('max_id'); + $this->db->sql_freeresult($result); + + return $max_id; + } + + /** + * {@inheritdoc} + */ + protected function get_records($min_id, $max_id) + { + $sql = 'SELECT post_id AS id, enable_bbcode, enable_smilies, enable_magic_url, post_text AS text, bbcode_uid + FROM ' . POSTS_TABLE . ' + WHERE post_id BETWEEN ' . $min_id . ' AND ' . $max_id; + $result = $this->db->sql_query($sql); + $records = $this->db->sql_fetchrowset($result); + $this->db->sql_freeresult($result); + + return $records; + } + + /** + * {@inheritdoc} + */ + protected function save_record(array $record) + { + $sql = 'UPDATE ' . POSTS_TABLE . " + SET post_text = '" . $this->db->sql_escape($record['text']) . "' + WHERE post_id = " . $record['id']; + $this->db->sql_query($sql); + } +} diff --git a/phpBB/phpbb/textreparser/posttext.php b/phpBB/phpbb/textreparser/posttext.php deleted file mode 100644 index 916fc94bfa..0000000000 --- a/phpBB/phpbb/textreparser/posttext.php +++ /dev/null @@ -1,56 +0,0 @@ - -* @license GNU General Public License, version 2 (GPL-2.0) -* -* For full copyright and license information, please see -* the docs/CREDITS.txt file. -* -*/ - -namespace phpbb\textreparser; - -class posttext extends base -{ - /** - * {@inheritdoc} - */ - public function get_max_id() - { - $sql = 'SELECT MAX(post_id) AS max_id FROM ' . POSTS_TABLE; - $result = $this->db->sql_query($sql); - $max_id = (int) $this->db->sql_fetchfield('max_id'); - $this->db->sql_freeresult($result); - - return $max_id; - } - - /** - * {@inheritdoc} - */ - protected function get_records($min_id, $max_id) - { - $sql = 'SELECT post_id AS id, enable_bbcode, enable_smilies, enable_magic_url, post_text AS text, bbcode_uid - FROM ' . POSTS_TABLE . ' - WHERE post_id BETWEEN ' . $min_id . ' AND ' . $max_id; - $result = $this->db->sql_query($sql); - $records = $this->db->sql_fetchrowset($result); - $this->db->sql_freeresult($result); - - return $records; - } - - /** - * {@inheritdoc} - */ - protected function save_record(array $record) - { - $sql = 'UPDATE ' . POSTS_TABLE . " - SET post_text = '" . $this->db->sql_escape($record['text']) . "' - WHERE post_id = " . $record['id']; - $this->db->sql_query($sql); - } -} -- cgit v1.2.1