Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 2.5.0b5

Bug #9092 LOB and streams
Submitted: 2006-10-19 07:17 UTC
From: frehling at 3il dot fr Assigned: lsmith
Status: Closed Package: MDB2 (version 2.2.2)
PHP Version: 5.0.4 OS: Windows XP
Roadmaps: (Not assigned)    
Subscription  


 [2006-10-19 07:17 UTC] frehling at 3il dot fr (Jean-Christophe Frehling)
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)

Comments

 [2006-10-25 11:44 UTC] lsmith (Lukas Smith)
PHP 5.0.4 has a very buggy streams API, could you test this on 5.0.5 or better yet 5.1 or higher?
 [2006-10-25 11:48 UTC] lsmith (Lukas Smith)
nevermind .. will fit the bug asap
 [2006-10-25 11:52 UTC] lsmith (Lukas Smith)
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.