Ejemplo n.º 1
0
	function __construct() {
		//crap we need for the framework
		//$GLOBALS['app'] = $this; //stop this.
		$this->helper('functional'); //makes my life oh so much easier :)
		$this->lib(array('D', 'Config')); //Get the debuger and the config loader
		
		D::initialize($this->libs->Config->get('Debug')); //start the debugger up with some config options
		D::time('App', 'SweetFramework - ' . date('F j, Y, g:i a')); //Write what time the framework starts to the log
		//register_shutdown_function('SweetFramework::end');
	}
Ejemplo n.º 2
0
	function __construct($configFile) {
		//crap we need for the framework
		$GLOBALS['app'] = $this; //stop this.
		$this->helper('functional'); //makes my life oh so much easier :)
		$this->lib(array('D', 'Config'));
		D::initialize($this->libs->Config->get('Debug'));
		D::time('App', 'SweetFramework - ' . date("F j, Y, g:i a"));
		
		$appInfo = $this->libs->Config->get('SweetFramework', 'app');
		
		
		//define('APPLOC', LOC . $appInfo['folder']);
		
		foreach($appInfo['paths'] as $k => $v) {
			if(!is_array(self::$paths[$k])) {
				self::$paths[$k] = array();
			}
			//@todo A/B test these two.
			self::$paths[$k][] = '/' . $appInfo['folder'] . '/' . $v .'/';
			//self::$paths[$k][] = join('/', array(LOC, $appInfo['folder'], $v)) .'/';
		}

		/*
		$db = $this->config->get('Site', 'database');
		Databases::newDatabase($db);
		Databases::setCurrentDb($db);
		*/
		
		//Handy stuff that is always used
//		$this->includeLibrary('Session.php');
//		$this->includeLibrary('SweetModel.php');
		$this->lib(array('Uri', 'Theme'));
		

		$this->libs->Uri->callRoute();
		
		//Check for theme and go!
		/*
		if(!$this->lib->Theme->setTheme($this->config->get('Site', 'defaultTheme'))) {
			D::error('Theme could not be found. Debug: $Config->getSetting(\'Site\', \'defaultTheme\') = ' . $this->config->get('Site', 'defaultTheme'));
		}
		*/
		
		
		//$this->loadController('Main.php'); //this is where it starts to get interesting…
		self::end();
		//after we are done.
		//Session::writeData();
		
	}