Breaking BC and releases
| From: | Mika Tuupola | Date: | Fri, 25 Oct 2002 13:08:43 +0000 |
| Subject: | Breaking BC and releases | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-10248@lists.php.net to get a copy of this message | ||
I talked with Rasmus and I'll start maintaining File_Passwd.
There is one thing which I would like to fix, but it will break
BC and I'd like some input from the list what is the proper
way of releasing a BC breaking release.
Currently lots of things which can cause an error are done
in the constructor (opening and reading files etc). Since you
can't properly use PEAR error handling from constructor
I would like to introduce a load() or init() method which does
all the loading etc.
Before you would do something like this:
$p = new File_Passwd('.htaccess');
$p->modUser('user', 'pass');
$p->close();
After the fix you could do something like:
$p = new File_Passwd('.htaccess');
$p->load();
$p->modUser('user', 'pass');
$p->close();
or if you want the error handling:
$p = new File_Passwd('.htaccess');
if (PEAR::isError($p->load())) {
// do error handling
} else {
$p->modUser('user', 'pass');
$p->close();
}
I see two possibilities.
1) first make a 0.9 beta release with the original broken
behaviour and then 1.0 release with working error handling but
broken bc and then fix other packages depending on File_Passwd
Or should the numbers be 1.0 and 2.0 ?
2) leave the package as it is and make release only with broken
error handling. Less fuss, but is still broken and it will be
even more harder to fix in the future when there are more
dependencies than now.
Actually browsing through cvs there is quite a lot of code
in PEAR witch broken error handling. For example all
Auth_Container_xxx, some Image_Transform_Driver_xxx, Config
to name few. I think this needs to be addressed if PEAR
is considered "hiqh quality code".
--
Mika Tuupola http://www.appelsiini.net/~tuupola/