cvs: pear /MDB2/MDB2/Driver mysqli.php
| From: | Lukas Smith | Date: | Thu, 27 Oct 2005 16:38:02 +0000 |
| Subject: | cvs: pear /MDB2/MDB2/Driver mysqli.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-35905@lists.php.net to get a copy of this message | ||
lsmith Thu Oct 27 12:38:02 2005 EDT
Modified files:
/pear/MDB2/MDB2/Driver mysqli.php
Log:
- do not check with === if ssl is enabled
- fixed LOB handling
http://cvs.php.net/diff.php/pear/MDB2/MDB2/Driver/mysqli.php?r1=1.46&r2=1.47&ty=u
Index: pear/MDB2/MDB2/Driver/mysqli.php
diff -u pear/MDB2/MDB2/Driver/mysqli.php:1.46 pear/MDB2/MDB2/Driver/mysqli.php:1.47
--- pear/MDB2/MDB2/Driver/mysqli.php:1.46 Mon Oct 24 00:01:37 2005
+++ pear/MDB2/MDB2/Driver/mysqli.php Thu Oct 27 12:38:01 2005
@@ -43,7 +43,7 @@
// | Author: Lukas Smith <smith@pooteeweet.org> |
// +----------------------------------------------------------------------+
//
-// $Id: mysqli.php,v 1.46 2005/10/24 04:01:37 dufuz Exp $
+// $Id: mysqli.php,v 1.47 2005/10/27 16:38:01 lsmith Exp $
//
/**
@@ -315,7 +315,7 @@
@ini_set('track_errors', true);
$php_errormsg = '';
- if ($this->options['ssl'] === true) {
+ if ($this->options['ssl']) {
$init = @mysqli_init();
@mysqli_ssl_set(
$init,
@@ -1043,6 +1043,25 @@
$i = 0;
foreach ($this->values as $parameter => $value) {
$type = array_key_exists($parameter, $this->types) ? $this->types[$parameter]
: null;
+ if (is_resource($value) || $type == 'clob' || $type == 'blob')
{
+ $parameters[] = null;
+ $parameters[1].= 'b';
+ } else {
+ $parameters[] = $this->db->quote($value, $type, false);
+ $parameters[1].= $this->db->datatype->mapPrepareDatatype($type);
+ }
+ ++$i;
+ }
+
+ $result = @call_user_func_array('mysqli_stmt_bind_param', $parameters);
+ if ($result === false) {
+ $err =& $this->db->raiseError();
+ return $err;
+ }
+
+ $i = 0;
+ foreach ($this->values as $parameter => $value) {
+ $type = array_key_exists($parameter, $this->types) ? $this->types[$parameter]
: null;
$close = false;
if ($type == 'clob' || $type == 'blob') {
if (preg_match('/^(\w+:\/\/)(.*)$/', $value, $match)) {
@@ -1061,27 +1080,15 @@
if ($close) {
@fclose($value);
}
- $parameters[] = null;
- $parameters[1].= 'b';
} elseif ($type == 'clob' || $type == 'blob') {
do {
$data = substr($value, 0,
$this->db->options['lob_buffer_length']);
$value = substr($value,
$this->db->options['lob_buffer_length']);
@mysqli_stmt_send_long_data($this->statement, $i, $data);
} while ($value);
- $parameters[] = null;
- $parameters[1].= 'b';
- } else {
- $parameters[] = $this->db->quote($value, $type, false);
- $parameters[1].= $this->db->datatype->mapPrepareDatatype($type);
}
++$i;
}
- $result = @call_user_func_array('mysqli_stmt_bind_param', $parameters);
- if ($result === false) {
- $err =& $this->db->raiseError();
- return $err;
- }
}
if (!@mysqli_stmt_execute($this->statement)) {