index.php 862 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. /**
  3. * Index
  4. *
  5. * This file defines the basic processing logic flow for the system
  6. *
  7. * @package MicroMVC
  8. * @author David Pennington
  9. * @copyright (c) 2011 MicroMVC Framework
  10. * @license http://micromvc.com/license
  11. ********************************** 80 Columns *********************************
  12. */
  13. // Include bootstrap
  14. require('../Bootstrap.php');
  15. try
  16. {
  17. // Anything else before we start?
  18. event('system.startup');
  19. // Load controller dispatch passing URL routes
  20. $dispatch = new \Micro\Dispatch(config('Route')->routes);
  21. // Run controller based on URL path and HTTP request method
  22. $controller = $dispatch->controller(PATH, getenv('REQUEST_METHOD'));
  23. // Send the controller response
  24. $controller->send();
  25. // One last chance to do something
  26. event('system.shutdown', $controller);
  27. }
  28. catch (Exception $e)
  29. {
  30. \Micro\Error::exception($e);
  31. }