I have 2 files: master.php and test.php. master.php has a class in it that I would like to include in test.php. The only problem is that test.php is ignoring the class in master.php.
Here is the code:
Test.php:
include("http://".$_SERVER['HTTP_HOST']."/rebuild/scripts/php/master.php");
$loader = new modLoader();
$module[0] = 'm.class.templating.php';
$module[1] = 'm.class.userInfo.php';
$loader->modules = $module;
$loader->loadUp();
master.php:
class modLoader
{
public $modules = array();
function loadUp()
{
include('http://'.$_SERVER['HTTP_HOST'].'/rebuild/scripts/php/classes.php');
foreach($this->modules as $key=>$value)
{
include('http://'.$_SERVER['HTTP_HOST'].'/rebuild/scripts/php/modules/'.$value);
}
}
}
Here is the error I get:
Fatal error: Class 'modLoader' not found in /var/www/html/rebuild/test.php on line 3
I've even tried having the include file master.php echo some stuff and that works fine. Just no class. Anyone have any ideas?