系统挂载点

  1. Plugin::mount('cml.before_set_time_zone');//设置时区前。用于设置多时区 v2.6.6+可用
  2. Plugin::mount('cml.before_fatal_error', $error);//抛出致命错误前
  3. Plugin::hook('cml.after_fatal_error', $error); //v2.6.8+可用,抛出致命错误后。此时php内置gc已经工作,挂载插件最好使用闭包。返回jump时。跳出致命错误
  4. Plugin::mount('cml.before_throw_exception', $e);//抛出异常前
  5. Plugin::mount('cml.before_parse_url');//解析路由前
  6. Plugin::mount('cml.after_parse_url'); //解析路由后
  7. Plugin::mount('cml.before_run_controller');//执行控制器前
  8. Plugin::mount('cml.before_show_404_page'); //显示404错误页前
  9. Plugin::mount('cml.before_cml_stop');//程序运行结束前
  10. Plugin::mount('cml.cache_server_down', ['host' => $host, 'port' => $port] );//缓存服务器down了 v2.6.8+可用
  11. Plugin::hook('cml.before_run_api_test');//运行api自动测试前 v2.7.7+可用
  12. Plugin::hook('cml.before_run_api_test_one_api', $api);//运行某个api方法前 v2.7.7+可用

原文: http://doc.cmlphp.com/devintro/plugin/hook.html