PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » Database » MDB2 » Bug #9092

LOB and streams

Details

Submitted2006-10-19 07:17 UTC
Fromfrehling at 3il dot fr
Assignedlsmith
StatusClosed
PackageMDB2
PHP Version5.0.4
OSWindows XP
Roadmaps(Not assigned)

Comments

[2006-10-19 07:17 UTC] frehling at 3il dot fr

Description:
------------
The stream_get_contents function reports a warning :
Warning: stream_get_contents() [function.stream-get-contents]: MDB2_LOB::stream_stat is not implemented! in c:\Inetpub\wwwroot\tpoccasion2007\test.php on line 16

I implemented an empty method in LOB.php that works fine, it also works fine with @stream_get_contents($row[0]);

Test script:
---------------
<?php
require_once 'MDB2.php';

$login = "tp";
$password = "test";

define ("dsn", "mysql://{$login}:{$password}@srv-linux/jcf_tp_occasion");
$db = MDB2::connect(dsn);
if (MDB2::isError($db)) die($db->getMessage());
$db->setOption('portability', MDB2_PORTABILITY_ALL);
$db->setOption('debug', 2);
$requete = "SELECT O_Image FROM occasion WHERE O_id=9";
$res = $db->query($requete,'blob');
$row = $res->fetchRow();
$str = stream_get_contents($row[0]);
var_dump($str);
//header("content-type: image/jpeg");
//echo base64_decode($str);
?>

Expected result:
----------------
No warning

Actual result:
--------------
resource(12) of type (stream)
Warning: stream_get_contents() [function.stream-get-contents]: MDB2_LOB::stream_stat is not implemented! in c:\Inetpub\wwwroot\tpoccasion2007\test.php on line 16
string(29584)