Subversion Repositories PHPX

Rev

Rev 27 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 27 Rev 29
Line 1... Line 1...
1
<?php
1
<?php
2
2
3
require_once 'lib/Db/Database.php';
3
require_once __DIR__ . '/Database.php';
4
4
5
class ODBCDB extends Database
5
class ODBCDB extends Database
6
{
6
{
7
  /**
7
  /**
8
   * ODBC alias
8
   * ODBC alias
Line 10... Line 10...
10
   */
10
   */
11
  protected $_alias;
11
  protected $_alias;
12
 
12
 
13
  public function __construct()
13
  public function __construct()
14
  {
14
  {
15
    $this->_connection = @odbc_connect($this->_alias, "" ,"");
15
//     $this->_connection = @odbc_connect($this->_alias, $this->_username, $this->_password);
-
 
16
    $this->_dsn = 'odbc:' . $this->_alias;
-
 
17
    parent::__construct();
16
  }
18
  }
17
 
19
 
18
  /**
20
  /**
19
   * Escapes a database name so that it can be used in a query.
-
 
20
   *
-
 
21
   * @param string $name
-
 
22
   *   The name to be escaped
-
 
23
   * @return string
-
 
24
   *   The escaped name
-
 
25
   */
-
 
26
  public function escapeName($name)
-
 
27
  {
-
 
28
    return '[' . $name . ']';
-
 
29
  }
-
 
30
-
 
31
  /**
-
 
32
   * (non-PHPdoc)
-
 
33
   * @see Database::_escapeAliasArray()
-
 
34
   */
-
 
35
  protected function _escapeAliasArray(array &$array)
-
 
36
  {
-
 
37
    foreach ($array as $column => &$value)
-
 
38
    {
-
 
39
      $value = $value . ' AS [' . $column . ']';
-
 
40
    }
-
 
41
 
-
 
42
    return $array;
-
 
43
  }
-
 
44
-
 
45
  /**
-
 
46
   * (non-PHPdoc)
21
   * (non-PHPdoc)
47
   * @see Database::_escapeValueArray()
22
   * @see Database::_escapeValueArray()
48
   */
23
   */
49
  protected function _escapeValueArray(array &$array, $suffix = '', array &$escape = array('`', '`'))
24
  protected function _escapeValueArray(array &$array, $suffix = '', array &$escape = array('`', '`'))
50
  {
25
  {