public static function init() { if(! isset(self::$instance)) { self::$instance = new Settings(getrootdirsrvinclude()."settings.php"); } return self::$instance; }
<? // echo getrootdirsrvinclude(); // include_once(getrootdirsrvinclude()."model/Model.php"); // connect to the Model part of our MVC pattern include_once(getrootdirsrvinclude()."model/Settings.php"); // connect to the Settings include_once(getrootdirsrvinclude()."model/legacy.php"); // connect to the Settings include_once(getrootdirsrvinclude()."model/localization.php"); // connect to the Settings // include_once(getrootdirsrvinclude()."controller/lessc.inc.php"); // the lesscss server-side compiler // include_once(getrootdirsrvinclude()."controller/StringForge.php"); // the string processing class // include_once(getrootdirsrvinclude()."controller/Template.1.87.php"); // add Template class include_once(getrootdirsrvinclude()."controller/Session.1.2.php"); class Controller { // the Controller class public $model; // used to handle the link to the Model public $settings; // used to handle the link to the Settings (settings.ini in an object representation) public $viewroot; public $themeinfo; public $srvroot; public function __construct() { // the constructor function $this->settings = Settings::init(); // load settings file $ssp = getrootdirsrv().$this->settings->sessionsavepath; new SessionSaveHandler($ssp); // setsecurevariable('settings',$this->settings); date_default_timezone_set($this->settings->timezone); // set the default timezone. may be we need to customize it for particular user // $this->model = new Model($this->settings); // instantiate the Model class // $this->less = new lessc; // $this->StringForge = new StringForge($this->settings); }