app.init.php 1.2 KB

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