| | |
| | | <?php |
| | | |
| | | /* |
| | | /** |
| | | +-----------------------------------------------------------------------+ |
| | | | program/include/rcube_db_sqlsrv.php | |
| | | | | |
| | |
| | | * |
| | | * This is a wrapper for the PHP PDO |
| | | * |
| | | * @package Database |
| | | * @version 1.0 |
| | | * @package Database |
| | | * @version 1.0 |
| | | */ |
| | | class rcube_db_sqlsrv extends rcube_db |
| | | { |
| | | /** |
| | | * Driver initialization |
| | | */ |
| | | protected function init() |
| | | { |
| | | $this->options['identifier_start'] = '['; |
| | | $this->options['identifier_end'] = ']'; |
| | | } |
| | | |
| | | /** |
| | | * Database character set setting |
| | | */ |
| | | protected function set_charset($charset) |
| | | { |
| | | // UTF-8 is default |
| | | } |
| | | |
| | | |
| | | /** |
| | | * Return SQL function for current time and date |
| | |
| | | return "getdate()"; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * Return SQL statement to convert a field value into a unix timestamp |
| | | * |
| | | * This method is deprecated and should not be used anymore due to limitations |
| | | * of timestamp functions in Mysql (year 2038 problem) |
| | | * |
| | | * @param string $field Field name |
| | | * @param string $field Field name |
| | | * |
| | | * @return string SQL statement to use in query |
| | | * @return string SQL statement to use in query |
| | | * @deprecated |
| | | */ |
| | | public function unixtimestamp($field) |
| | | { |
| | | return "DATEDIFF(second, '19700101', $field) + DATEDIFF(second, GETDATE(), GETUTCDATE())"; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * Abstract SQL statement for value concatenation |
| | |
| | | return '(' . join('+', $args) . ')'; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * Adds TOP (LIMIT,OFFSET) clause to the query |
| | | * |
| | | * @param string $query SQL query |
| | | * @param int $limit Number of rows |
| | | * @param int $offset Offset |
| | | * |
| | | * @return string SQL query |
| | | */ |
| | | protected function set_limit($query, $limit = 0, $offset = 0) |
| | | { |
| | |
| | | } |
| | | |
| | | /** |
| | | * Returns PDO DSN string from DSN array (parse_dsn() result) |
| | | * Returns PDO DSN string from DSN array |
| | | */ |
| | | protected function dsn_string($dsn) |
| | | { |