Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/vendor/adodb/adodb-php/drivers/adodb-db2ora.inc.php
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2020-02-01 09:05:48 +0100
committerAndreas Baumann <mail@andreasbaumann.cc>2020-02-01 09:05:48 +0100
commit6854cb3f4d8219cf1829e32122eb2502a916eae9 (patch)
tree350feb504587d932e02837a1442b059759927646 /vendor/adodb/adodb-php/drivers/adodb-db2ora.inc.php
initial checkin
Diffstat (limited to 'vendor/adodb/adodb-php/drivers/adodb-db2ora.inc.php')
-rw-r--r--vendor/adodb/adodb-php/drivers/adodb-db2ora.inc.php86
1 files changed, 86 insertions, 0 deletions
diff --git a/vendor/adodb/adodb-php/drivers/adodb-db2ora.inc.php b/vendor/adodb/adodb-php/drivers/adodb-db2ora.inc.php
new file mode 100644
index 0000000..75cc9f5
--- /dev/null
+++ b/vendor/adodb/adodb-php/drivers/adodb-db2ora.inc.php
@@ -0,0 +1,86 @@
+<?php
+/*
+@version v5.20.14 06-Jan-2019
+@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
+@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
+ Released under both BSD license and Lesser GPL library license.
+ Whenever there is any discrepancy between the two licenses,
+ the BSD license will take precedence.
+Set tabs to 4 for best viewing.
+
+ Latest version is available at http://adodb.org/
+
+ Microsoft Visual FoxPro data driver. Requires ODBC. Works only on MS Windows.
+*/
+
+// security - hide paths
+if (!defined('ADODB_DIR')) die();
+include(ADODB_DIR."/drivers/adodb-db2.inc.php");
+
+
+if (!defined('ADODB_DB2OCI')){
+define('ADODB_DB2OCI',1);
+
+
+/**
+ * Callback function for preg_replace in _colonscope()
+ * @param array $p matched patterns
+ * return string '?' if parameter replaced, :N if not
+ */
+function _colontrack($p)
+{
+ global $_COLONARR, $_COLONSZ;
+ $v = (integer) substr($p[1], 1);
+ if ($v > $_COLONSZ) return $p[1];
+ $_COLONARR[] = $v;
+ return '?';
+}
+
+/**
+ * smart remapping of :0, :1 bind vars to ? ?
+ * @param string $sql SQL statement
+ * @param array $arr parameters
+ * @return array
+ */
+function _colonscope($sql,$arr)
+{
+global $_COLONARR,$_COLONSZ;
+
+ $_COLONARR = array();
+ $_COLONSZ = sizeof($arr);
+
+ $sql2 = preg_replace_callback('/(:[0-9]+)/', '_colontrack', $sql);
+
+ if (empty($_COLONARR)) return array($sql,$arr);
+
+ foreach($_COLONARR as $k => $v) {
+ $arr2[] = $arr[$v];
+ }
+
+ return array($sql2,$arr2);
+}
+
+class ADODB_db2oci extends ADODB_db2 {
+ var $databaseType = "db2oci";
+ var $sysTimeStamp = 'sysdate';
+ var $sysDate = 'trunc(sysdate)';
+
+ function _Execute($sql, $inputarr = false)
+ {
+ if ($inputarr) list($sql,$inputarr) = _colonscope($sql, $inputarr);
+ return parent::_Execute($sql, $inputarr);
+ }
+};
+
+
+class ADORecordSet_db2oci extends ADORecordSet_odbc {
+
+ var $databaseType = "db2oci";
+
+ function __construct($id,$mode=false)
+ {
+ return parent::__construct($id,$mode);
+ }
+}
+
+} //define