app.init.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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/utils/Utils.class.php';
  5. require_once V_ROOT_DIR . 'core/VestaSession.class.php';
  6. require_once V_ROOT_DIR . 'core/Vesta.class.php';
  7. require_once V_ROOT_DIR . 'core/exceptions/SystemException.class.php';
  8. require_once V_ROOT_DIR . 'core/exceptions/ProtectionException.class.php';
  9. require_once V_ROOT_DIR . 'core/utils/Message.class.php';
  10. require_once V_ROOT_DIR . 'core/Request.class.php';
  11. require_once V_ROOT_DIR . 'api/AjaxHandler.php';
  12. /**
  13. * App execution
  14. *
  15. * @author Malishev Dima <[email protected]>
  16. * @author vesta, http://vestacp.com/
  17. * @copyright vesta 2010-2011
  18. */
  19. try {
  20. // Execution
  21. AjaxHandler::makeReply(
  22. AjaxHandler::getInstance()->dispatch(new Request())
  23. );
  24. }
  25. //
  26. // Errors handling
  27. //
  28. catch (SystemException $e) {
  29. AjaxHandler::systemError($e);
  30. }
  31. catch (ProtectionException $e) {
  32. AjaxHandler::protectionError($e);
  33. }
  34. catch (Exception $e) {
  35. AjaxHandler::generalError($e);
  36. }