AppInterface.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. /**
  3. * Application interface
  4. *
  5. * Copyright © Magento, Inc. All rights reserved.
  6. * See COPYING.txt for license details.
  7. */
  8. namespace Magento\Framework;
  9. /**
  10. * Different magento entry points call corresponding applications after platform is bootstrapped.
  11. * index.php in webroot calls HTTP application (implementation of this interface) as it is responsible for web requests.
  12. * cron.php entry point calls cron application
  13. * Implementations of this interface should implement application type specific initialization.
  14. *
  15. * @api
  16. * @since 100.0.2
  17. */
  18. interface AppInterface
  19. {
  20. /**
  21. * Default application locale
  22. */
  23. const DISTRO_LOCALE_CODE = 'en_US';
  24. /**
  25. * Launch application
  26. *
  27. * @return \Magento\Framework\App\ResponseInterface
  28. */
  29. public function launch();
  30. /**
  31. * Ability to handle exceptions that may have occurred during bootstrap and launch
  32. *
  33. * Return values:
  34. * - true: exception has been handled, no additional action is needed
  35. * - false: exception has not been handled - pass the control to Bootstrap
  36. *
  37. * @param App\Bootstrap $bootstrap
  38. * @param \Exception $exception
  39. * @return bool
  40. */
  41. public function catchException(App\Bootstrap $bootstrap, \Exception $exception);
  42. }