app.init.php 988 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. define('V_ROOT_DIR', dirname(__FILE__) . DIRECTORY_SEPARATOR);
  3. require_once V_ROOT_DIR . 'config/Config.class.php';
  4. require_once V_ROOT_DIR . 'core/Vesta.class.php';
  5. require_once V_ROOT_DIR . 'core/exceptions/SystemException.class.php';
  6. require_once V_ROOT_DIR . 'core/exceptions/ProtectionException.class.php';
  7. require_once V_ROOT_DIR . 'core/utils/Message.class.php';
  8. require_once V_ROOT_DIR . 'core/Request.class.php';
  9. require_once V_ROOT_DIR . 'api/AjaxHandler.php';
  10. /**
  11. * App execution
  12. *
  13. * @author Malishev Dima <dima.malishev@gmail.com>
  14. * @author vesta, http://vestacp.com/
  15. * @copyright vesta 2010-2011
  16. */
  17. try {
  18. // Execution
  19. AjaxHandler::makeReply(
  20. AjaxHandler::getInstance()->dispatch(new Request())
  21. );
  22. }
  23. //
  24. // Errors handling
  25. //
  26. catch (SystemException $e) {
  27. AjaxHandler::systemError($e);
  28. }
  29. catch (ProtectionException $e) {
  30. AjaxHandler::protectionError($e);
  31. }
  32. catch (Exception $e) {
  33. AjaxHandler::generalError($e);
  34. }