Jump to content

How either check PEAR installed or catch include_once statement?


someguy321

Recommended Posts

I want to use PEAR if it's installed and the regular "mail()" function if not. But to check for PEAR being installed, I can't check for the class PEAR existing because I have to include "Mail.php" first.

 

The problem is that even though this statement works perfectly:

 

     include_once "Mail.php";

 

This will ALWAYS be false:

 

    if ( file_exists( "Mail.php" ) ) ...

 

So how do I check for PEAR? If I just include the file, it throws a warning error that I can't seem to catch in a try..catch.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.