本文整理汇总了PHP中D::initialize方法的典型用法代码示例。如果您正苦于以下问题:PHP D::initialize方法的具体用法?PHP D::initialize怎么用?PHP D::initialize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类D
的用法示例。
在下文中一共展示了D::initialize方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
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');
}
示例2: __construct
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();
}