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

Bug #615 Constructor attempt to return PEAR_Error
Submitted: 2004-01-24 02:57 UTC
From: ahundiak Assigned: alan_k
Status: Closed Package: HTML_Template_Flexy
PHP Version: Irrelevant OS: NA - linux/windows
Roadmaps: (Not assigned)    
Subscription  


 [2004-01-24 02:57 UTC] ahundiak at ingr dot com
Description: ------------ The HTML_Template_Flexy constructor checks for the existence of the compiled template directory. If the directory is not found then the constructor attempts to return a PEAR_Error object. However, constructors are not allowed to return anything. A patch is available from here: http://www.cerad.org/pear/HTML_Template_Flexy/Flexy.php.diff.txt The patch adds a factory method to the class and moves the directory checking code to it.

Comments

 [2004-01-24 08:47 UTC] alan_k
compile() return an error anyway if is_Dir fails on it. - hence I've just removed that check in the constructor..
 [2004-01-24 13:20 UTC] ahundiak at ingr dot com
OK. Though I think adding a factory method is a good idea anyways. And if the app does the usual PEAR error checking then compile would never be called.
 [2004-01-24 15:21 UTC] alan_k
normally a factory method would return another class, - rather than the one being called.. - maybe a ::construct() method may be suitable - but since it's handled by compile anyway..