人人商城

bootstrap.php 634B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. global $_W;
  3. global $_GPC;
  4. require ES_CORE_PATH . 'functions.php';
  5. require ES_CORE_PATH . 'controller.php';
  6. $controller = strtolower($controller);
  7. if (empty($controller)) {
  8. $controller = ES_DEFAULT_CONTROLLER;
  9. }
  10. $action = strtolower($action);
  11. if (empty($action)) {
  12. $action = ES_DEFAULT_ACTION;
  13. }
  14. $controller_file = ES_CONTROLLER_PATH . $controller . '.php';
  15. if (!(is_file($controller_file))) {
  16. es_empty();
  17. exit();
  18. }
  19. require $controller_file;
  20. $class_name = ucfirst($controller) . 'Controller';
  21. $class = new $class_name();
  22. if (method_exists($class, $action)) {
  23. $class->$action();
  24. exit();
  25. }
  26. es_empty();
  27. exit();
  28. ?>