Re: [new] PEAR::assertExtension()

From: Date: Mon, 17 Jun 2002 12:09:29 +0000
Subject: Re: [new] PEAR::assertExtension()
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-7101@lists.php.net to get a copy of this message
I think you should test for both php_ex.suffix AND ex.suffix on every platform. I've seen linux modules being called php_whatever.so too. - Markus On Mon, Jun 17, 2002 at 01:10:20PM +0200, Tomas V.V.Cox wrote : > What do you think on adding a new function to PEAR.php assertExtension() > which will: > > 1) Load an extension if is not loaded already > 2) Return bool > 3) OS independant > > The code: > > + // {{{ assertExtension() > + > + function assertExtension($ext) > + { > + if (!extension_loaded($ext)) { > + if (OS_WINDOWS) { > + return @dl("php_$ext.dll"); > + } elseif (PHP_OS == 'HP-UX') { > + return @dl("$ext.sl"); > + } elseif (PHP_OS == 'AIX') { > + return @dl("$ext.a"); > + } else { > + return @dl("$ext.so"); > + } > + } > + return true; > + } > + > + // }}} > > You know the bounch of places where such check are done, equally to the > number of places where that check is wrong made :-) > > Of course the really Good Thing would be to change the dl() behaviour to > take care automatically on it (http://bugs.php.net/bug.php?id=17798) > > > Tomas V.V.Cox > > -- > PEAR Development Mailing List (http://pear.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php -- GnuPG Key: http://guru.josefine.at/~mfischer/C2272BD0.asc Did I help you? http://guru.josefine.at/wish_en Konnte ich helfen? http://guru.josefine.at/wish_de

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