function __construct($default_controller, $default_action) { $this->check_setup(); require Uigu2_Controller::UMPLE_MODEL_INIT_FILE; $this->umple_model = initialize_model(); $this->execution_id = $this->umple_model['execution_id']; $this->controller_path = CONTROLLER_PATH; $this->web_folder = WEB_FOLDER; $this->view_path = VIEW_PATH; parent::__construct($default_controller, $default_action); }
function __construct($controller_path = 'controllers/', $web_folder = WEB_FOLDER, $default_controller = DEFAULT_ROUTE, $default_function = DEFAULT_ACTION) { // generic redirection for secure connections (assuming that ssl is on port 443) if (defined('SSL') && SSL && $_SERVER['SERVER_PORT'] != "443") { header('Location: ' . url(request_uri())); } // html cache on only in production $cached = DEBUG ? false : $this->_pageCache(); if (!empty($cached)) { echo $cached; // exit now exit; //return; } // add the config in the data object $this->data['config'] = $GLOBALS['config']; // add admin flag if (array_key_exists('admin', $_SESSION)) { $this->data['admin'] = $_SESSION['admin']; } // set the template the controller is using $template = strtolower(get_class($this)) . ".php"; $this->data['template'] = is_file(TEMPLATES . $template) ? $template : false; // #116 add site info in the client object $GLOBALS['client']['site']['name'] = $GLOBALS['config']['main']['site_name']; $url = url(); // FIX: removing ending slash $GLOBALS['client']['site']['url'] = substr($url, -1) == "/" ? substr($url, 0, -1) : $url; parent::__construct($controller_path, $web_folder, $default_controller, $default_function); }