Re: Re: [PEPr] Comment on Encryption::Crypt_DES

From: Date: Wed, 09 May 2007 16:19:53 +0000
Subject: Re: Re: [PEPr] Comment on Encryption::Crypt_DES
References: 1 2  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-46684@lists.php.net to get a copy of this message
On 5/9/07, Terra Frost <terrafrost@php.net> wrote:
David Sanders wrote: David Sanders (http://pear.php.net/user/shangxiao) has commented on the proposal for Encryption::Crypt_DES. Comment: All new packages should be written for only php 5 in mind ;) (So that means var -> public/private, define -> const etc) The only "php 5" requirement I'm aware of is this one: http://pear.php.net/pepr/pepr-proposal-show.php?id=419 That only requires packages be E_STRICT compliant, which this one is.
It's more that E_STRICT, really. You're also required to use PEAR_Exception for errors. The intent of that RFC was to have all new packages be PHP5 packages, with all that this entails.
I agree that people should upgrade to PHP5, however, going out of my way to break this for PHP4 users isn't something that at all settles with me. Half the point of this library is that those who are unable change their PHP installation (for example, people using shared hosts) can still use DES. Isn't that how PEAR is supposed to compliment PECL, anyway? I'm not up to speed with encryption algorithms and libraries and I'm not sure if it would make much difference but it might be an idea to provide the user with the ability to choose whether to always use the internal implementation for consistency. Doing define('CRYPT_DES_MODE', CRYPT_DES_MODE_INTERNAL) before creating the Crypt_DES object should do just that.
That doesn't seem like a good way to do configuration to me. I'd rather an option be set in e.g. the constructor. -- Justin Patrin

« previous php.pear.dev (#46684) next »