public function __construct($table = null) { $fw = new Main(); $fw->loadConfig("database.php"); $fw->loadConfig("system.php"); $this->configs = $fw->configs; $this->db_type = $this->configs['mysql']['type']; if ($this->connect()) { $this->selectDb($this->configs['mysql']['database']); if ($table != null) { $this->setTable($this->configs['mysql']['prefix'] . $table); return true; } } }
<?php header("Content-type: text/javascript"); include "../init.php"; $fw = new Main(); $fw->loadConfig("system.php"); ?> //Some vars translated from php to JS <?php if (isset($_GET['app'])) { $app = str_replace("/", "", $_GET['app']); ?> var PATH_APP = "<?php echo str_replace(PATH_ROOT, "", PATH_APPLICATIONS . $app . "/"); ?> "; <?php } ?> var PHP_SITE_LIVE = <?php echo $fw->configs['system']['live'] ? "true" : "false"; ?> ;