public static function getInstance()
 {
     if (!self::$instance) {
         $c = __CLASS__;
         self::$instance = new $c();
     }
     return self::$instance;
 }
示例#2
0
EZadmin as distributed by NCSU Libraries is located at:
http://code.google.com/p/ezadmin/

*******************************************************************************/
switch (APPLICATION_ENV) {
    case 'development':
        ini_set('display_errors', 'On');
        error_reporting(E_ALL);
        break;
    case 'production':
    default:
}
include APPLICATION_PATH . 'Registry.php';
include APPLICATION_PATH . 'Config.php';
include APPLICATION_PATH . 'controller_base.class.php';
include APPLICATION_PATH . 'router.class.php';
include APPLICATION_PATH . 'template.class.php';
function __autoload($class_name)
{
    $filename = strtolower($class_name) . '.class.php';
    $file = APPLICATION_PATH . '/model/' . $filename;
    if (file_exists($file) == false) {
        return false;
    }
    include $file;
}
$registry = Registry::getInstance();
$registry->config = Config::getInstance();
$registry->db = ezproxydb::getInstance();
$registry->auth = ezproxyauth::getInstance();