cvs: pear /MDB2/MDB2/Driver oci8.php

From: Date: Sat, 21 May 2005 23:02:52 +0000
Subject: cvs: pear /MDB2/MDB2/Driver oci8.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-32008@lists.php.net to get a copy of this message
lsmith Sat May 21 19:02:52 2005 EDT Modified files: /pear/MDB2/MDB2/Driver oci8.php Log: - use new quote() parameter - renamed execute() to _execute() since common provides some common functionality via execute() http://cvs.php.net/diff.php/pear/MDB2/MDB2/Driver/oci8.php?r1=1.74&r2=1.75&ty=u Index: pear/MDB2/MDB2/Driver/oci8.php diff -u pear/MDB2/MDB2/Driver/oci8.php:1.74 pear/MDB2/MDB2/Driver/oci8.php:1.75 --- pear/MDB2/MDB2/Driver/oci8.php:1.74 Wed Apr 27 10:13:40 2005 +++ pear/MDB2/MDB2/Driver/oci8.php Sat May 21 19:02:52 2005 @@ -43,7 +43,7 @@ // | Author: Lukas Smith <smith@backendmedia.com> | // +----------------------------------------------------------------------+ -// $Id: oci8.php,v 1.74 2005/04/27 14:13:40 lsmith Exp $ +// $Id: oci8.php,v 1.75 2005/05/21 23:02:52 lsmith Exp $ /** * MDB2 OCI8 driver @@ -606,7 +606,7 @@ } $class_name = 'MDB2_Statement_'.$this->phptype; - $obj =& new $class_name($this, $statement, $query, $types, $result_types); + $obj =& new $class_name($this, $statement, $query, $types, $result_types, $this->row_limit, $this->row_offset); return $obj; } @@ -1020,21 +1020,21 @@ class MDB2_Statement_oci8 extends MDB2_Statement_Common { // }}} - // {{{ execute() + // {{{ _execute() /** - * Execute a prepared query statement. + * Execute a prepared query statement helper method. * * @param mixed $result_class string which specifies which result class to use * @param mixed $result_wrap_class string which specifies which class to wrap results in * @return mixed a result handle or MDB2_OK on success, a MDB2 error on failure - * @access public + * @access private */ - function &execute($result_class = true, $result_wrap_class = false) + function &_execute($result_class = true, $result_wrap_class = false) { $isManip = MDB2::isManip($this->query); $this->db->last_query = $this->query; - $this->db->debug($this->query, 'query'); + $this->db->debug($this->query, 'execute'); if ($this->db->getOption('disable_query')) { if ($isManip) { return MDB2_OK; @@ -1052,20 +1052,18 @@ foreach ($this->values as $parameter => $value) { $type = isset($this->types[$parameter]) ? $this->types[$parameter] : null; if ($type == 'clob' || $type == 'blob') { - $lobs[$parameter]['file'] = true; + $lobs[$parameter]['file'] = false; if (is_resource($value)) { $fp = $value; $value = ''; while (!feof($fp)) { $value.= fread($fp, 8192); } - $lobs[$parameter]['file'] = false; } elseif (preg_match('/^(\w+:\/\/)(.*)$/', $value, $match)) { + $lobs[$parameter]['file'] = true; if ($match[1] == 'file://') { $value = $match[2]; } - } else { - $lobs[$parameter]['file'] = false; } $lobs[$parameter]['value'] = $value; $descriptors[$parameter] = @OCINewDescriptor($this->db->connection, OCI_D_LOB); @@ -1074,7 +1072,7 @@ break; } } else { - $descriptors[$parameter] = $this->db->quote($value, $type); + $descriptors[$parameter] = $this->db->quote($value, $type, false); if (PEAR::isError($descriptors[$parameter])) { return $descriptors[$parameter]; } @@ -1086,11 +1084,6 @@ break; } } else { - if ($descriptors[$parameter] === 'NULL') { - $descriptors[$parameter] = null; - } elseif ($descriptors[$parameter][0] === "'") { - $descriptors[$parameter] = substr($descriptors[$parameter], 1, -1); - } if (!@OCIBindByName($this->statement, ':'.$parameter, $descriptors[$parameter], -1)) { $result = $this->db->raiseError($this->statement); break; @@ -1160,7 +1153,9 @@ */ function free() { - @OCIFreeStatement($this->statement); + if (!@OCIFreeStatement($this->statement)) { + return $this->db->raiseError(); + } return MDB2_OK; } }

« previous php.pear.cvs (#32008) next »