OK, so I need some more help.
In C# and other C languages, predefined methods throw excptions for you so all you have to do is catch them.
whereas in php, it seems, you have to throw your own.
try
{
if (!@include(self::MAIN_ABS_PATH . self::SITE_DIR . self::CLASS_DIR . "/db.class.php"))
throw new Exception("Failed to load ".self::MAIN_ABS_PATH . self::SITE_DIR . self::CLASS_DIR . "/db.class.php");
require(self::MAIN_ABS_PATH . self::SITE_DIR . self::CLASS_DIR . "/dbTables.class.php");
require(self::MAIN_ABS_PATH . self::SITE_DIR . self::CLASS_DIR . "/dbArrays.class.php");
require(self::MAIN_ABS_PATH . self::SITE_DIR . self::CLASS_DIR . "/utilities.class.php");
require(self::MAIN_ABS_PATH . self::SITE_DIR . self::CLASS_DIR . "/products.class.php");
require(self::MAIN_ABS_PATH . self::SITE_DIR . self::CLASS_DIR . "/encryption.class.php");
}
catch (Exception $e)
{
$error = "File: ".$e->getFile()." Line: ".$e->getLine();
die( $error, $e->getMessage() );
exit();
}
OK, so this works. But when you include an invalid file with include but leave off the "@" you get an ERROR warning or whatever.
How do I capture this warning or error and put it into a variable, as using a "@" before a function eliminates it's E_ERROR level completely.