app.init.php 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. $url = "http://dev.vestacp.com:8083/dispatch.php";
  3. $useragent = "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)";
  4. $ch = curl_init();
  5. curl_setopt($ch, CURLOPT_USERAGENT, $useragent);
  6. curl_setopt($ch, CURLOPT_POST, 1);
  7. curl_setopt($ch, CURLOPT_URL,$url);
  8. curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($_POST));
  9. $result= curl_exec ($ch);
  10. curl_close ($ch);
  11. die();
  12. define('V_ROOT_DIR', dirname(__FILE__) . DIRECTORY_SEPARATOR);
  13. require_once V_ROOT_DIR . 'config/Config.class.php';
  14. require_once V_ROOT_DIR . 'core/VestaSession.class.php';
  15. require_once V_ROOT_DIR . 'core/Vesta.class.php';
  16. require_once V_ROOT_DIR . 'core/exceptions/SystemException.class.php';
  17. require_once V_ROOT_DIR . 'core/exceptions/ProtectionException.class.php';
  18. require_once V_ROOT_DIR . 'core/utils/Message.class.php';
  19. require_once V_ROOT_DIR . 'core/Request.class.php';
  20. require_once V_ROOT_DIR . 'api/AjaxHandler.php';
  21. /**
  22. * App execution
  23. *
  24. * @author Malishev Dima <dima.malishev@gmail.com>
  25. * @author vesta, http://vestacp.com/
  26. * @copyright vesta 2010-2011
  27. */
  28. try {
  29. // Execution
  30. AjaxHandler::makeReply(
  31. AjaxHandler::getInstance()->dispatch(new Request())
  32. );
  33. }
  34. //
  35. // Errors handling
  36. //
  37. catch (SystemException $e) {
  38. AjaxHandler::systemError($e);
  39. }
  40. catch (ProtectionException $e) {
  41. AjaxHandler::protectionError($e);
  42. }
  43. catch (Exception $e) {
  44. AjaxHandler::generalError($e);
  45. }