mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-30 21:40:43 +02:00
[ticket/10966] Introduce MSSQL base class for native and ODBC
PHPBB3-10966
This commit is contained in:
65
phpBB/includes/db/driver/mssql_base.php
Normal file
65
phpBB/includes/db/driver/mssql_base.php
Normal file
@@ -0,0 +1,65 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* @package dbal
|
||||
* @copyright (c) 2013 phpBB Group
|
||||
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
if (!defined('IN_PHPBB'))
|
||||
{
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* MSSQL Database Base Abstraction Layer
|
||||
* @package dbal
|
||||
*/
|
||||
abstract class phpbb_db_driver_mssql_base extends phpbb_db_driver
|
||||
{
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function sql_concatenate($expr1, $expr2)
|
||||
{
|
||||
return $expr1 . ' + ' . $expr2;
|
||||
}
|
||||
|
||||
/**
|
||||
* Escape string used in sql query
|
||||
*/
|
||||
function sql_escape($msg)
|
||||
{
|
||||
return str_replace(array("'", "\0"), array("''", ''), $msg);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
function sql_lower_text($column_name)
|
||||
{
|
||||
return "LOWER(SUBSTRING($column_name, 1, DATALENGTH($column_name)))";
|
||||
}
|
||||
|
||||
/**
|
||||
* Build LIKE expression
|
||||
* @access private
|
||||
*/
|
||||
function _sql_like_expression($expression)
|
||||
{
|
||||
return $expression . " ESCAPE '\\'";
|
||||
}
|
||||
|
||||
/**
|
||||
* Build db-specific query data
|
||||
* @access private
|
||||
*/
|
||||
function _sql_custom_build($stage, $data)
|
||||
{
|
||||
return $data;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user