public static function instance() { if (self::$_instance === null) { self::$_instance = new self(); } return self::$_instance; }
<?php //网站根目录 define('ROOT_DIR', __DIR__ . DIRECTORY_SEPARATOR); //框架根目录 define('GRACE_DIR', 'C:\\web\\blog6.0\\grace\\'); include_once GRACE_DIR . 'grace.php'; $grace = grace::instance(); loader::instance()->register_include_path(array(ROOT_DIR . 'class' . DS))->register_controller_path(array(ROOT_DIR . 'controller' . DS))->register_model_path(array(ROOT_DIR . 'model' . DS)); $grace->run();