Listing 1523
Followup to listing-1505.txt, submitted by mike.
Submitted by anonymous user, 15 August 2008
/* # # class.loader.php # # */ require_once("class.database.php"); require_once("class.validation.php"); class Loader { public $DB; public $Validation; public $Modules; // run when class is called function __construct() { $username = "pencil"; // user name for the database login $password = "230254"; // password for the database login $host = "localhost"; // host name $database = "pencil"; // database name $this->DB = new DB(); // apply for the DB class $this->DB->DB($database,$host,$username,$password); // call the DB() // Validation Class $this->Validation = new Validation(); $this->Modules = $this->mload(); } function mload() { // Load all core and turned on modules $sql = $this->DB->Query("SELECT * FROM modules WHERE status = 1"); $con = array(); while($rslt = mysql_fetch_array($sql)) { if (!class_exists($rslt['name'])) { require_once "modules/".$rslt['name']."/module.".$rslt['name'].".php"; $con[$rslt["name"]] = new $rslt["name"]; } } return $con; } }
