public function __construct() { //SINGLETON------------------------------------ $this->msgs = messages::getInstance(); //--------------------------------------------- $this->connectDB(); }
public function __construct() { //SINGLETON------------------------------------ $this->msgs = messages::getInstance(); $this->db = Database::getInstance(); //--------------------------------------------- }
<?php require_once dirname(__FILE__) . '/../config.php'; require_once $conf->root_path . '/libs/messages.class.php'; $msgs = messages::getInstance(); require_once $conf->root_path . '/app/Database.class.php'; $db = Database::getInstance(); $action = $_REQUEST['action']; switch ($action) { default: if (!$conf->is_session_started()) { session_start(); } if (!isset($_SESSION['logged'])) { include_once $conf->root_path . '/app/loginCtrl.class.php'; $tmp = new loginCtrl(); $tmp->generateView(); exit; } else { require_once $conf->root_path . '/app/mainPageCtrl.class.php'; $tmp = new mainPageCtrl(); $tmp->generateView(); //header("Location: ".$conf->app_url); //die(); } break; case 'zaloguj': require_once $conf->root_path . '/app/loginCtrl.class.php'; $tmp = new loginCtrl(); $tmp->doLogin(); break;