Re: how to deal with php5 only packages (was: [PEPr] Comment on Networking::GeoIP)

From: Date: Wed, 16 Jun 2004 15:37:54 +0000
Subject: Re: how to deal with php5 only packages (was: [PEPr] Comment on Networking::GeoIP)
References: 1 2 3 4 5 6 7 8  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-30788@lists.php.net to get a copy of this message
On Jun 16, 2004, at 5:33 PM, Daniel Convissor wrote:
Hi David: On Wed, Jun 16, 2004 at 05:28:29PM +0200, David Costa wrote:
On Jun 16, 2004, at 5:25 PM, Daniel Convissor wrote:
Packages that don't _require_ PHP 5 features should just use PHP 4. Writing in PHP 5 just because you feel like it just doesn't make solid sense.
Aheam, since you can't include PEAR they will only require exceptions at least ;)
I don't understand your point. Perhaps you can clarify.
Lukas wrote: ""BTW: We want PHP4 compatible packages to work in E_ALL. Packages that are PHP5 only need to work with E_STRICT imho. This however means that they cannot use PEAR.php." for example the MP3_Playlist you kindly helped me with included PEAR for error handling. this is not desirable (package should work on E_STRICT as Lukas said) so the only workaround is if (!@$scanned) {
            throw new Exception(self::MP3_PLAYLIST_OPENDIR_FAILED);
        }
in lieu of if (!@$scanned) {
            return PEAR::raiseError(self::MP3_PLAYLIST_OPENDIR_FAILED,
                                    -1, PEAR_ERROR_PRINT);
        }
To clarify my position, I'd consider most uses of exceptions at this time to be one of those "I'm using a PHP 5 feature just because I feel like it."
Not really, that is the only way to do it properly under PHP 5 without including PEAR. I still have to work out how to avoid problems with MP3_ID (which I include for the extended parsing) because that would make my package automagically non E_STRICT compliant. Cheers David Costa
--Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y
            data intensive web and database programming
                http://www.AnalysisAndSolutions.com/
4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 -- PEAR Development Mailing List (http://pear.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php


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