diff options
Diffstat (limited to 'phpBB/phpbb/config/db_text.php')
-rw-r--r-- | phpBB/phpbb/config/db_text.php | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/phpBB/phpbb/config/db_text.php b/phpBB/phpbb/config/db_text.php index b1ea112b53..818f6bdcc9 100644 --- a/phpBB/phpbb/config/db_text.php +++ b/phpBB/phpbb/config/db_text.php @@ -1,9 +1,13 @@ <?php /** * -* @package phpBB3 -* @copyright (c) 2013 phpBB Group -* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +* This file is part of the phpBB Forum Software package. +* +* @copyright (c) phpBB Limited <https://www.phpbb.com> +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. * */ @@ -13,14 +17,12 @@ namespace phpbb\config; * Manages configuration options with an arbitrary length value stored in a TEXT * column. In constrast to class \phpbb\config\db, values are never cached and * prefetched, but every get operation sends a query to the database. -* -* @package phpBB3 */ class db_text { /** * Database connection - * @var \phpbb\db\driver\driver + * @var \phpbb\db\driver\driver_interface */ protected $db; @@ -31,10 +33,10 @@ class db_text protected $table; /** - * @param \phpbb\db\driver\driver $db Database connection + * @param \phpbb\db\driver\driver_interface $db Database connection * @param string $table Table name */ - public function __construct(\phpbb\db\driver\driver $db, $table) + public function __construct(\phpbb\db\driver\driver_interface $db, $table) { $this->db = $db; $this->table = $this->db->sql_escape($table); @@ -98,13 +100,13 @@ class db_text $sql = 'UPDATE ' . $this->table . " SET config_value = '" . $this->db->sql_escape($value) . "' WHERE config_name = '" . $this->db->sql_escape($key) . "'"; - $result = $this->db->sql_query($sql); + $this->db->sql_query($sql); - if (!$this->db->sql_affectedrows($result)) + if (!$this->db->sql_affectedrows()) { $sql = 'INSERT INTO ' . $this->table . ' ' . $this->db->sql_build_array('INSERT', array( - 'config_name' => $key, - 'config_value' => $value, + 'config_name' => (string) $key, + 'config_value' => (string) $value, )); $this->db->sql_query($sql); } @@ -152,6 +154,6 @@ class db_text $sql = 'DELETE FROM ' . $this->table . ' WHERE ' . $this->db->sql_in_set('config_name', $keys, false, true); - $result = $this->db->sql_query($sql); + $this->db->sql_query($sql); } } |