Re: Detecting extensions

From: Date: Tue, 22 Oct 2002 13:20:17 +0000
Subject: Re: Detecting extensions
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-120900@lists.php.net to get a copy of this message
Yes, thanks, almost that. My main problem would be to handle that fatal situation in my code. For example, if I would use that function: if (extension_loaded('xslt')) { xslt_create(...); } else { // do something else } The code still won't compile in case when XSLT is not loaded. And same with includes - it will try to parse includes no matter what: if (extension_loaded('xslt')) { include '/with_xslt.php'; // this one will anyway cause fatal error if xslt's not loaded } else { include '/without_xslt.php'; } Is that right? Stas ----- Original Message ----- From: "Adam Voigt" <adam@cryptocomm.com> To: "Stas Maximov" <maximov@eircom.net> Cc: "PHP General" <php-general@lists.php.net> Sent: Tuesday, October 22, 2002 2:07 PM Subject: Re: [PHP] Detecting extensions > You mean like this: > > http://www.php.net/extension_loaded > > ? > > Adam Voigt > adam.voigt@cryptocomm.com > > On Tue, 2002-10-22 at 09:06, Stas Maximov wrote: > > Hello list, > > > > I'm wondering if there is a way to programatically detect whether extension > > is loaded or not? Say, if PHP doesn't have XSLT extension loaded then > > xslt_create() function will result in fatal compile error which is > > impossible to trap. Is there a way to handle this problem gracefully? > > > > Best regards, > > Stas > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

« previous php.general (#120900) next »