diff options
Diffstat (limited to 'phpBB/phpbb/db/driver/mssql.php')
-rw-r--r-- | phpBB/phpbb/db/driver/mssql.php | 46 |
1 files changed, 15 insertions, 31 deletions
diff --git a/phpBB/phpbb/db/driver/mssql.php b/phpBB/phpbb/db/driver/mssql.php index 89c2c2351b..588cd7a7e8 100644 --- a/phpBB/phpbb/db/driver/mssql.php +++ b/phpBB/phpbb/db/driver/mssql.php @@ -7,25 +7,19 @@ * */ -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} +namespace phpbb\db\driver; /** * MSSQL Database Abstraction Layer * Minimum Requirement is MSSQL 2000+ * @package dbal */ -class phpbb_db_driver_mssql extends phpbb_db_driver +class mssql extends \phpbb\db\driver\driver { var $connect_error = ''; /** - * Connect to server + * {@inheritDoc} */ function sql_connect($sqlserver, $sqluser, $sqlpassword, $database, $port = false, $persistency = false, $new_link = false) { @@ -61,10 +55,7 @@ class phpbb_db_driver_mssql extends phpbb_db_driver } /** - * Version information about used database - * @param bool $raw if true, only return the fetched sql_server_version - * @param bool $use_cache If true, it is safe to retrieve the value from the cache - * @return string sql server version + * {@inheritDoc} */ function sql_server_info($raw = false, $use_cache = true) { @@ -130,13 +121,7 @@ class phpbb_db_driver_mssql extends phpbb_db_driver } /** - * Base query method - * - * @param string $query Contains the SQL query which shall be executed - * @param int $cache_ttl Either 0 to avoid caching or the time in seconds which the result shall be kept in cache - * @return mixed When casted to bool the returned value returns true on success and false on failure - * - * @access public + * {@inheritDoc} */ function sql_query($query = '', $cache_ttl = 0) { @@ -221,7 +206,7 @@ class phpbb_db_driver_mssql extends phpbb_db_driver } /** - * Return number of affected rows + * {@inheritDoc} */ function sql_affectedrows() { @@ -229,7 +214,7 @@ class phpbb_db_driver_mssql extends phpbb_db_driver } /** - * Fetch current row + * {@inheritDoc} */ function sql_fetchrow($query_id = false) { @@ -257,7 +242,7 @@ class phpbb_db_driver_mssql extends phpbb_db_driver { foreach ($row as $key => $value) { - $row[$key] = ($value === ' ' || $value === NULL) ? '' : $value; + $row[$key] = ($value === ' ' || $value === null) ? '' : $value; } } @@ -265,8 +250,7 @@ class phpbb_db_driver_mssql extends phpbb_db_driver } /** - * Seek to given row number - * rownum is zero-based + * {@inheritDoc} */ function sql_rowseek($rownum, &$query_id) { @@ -286,7 +270,7 @@ class phpbb_db_driver_mssql extends phpbb_db_driver } /** - * Get last inserted id after insert statement + * {@inheritDoc} */ function sql_nextid() { @@ -305,7 +289,7 @@ class phpbb_db_driver_mssql extends phpbb_db_driver } /** - * Free sql result + * {@inheritDoc} */ function sql_freeresult($query_id = false) { @@ -316,14 +300,14 @@ class phpbb_db_driver_mssql extends phpbb_db_driver $query_id = $this->query_result; } - if ($cache && $cache->sql_exists($query_id)) + if ($cache && !is_object($query_id) && $cache->sql_exists($query_id)) { return $cache->sql_freeresult($query_id); } - if (isset($this->open_queries[$query_id])) + if (isset($this->open_queries[(int) $query_id])) { - unset($this->open_queries[$query_id]); + unset($this->open_queries[(int) $query_id]); return @mssql_free_result($query_id); } @@ -331,7 +315,7 @@ class phpbb_db_driver_mssql extends phpbb_db_driver } /** - * Escape string used in sql query + * {@inheritDoc} */ function sql_escape($msg) { |