cvs: pear /MDB2/MDB2/Driver/Datatype Common.php
| From: | Lukas Smith | Date: | Sat, 21 May 2005 23:01:00 +0000 |
| Subject: | cvs: pear /MDB2/MDB2/Driver/Datatype Common.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-32004@lists.php.net to get a copy of this message | ||
lsmith Sat May 21 19:01:00 2005 EDT
Modified files:
/pear/MDB2/MDB2/Driver/Datatype Common.php
Log:
- phpdoc fixes
- added missing fclose() calls
http://cvs.php.net/diff.php/pear/MDB2/MDB2/Driver/Datatype/Common.php?r1=1.29&r2=1.30&ty=u
Index: pear/MDB2/MDB2/Driver/Datatype/Common.php
diff -u pear/MDB2/MDB2/Driver/Datatype/Common.php:1.29
pear/MDB2/MDB2/Driver/Datatype/Common.php:1.30
--- pear/MDB2/MDB2/Driver/Datatype/Common.php:1.29 Thu May 19 00:49:57 2005
+++ pear/MDB2/MDB2/Driver/Datatype/Common.php Sat May 21 19:01:00 2005
@@ -42,7 +42,7 @@
// | Author: Lukas Smith <smith@backendmedia.com> |
// +----------------------------------------------------------------------+
//
-// $Id: Common.php,v 1.29 2005/05/19 04:49:57 lsmith Exp $
+// $Id: Common.php,v 1.30 2005/05/21 23:01:00 lsmith Exp $
require_once 'MDB2/LOB.php';
@@ -1112,7 +1112,7 @@
/**
* retrieve LOB from the database
*
- * @param int $lob handle to a lob created by the createLOB() function
+ * @param resource $lob stream handle
* @param string $file name of the file into which the LOb should be fetched
* @return mixed MDB2_OK on success, a MDB2 error on failure
* @access protected
@@ -1124,11 +1124,13 @@
while (!feof($lob)) {
$result = fread($lob, $db->options['lob_buffer_length']);
$read = strlen($result);
- if (fwrite($fp, $result, $read)!= $read) {
+ if (fwrite($fp, $result, $read) != $read) {
+ fclose($fp);
return MDB2::raiseError(MDB2_ERROR, null, null,
'writeLOBToFile: could not write to the output file');
}
}
+ fclose($fp);
return MDB2_OK;
}
@@ -1138,7 +1140,7 @@
/**
* retrieve LOB from the database
*
- * @param int $lob handle to a lob created by the createLOB() function
+ * @param resource $lob stream handle
* @return mixed MDB2_OK on success, a MDB2 error on failure
* @access protected
*/
@@ -1156,8 +1158,7 @@
/**
* Read data from large object input stream.
*
- * @param integer $lob argument handle that is returned by the
- * MDB2::createLOB() method.
+ * @param resource $lob stream handle
* @param string $data reference to a variable that will hold data
* to be read from the large object input stream
* @param integer $length value that indicates the largest ammount ofdata
@@ -1179,7 +1180,7 @@
* Determine whether it was reached the end of the large object and
* therefore there is no more data to be read for the its input stream.
*
- * @param int $lob handle to a lob created by the createLOB() function
+ * @param resource $lob stream handle
* @return mixed true or false on success, a MDB2 error on failure
* @access protected
*/
@@ -1195,14 +1196,14 @@
* Free any resources allocated during the lifetime of the large object
* handler object.
*
- * @param integer $lob argument handle that is returned by the
- * MDB2::createLOB() method.
+ * @param resource $lob stream handle
* @access public
*/
function destroyLOB($lob)
{
$lob_data = stream_get_meta_data($lob);
$lob_index = $lob_data['wrapper_data']->lob_index;
+ fclose($lob);
if (isset($this->lobs[$lob_index])) {
$this->_destroyLOB($lob_index);
unset($this->lobs[$lob_index]);
@@ -1217,8 +1218,7 @@
* Free any resources allocated during the lifetime of the large object
* handler object.
*
- * @param integer $lob argument handle that is returned by the
- * MDB2::createLOB() method.
+ * @param int $lob_index from the lob array
* @access private
*/
function _destroyLOB($lob_index)