diff options
Diffstat (limited to 'phpBB/phpbb/db')
-rw-r--r-- | phpBB/phpbb/db/driver/driver.php | 8 | ||||
-rw-r--r-- | phpBB/phpbb/db/driver/firebird.php | 8 | ||||
-rw-r--r-- | phpBB/phpbb/db/driver/mssql.php | 8 | ||||
-rw-r--r-- | phpBB/phpbb/db/driver/mssql_base.php | 8 | ||||
-rw-r--r-- | phpBB/phpbb/db/driver/mssql_odbc.php | 8 | ||||
-rw-r--r-- | phpBB/phpbb/db/driver/mssqlnative.php | 177 | ||||
-rw-r--r-- | phpBB/phpbb/db/driver/mysql.php | 8 | ||||
-rw-r--r-- | phpBB/phpbb/db/driver/mysql_base.php | 8 | ||||
-rw-r--r-- | phpBB/phpbb/db/driver/mysqli.php | 10 | ||||
-rw-r--r-- | phpBB/phpbb/db/driver/oracle.php | 8 | ||||
-rw-r--r-- | phpBB/phpbb/db/driver/postgres.php | 8 | ||||
-rw-r--r-- | phpBB/phpbb/db/driver/sqlite.php | 8 | ||||
-rw-r--r-- | phpBB/phpbb/db/migration/exception.php | 8 | ||||
-rw-r--r-- | phpBB/phpbb/db/migration/migration.php | 8 | ||||
-rw-r--r-- | phpBB/phpbb/db/migrator.php | 8 | ||||
-rw-r--r-- | phpBB/phpbb/db/sql_insert_buffer.php | 8 | ||||
-rw-r--r-- | phpBB/phpbb/db/tools.php | 8 |
17 files changed, 1 insertions, 306 deletions
diff --git a/phpBB/phpbb/db/driver/driver.php b/phpBB/phpbb/db/driver/driver.php index 53d39e9127..58d0b61519 100644 --- a/phpBB/phpbb/db/driver/driver.php +++ b/phpBB/phpbb/db/driver/driver.php @@ -10,14 +10,6 @@ namespace phpbb\db\driver; /** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - -/** * Database Abstraction Layer * @package dbal */ diff --git a/phpBB/phpbb/db/driver/firebird.php b/phpBB/phpbb/db/driver/firebird.php index aef75eab15..ed56a5d154 100644 --- a/phpBB/phpbb/db/driver/firebird.php +++ b/phpBB/phpbb/db/driver/firebird.php @@ -10,14 +10,6 @@ namespace phpbb\db\driver; /** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - -/** * Firebird/Interbase Database Abstraction Layer * Minimum Requirement is Firebird 2.1 * @package dbal diff --git a/phpBB/phpbb/db/driver/mssql.php b/phpBB/phpbb/db/driver/mssql.php index e1b41461e2..6ebc891673 100644 --- a/phpBB/phpbb/db/driver/mssql.php +++ b/phpBB/phpbb/db/driver/mssql.php @@ -10,14 +10,6 @@ namespace phpbb\db\driver; /** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - -/** * MSSQL Database Abstraction Layer * Minimum Requirement is MSSQL 2000+ * @package dbal diff --git a/phpBB/phpbb/db/driver/mssql_base.php b/phpBB/phpbb/db/driver/mssql_base.php index 57c4e0f1fd..113f1c6902 100644 --- a/phpBB/phpbb/db/driver/mssql_base.php +++ b/phpBB/phpbb/db/driver/mssql_base.php @@ -10,14 +10,6 @@ namespace phpbb\db\driver; /** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - -/** * MSSQL Database Base Abstraction Layer * @package dbal */ diff --git a/phpBB/phpbb/db/driver/mssql_odbc.php b/phpBB/phpbb/db/driver/mssql_odbc.php index b9881035c0..f8c70f1cd7 100644 --- a/phpBB/phpbb/db/driver/mssql_odbc.php +++ b/phpBB/phpbb/db/driver/mssql_odbc.php @@ -10,14 +10,6 @@ namespace phpbb\db\driver; /** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - -/** * Unified ODBC functions * Unified ODBC functions support any database having ODBC driver, for example Adabas D, IBM DB2, iODBC, Solid, Sybase SQL Anywhere... * Here we only support MSSQL Server 2000+ because of the provided schema diff --git a/phpBB/phpbb/db/driver/mssqlnative.php b/phpBB/phpbb/db/driver/mssqlnative.php index 2eb625fb11..125db9c8d4 100644 --- a/phpBB/phpbb/db/driver/mssqlnative.php +++ b/phpBB/phpbb/db/driver/mssqlnative.php @@ -14,183 +14,6 @@ namespace phpbb\db\driver; /** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - -/** - * Prior to version 1.1 the SQL Server Native PHP driver didn't support sqlsrv_num_rows, or cursor based seeking so we recall all rows into an array - * and maintain our own cursor index into that array. - */ -class result_mssqlnative -{ - public function result_mssqlnative($queryresult = false) - { - $this->m_cursor = 0; - $this->m_rows = array(); - $this->m_num_fields = sqlsrv_num_fields($queryresult); - $this->m_field_meta = sqlsrv_field_metadata($queryresult); - - while ($row = sqlsrv_fetch_array($queryresult, SQLSRV_FETCH_ASSOC)) - { - if ($row !== null) - { - foreach($row as $k => $v) - { - if (is_object($v) && method_exists($v, 'format')) - { - $row[$k] = $v->format("Y-m-d\TH:i:s\Z"); - } - } - $this->m_rows[] = $row;//read results into memory, cursors are not supported - } - } - - $this->m_row_count = sizeof($this->m_rows); - } - - private function array_to_obj($array, &$obj) - { - foreach ($array as $key => $value) - { - if (is_array($value)) - { - $obj->$key = new \stdClass(); - array_to_obj($value, $obj->$key); - } - else - { - $obj->$key = $value; - } - } - return $obj; - } - - public function fetch($mode = SQLSRV_FETCH_BOTH, $object_class = 'stdClass') - { - if ($this->m_cursor >= $this->m_row_count || $this->m_row_count == 0) - { - return false; - } - - $ret = false; - $arr_num = array(); - - if ($mode == SQLSRV_FETCH_NUMERIC || $mode == SQLSRV_FETCH_BOTH) - { - foreach($this->m_rows[$this->m_cursor] as $key => $value) - { - $arr_num[] = $value; - } - } - - switch ($mode) - { - case SQLSRV_FETCH_ASSOC: - $ret = $this->m_rows[$this->m_cursor]; - break; - case SQLSRV_FETCH_NUMERIC: - $ret = $arr_num; - break; - case 'OBJECT': - $ret = $this->array_to_obj($this->m_rows[$this->m_cursor], $o = new $object_class); - break; - case SQLSRV_FETCH_BOTH: - default: - $ret = $this->m_rows[$this->m_cursor] + $arr_num; - break; - } - $this->m_cursor++; - return $ret; - } - - public function get($pos, $fld) - { - return $this->m_rows[$pos][$fld]; - } - - public function num_rows() - { - return $this->m_row_count; - } - - public function seek($iRow) - { - $this->m_cursor = min($iRow, $this->m_row_count); - } - - public function num_fields() - { - return $this->m_num_fields; - } - - public function field_name($nr) - { - $arr_keys = array_keys($this->m_rows[0]); - return $arr_keys[$nr]; - } - - public function field_type($nr) - { - $i = 0; - $int_type = -1; - $str_type = ''; - - foreach ($this->m_field_meta as $meta) - { - if ($nr == $i) - { - $int_type = $meta['Type']; - break; - } - $i++; - } - - //http://msdn.microsoft.com/en-us/library/cc296183.aspx contains type table - switch ($int_type) - { - case SQLSRV_SQLTYPE_BIGINT: $str_type = 'bigint'; break; - case SQLSRV_SQLTYPE_BINARY: $str_type = 'binary'; break; - case SQLSRV_SQLTYPE_BIT: $str_type = 'bit'; break; - case SQLSRV_SQLTYPE_CHAR: $str_type = 'char'; break; - case SQLSRV_SQLTYPE_DATETIME: $str_type = 'datetime'; break; - case SQLSRV_SQLTYPE_DECIMAL/*($precision, $scale)*/: $str_type = 'decimal'; break; - case SQLSRV_SQLTYPE_FLOAT: $str_type = 'float'; break; - case SQLSRV_SQLTYPE_IMAGE: $str_type = 'image'; break; - case SQLSRV_SQLTYPE_INT: $str_type = 'int'; break; - case SQLSRV_SQLTYPE_MONEY: $str_type = 'money'; break; - case SQLSRV_SQLTYPE_NCHAR/*($charCount)*/: $str_type = 'nchar'; break; - case SQLSRV_SQLTYPE_NUMERIC/*($precision, $scale)*/: $str_type = 'numeric'; break; - case SQLSRV_SQLTYPE_NVARCHAR/*($charCount)*/: $str_type = 'nvarchar'; break; - case SQLSRV_SQLTYPE_NTEXT: $str_type = 'ntext'; break; - case SQLSRV_SQLTYPE_REAL: $str_type = 'real'; break; - case SQLSRV_SQLTYPE_SMALLDATETIME: $str_type = 'smalldatetime'; break; - case SQLSRV_SQLTYPE_SMALLINT: $str_type = 'smallint'; break; - case SQLSRV_SQLTYPE_SMALLMONEY: $str_type = 'smallmoney'; break; - case SQLSRV_SQLTYPE_TEXT: $str_type = 'text'; break; - case SQLSRV_SQLTYPE_TIMESTAMP: $str_type = 'timestamp'; break; - case SQLSRV_SQLTYPE_TINYINT: $str_type = 'tinyint'; break; - case SQLSRV_SQLTYPE_UNIQUEIDENTIFIER: $str_type = 'uniqueidentifier'; break; - case SQLSRV_SQLTYPE_UDT: $str_type = 'UDT'; break; - case SQLSRV_SQLTYPE_VARBINARY/*($byteCount)*/: $str_type = 'varbinary'; break; - case SQLSRV_SQLTYPE_VARCHAR/*($charCount)*/: $str_type = 'varchar'; break; - case SQLSRV_SQLTYPE_XML: $str_type = 'xml'; break; - default: $str_type = $int_type; - } - return $str_type; - } - - public function free() - { - unset($this->m_rows); - return; - } -} - -/** * @package dbal */ class mssqlnative extends \phpbb\db\driver\mssql_base diff --git a/phpBB/phpbb/db/driver/mysql.php b/phpBB/phpbb/db/driver/mysql.php index d215453ccb..e311f0dd74 100644 --- a/phpBB/phpbb/db/driver/mysql.php +++ b/phpBB/phpbb/db/driver/mysql.php @@ -10,14 +10,6 @@ namespace phpbb\db\driver; /** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - -/** * MySQL4 Database Abstraction Layer * Compatible with: * MySQL 3.23+ diff --git a/phpBB/phpbb/db/driver/mysql_base.php b/phpBB/phpbb/db/driver/mysql_base.php index 8f2f66674b..87b6d153a9 100644 --- a/phpBB/phpbb/db/driver/mysql_base.php +++ b/phpBB/phpbb/db/driver/mysql_base.php @@ -10,14 +10,6 @@ namespace phpbb\db\driver; /** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - -/** * Abstract MySQL Database Base Abstraction Layer * @package dbal */ diff --git a/phpBB/phpbb/db/driver/mysqli.php b/phpBB/phpbb/db/driver/mysqli.php index 6144dba0c4..adc8f96302 100644 --- a/phpBB/phpbb/db/driver/mysqli.php +++ b/phpBB/phpbb/db/driver/mysqli.php @@ -10,14 +10,6 @@ namespace phpbb\db\driver; /** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - -/** * MySQLi Database Abstraction Layer * mysqli-extension has to be compiled with: * MySQL 4.1+ or MySQL 5.0+ @@ -31,7 +23,7 @@ class mysqli extends \phpbb\db\driver\mysql_base /** * Connect to server */ - function sql_connect($sqlserver, $sqluser, $sqlpassword, $database, $port = false, $persistency = false , $new_link = false) + function sql_connect($sqlserver, $sqluser, $sqlpassword, $database, $port = false, $persistency = false, $new_link = false) { if (!function_exists('mysqli_connect')) { diff --git a/phpBB/phpbb/db/driver/oracle.php b/phpBB/phpbb/db/driver/oracle.php index 4fba654d1e..36ed43d4a7 100644 --- a/phpBB/phpbb/db/driver/oracle.php +++ b/phpBB/phpbb/db/driver/oracle.php @@ -10,14 +10,6 @@ namespace phpbb\db\driver; /** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - -/** * Oracle Database Abstraction Layer * @package dbal */ diff --git a/phpBB/phpbb/db/driver/postgres.php b/phpBB/phpbb/db/driver/postgres.php index 5cd6578d87..5dbd1ca74f 100644 --- a/phpBB/phpbb/db/driver/postgres.php +++ b/phpBB/phpbb/db/driver/postgres.php @@ -10,14 +10,6 @@ namespace phpbb\db\driver; /** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - -/** * PostgreSQL Database Abstraction Layer * Minimum Requirement is Version 7.3+ * @package dbal diff --git a/phpBB/phpbb/db/driver/sqlite.php b/phpBB/phpbb/db/driver/sqlite.php index 55a33284f2..59ec895c0f 100644 --- a/phpBB/phpbb/db/driver/sqlite.php +++ b/phpBB/phpbb/db/driver/sqlite.php @@ -10,14 +10,6 @@ namespace phpbb\db\driver; /** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - -/** * Sqlite Database Abstraction Layer * Minimum Requirement: 2.8.2+ * @package dbal diff --git a/phpBB/phpbb/db/migration/exception.php b/phpBB/phpbb/db/migration/exception.php index 58e29b5218..cfe546d1ab 100644 --- a/phpBB/phpbb/db/migration/exception.php +++ b/phpBB/phpbb/db/migration/exception.php @@ -10,14 +10,6 @@ namespace phpbb\db\migration; /** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - -/** * The migrator is responsible for applying new migrations in the correct order. * * @package db diff --git a/phpBB/phpbb/db/migration/migration.php b/phpBB/phpbb/db/migration/migration.php index aff3837279..b32de00871 100644 --- a/phpBB/phpbb/db/migration/migration.php +++ b/phpBB/phpbb/db/migration/migration.php @@ -10,14 +10,6 @@ namespace phpbb\db\migration; /** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - -/** * Abstract base class for database migrations * * Each migration consists of a set of schema and data changes to be implemented diff --git a/phpBB/phpbb/db/migrator.php b/phpBB/phpbb/db/migrator.php index 47e1406043..3b966b7fe3 100644 --- a/phpBB/phpbb/db/migrator.php +++ b/phpBB/phpbb/db/migrator.php @@ -10,14 +10,6 @@ namespace phpbb\db; /** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - -/** * The migrator is responsible for applying new migrations in the correct order. * * @package db diff --git a/phpBB/phpbb/db/sql_insert_buffer.php b/phpBB/phpbb/db/sql_insert_buffer.php index 7bbd213bdc..41026ad425 100644 --- a/phpBB/phpbb/db/sql_insert_buffer.php +++ b/phpBB/phpbb/db/sql_insert_buffer.php @@ -10,14 +10,6 @@ namespace phpbb\db; /** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - -/** * Collects rows for insert into a database until the buffer size is reached. * Then flushes the buffer to the database and starts over again. * diff --git a/phpBB/phpbb/db/tools.php b/phpBB/phpbb/db/tools.php index d9bd8cf568..4360c89ac3 100644 --- a/phpBB/phpbb/db/tools.php +++ b/phpBB/phpbb/db/tools.php @@ -10,14 +10,6 @@ namespace phpbb\db; /** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - -/** * Database Tools for handling cross-db actions such as altering columns, etc. * Currently not supported is returning SQL for creating tables. * |