app.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. declare(strict_types=1);
  3. /*
  4. |--------------------------------------------------------------------------
  5. | Create The Application
  6. |--------------------------------------------------------------------------
  7. |
  8. | The first thing we will do is create a new Hypervel application instance
  9. | which serves as the "glue" for all the components of Hypervel, and is
  10. | the IoC container for the system binding all of the various parts.
  11. |
  12. */
  13. $app = new Hypervel\Foundation\Application();
  14. /*
  15. |--------------------------------------------------------------------------
  16. | Bind Important Interfaces
  17. |--------------------------------------------------------------------------
  18. |
  19. | Next, we need to bind some important interfaces into the container so
  20. | we will be able to resolve them when needed.
  21. |
  22. */
  23. $app->bind(
  24. Hypervel\Foundation\Console\Contracts\Kernel::class,
  25. App\Console\Kernel::class
  26. );
  27. $app->bind(
  28. Hypervel\Foundation\Exceptions\Contracts\ExceptionHandler::class,
  29. App\Exceptions\Handler::class
  30. );
  31. Hypervel\Context\ApplicationContext::setContainer($app);
  32. return $app;