app.init.php 1.0 KB

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