fix calendar css, take 2. (#213)
[openemr.git] / interface / modules / zend_modules / library / Zend / Db / Adapter / Platform / IbmDb2.php
blob4f6ea19e656b2f74ea8a1a123d24c947f4984057
1 <?php
2 /**
3 * Zend Framework (http://framework.zend.com/)
5 * @link http://github.com/zendframework/zf2 for the canonical source repository
6 * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
7 * @license http://framework.zend.com/license/new-bsd New BSD License
8 */
10 namespace Zend\Db\Adapter\Platform;
12 class IbmDb2 extends AbstractPlatform
14 /**
15 * @var string
17 protected $identifierSeparator = '.';
19 /**
20 * @param array $options
22 public function __construct($options = array())
24 if (isset($options['quote_identifiers'])
25 && ($options['quote_identifiers'] == false
26 || $options['quote_identifiers'] === 'false')
27 ) {
28 $this->quoteIdentifiers = false;
31 if (isset($options['identifier_separator'])) {
32 $this->identifierSeparator = $options['identifier_separator'];
36 /**
37 * {@inheritDoc}
39 public function getName()
41 return 'IBM DB2';
44 /**
45 * {@inheritDoc}
47 public function quoteIdentifierChain($identifierChain)
49 if ($this->quoteIdentifiers === false) {
50 return (is_array($identifierChain)) ? implode($this->identifierSeparator, $identifierChain) : $identifierChain;
52 $identifierChain = str_replace('"', '\\"', $identifierChain);
53 if (is_array($identifierChain)) {
54 $identifierChain = implode('"' . $this->identifierSeparator . '"', $identifierChain);
56 return '"' . $identifierChain . '"';
59 /**
60 * {@inheritDoc}
62 public function quoteValue($value)
64 if (function_exists('db2_escape_string')) {
65 return '\'' . db2_escape_string($value) . '\'';
67 trigger_error(
68 'Attempting to quote a value in ' . __CLASS__ . ' without extension/driver support '
69 . 'can introduce security vulnerabilities in a production environment.'
71 return '\'' . str_replace("'", "''", $value) . '\'';
74 /**
75 * {@inheritDoc}
77 public function quoteTrustedValue($value)
79 if (function_exists('db2_escape_string')) {
80 return '\'' . db2_escape_string($value) . '\'';
82 return '\'' . str_replace("'", "''", $value) . '\'';
85 /**
86 * {@inheritDoc}
88 public function getIdentifierSeparator()
90 return $this->identifierSeparator;