source: sandbox/2.5.1-evolucao/phpgwapi/inc/adodb/drivers/adodb-db2ora.inc.php @ 8222

Revision 8222, 1.6 KB checked in by angelo, 11 years ago (diff)

Ticket #3491 - Compatibilizar Expresso com novas versoes do PHP

Line 
1<?php
2/*
3V5.18 3 Sep 2012  (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
4  Released under both BSD license and Lesser GPL library license.
5  Whenever there is any discrepancy between the two licenses,
6  the BSD license will take precedence.
7Set tabs to 4 for best viewing.
8 
9  Latest version is available at http://adodb.sourceforge.net
10 
11  Microsoft Visual FoxPro data driver. Requires ODBC. Works only on MS Windows.
12*/
13
14// security - hide paths
15if (!defined('ADODB_DIR')) die();
16include(ADODB_DIR."/drivers/adodb-db2.inc.php");
17
18
19if (!defined('ADODB_DB2OCI')){
20define('ADODB_DB2OCI',1);
21
22
23function _colontrack($p)
24{
25global $_COLONARR,$_COLONSZ;
26        $v = (integer) substr($p,1);
27        if ($v > $_COLONSZ) return $p;
28        $_COLONARR[] = $v;
29        return '?';
30}
31
32function _colonscope($sql,$arr)
33{
34global $_COLONARR,$_COLONSZ;
35
36        $_COLONARR = array();
37        $_COLONSZ = sizeof($arr);
38       
39        $sql2 = preg_replace("/(:[0-9]+)/e","_colontrack('\\1')",$sql);
40       
41        if (empty($_COLONARR)) return array($sql,$arr);
42       
43        foreach($_COLONARR as $k => $v) {
44                $arr2[] = $arr[$v];
45        }
46       
47        return array($sql2,$arr2);
48}
49
50class ADODB_db2oci extends ADODB_db2 {
51        var $databaseType = "db2oci";   
52        var $sysTimeStamp = 'sysdate';
53        var $sysDate = 'trunc(sysdate)';
54       
55        function ADODB_db2oci()
56        {
57                $this->ADODB_db2();
58        }
59       
60       
61        function _Execute($sql, $inputarr)
62        {
63                if ($inputarr) list($sql,$inputarr) = _colonscope($sql, $inputarr);
64                return parent::_Execute($sql, $inputarr);
65        }
66};
67 
68
69class  ADORecordSet_db2oci extends ADORecordSet_odbc { 
70       
71        var $databaseType = "db2oci";           
72       
73        function ADORecordSet_db2oci($id,$mode=false)
74        {
75                return $this->ADORecordSet_db2($id,$mode);
76        }
77}
78
79} //define
80?>
Note: See TracBrowser for help on using the repository browser.