return; } } throw new Exception("Load {$name} failed."); }); // 加载辅助函数 include_once LIB_DIR . "/password.php"; include_once CLASSES_DIR . "/functions.php"; include_once CLASSES_DIR . "/setup_env.php"; setup_encoding(); define('BLOG_URL', get_app_url()); // load plugins foreach (glob(APP_DIR . "/plugins/*/main.php") as $filename) { include $filename; } // 全局的配置 $config = new Config(DATA_DIR . '/config.php'); setup_default_config(); // 配置完成 Hook::TriggerEvent(Hook::CONFIG_COMPLETE, array($config)); // 使用配置来设置环境 setup_env_by_config(); $postHelper = new FilePostHelper(CACHE_DIR . '/post.meta'); $tellets = new Tellets(); // 添加预定义动作 include_once CLASSES_DIR . '/predefined_hooks.php'; // 添加预定义解析器 ParserFactory::RegisterParser(MarkdownParser::EXTENSION, 'MarkdownParser'); ParserFactory::RegisterParser(HTMLParser::EXTENSION, 'HTMLParser'); // 启动完成 Hook::TriggerEvent(Hook::BOOTSTRAP, array());