cvs: pear /DB/DB ibase.php

From: Date: Wed, 21 Jan 2004 06:11:43 +0000
Subject: cvs: pear /DB/DB ibase.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-15832@lists.php.net to get a copy of this message
danielc Wed Jan 21 01:11:43 2004 EDT Modified files: /pear/DB/DB ibase.php Log: Have prepare() use fread(filesize()) instead of while fread() and fopen in 'rb' mode to ensure binary files get read correctly. http://cvs.php.net/diff.php/pear/DB/DB/ibase.php?r1=1.31&r2=1.32&ty=u Index: pear/DB/DB/ibase.php diff -u pear/DB/DB/ibase.php:1.31 pear/DB/DB/ibase.php:1.32 --- pear/DB/DB/ibase.php:1.31 Mon Jan 19 21:57:28 2004 +++ pear/DB/DB/ibase.php Wed Jan 21 01:11:43 2004 @@ -16,7 +16,7 @@ // | Author: Sterling Hughes <sterling@php.net> | // +----------------------------------------------------------------------+ // -// $Id: ibase.php,v 1.31 2004/01/20 02:57:28 danielc Exp $ +// $Id: ibase.php,v 1.32 2004/01/21 06:11:43 danielc Exp $ // Bugs: @@ -30,7 +30,7 @@ * extension. * * @package DB - * @version $Id: ibase.php,v 1.31 2004/01/20 02:57:28 danielc Exp $ + * @version $Id: ibase.php,v 1.32 2004/01/21 06:11:43 danielc Exp $ * @category Database * @author Sterling Hughes <sterling@php.net> */ @@ -396,14 +396,12 @@ $pdata[$i] = &$data; } if ($types[$j] == DB_PARAM_OPAQUE) { - $fp = fopen($pdata[$i], 'r'); - $pdata[$i] = ''; - if ($fp) { - while (($buf = fread($fp, 4096)) != false) { - $pdata[$i] .= $buf; - } - fclose($fp); + $fp = @fopen($pdata[$i], 'rb'); + if (!$fp) { + return $this->raiseError(DB_ERROR_ACCESS_VIOLATION); } + $pdata[$i] = fread($fp, filesize($pdata[$i])); + fclose($fp); } } $res = call_user_func_array('ibase_execute', $pdata);

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