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

Bug #5858 do not use @ before include_once
Submitted: 2005-11-03 14:47 UTC
From: wiesemann Assigned: wiesemann
Status: Closed Package: Structures_DataGrid
PHP Version: Irrelevant OS: Irrelevant
Roadmaps: (Not assigned)    
Subscription  


 [2005-11-03 14:47 UTC] wiesemann
Description: ------------ Please do not use @ before include_once, like in DataGrid/DataSource.php, line 165. If you don't have XML_RSS installed (like me), the bind call from the manual example ("Example 54-1") will let the script die without any output instead of a message like this (produced without the @): main(XML/RSS.php): failed to open stream: No such file or directory in E:\htdocs\pear\PEAR\Structures\DataGrid\DataSource\RSS.php on line 22 There was recently a discussion about this in pear.qa.

Comments

 [2005-11-03 14:48 UTC] dufuz
just be smart and do file_exists calls and proper error handling of this whole thing :-) Look at MDB2 or LiveUser fileExists and loadClass for examples.
 [2005-11-03 15:24 UTC] olivierg at php dot net
This bug has been fixed in CVS. I completely agree. I hate that sort of silent bugs caused by @. I already did remove some of these, but forgot DataSource.php. Checking with : grep -r '@require' * grep -r '@include' * ... now gets me no result. So we should be fine. But I think that PHP is "smart" enough, and already displays a meaningful message if a file is missing. So no, I won't reinvent the wheel by checking if the file exists and so on.
 [2005-11-03 15:44 UTC] dufuz
well your failure then, you'll for sure get some fun fun bogus bug reports about those warnings (if SDG will ever be split up into driver packages, which I strongly suggest)
 [2005-11-03 15:52 UTC] olivierg at php dot net
You interest me... Can you please develop your idea of splitting SDG into driver packages ? There does not seem to be many similar examples in PEAR. Why and how do you propose to do this ?
 [2005-11-03 21:43 UTC] olivierg at php dot net
This is related to bug #5859
 [2005-11-03 21:56 UTC] olivierg at php dot net
Setting status to Analyzed.
 [2006-01-24 12:20 UTC] wiesemann
This problem was fixed by the started refactoring process.