engineer 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. <?php
  2. require __DIR__.'/vendor/autoload.php';
  3. use Dotenv\Dotenv;
  4. use Symfony\Component\Console\Application;
  5. use Fomo\Commands\Server\Start as StartServerCommand;
  6. use Fomo\Commands\Server\Reload as ReloadServerCommand;
  7. use Fomo\Commands\Server\Status as StatusServerCommand;
  8. use Fomo\Commands\Server\Stop as StopServerCommand;
  9. use Fomo\Commands\Build\Controller as BuildControllerCommand;
  10. use Fomo\Commands\Build\Exception as BuildExceptionCommand;
  11. use Fomo\Commands\Build\Middleware as BuildMiddlewareCommand;
  12. use Fomo\Commands\Build\Resource as BuildResourceCommand;
  13. use Fomo\Commands\Build\Test as BuildTestCommand;
  14. use Fomo\Commands\Build\Job as BuildJobCommand;
  15. use Fomo\Commands\Build\Task as BuildTaskCommand;
  16. use Fomo\Commands\Build\Service as BuildServiceCommand;
  17. use Fomo\Commands\Tests\Run as TestsRunCommand;
  18. use Fomo\Commands\Factory\Start as FactoryStartCommand;
  19. use Fomo\Commands\Queue\Start as QueueStartCommand;
  20. use Fomo\Commands\Queue\Status as QueueStatusCommand;
  21. use Fomo\Commands\Queue\Stop as QueueStopCommand;
  22. use Fomo\Commands\Scheduling\Start as SchedulerStartCommand;
  23. use Fomo\Commands\Scheduling\Status as SchedulerStatusCommand;
  24. use Fomo\Commands\Scheduling\Stop as SchedulerStopCommand;
  25. /*
  26. * create const's and definitions
  27. */
  28. define('PROJECT_PATH' , realpath('./'));
  29. const FOMO_VERSION = '2.4.3';
  30. const ENABLE = true;
  31. const DISABLE = false;
  32. /*
  33. * load .env file
  34. */
  35. Dotenv::createImmutable(basePath())->load();
  36. /*
  37. * set timezone
  38. */
  39. date_default_timezone_set(config('app.timezone'));
  40. /*
  41. * create console
  42. */
  43. $application = new Application();
  44. /*
  45. * server commands
  46. */
  47. $application->add(new StartServerCommand());
  48. $application->add(new ReloadServerCommand());
  49. $application->add(new StatusServerCommand());
  50. $application->add(new StopServerCommand());
  51. /*
  52. * build commands
  53. */
  54. $application->add(new BuildControllerCommand());
  55. $application->add(new BuildExceptionCommand());
  56. $application->add(new BuildMiddlewareCommand());
  57. $application->add(new BuildResourceCommand());
  58. $application->add(new BuildTestCommand());
  59. $application->add(new BuildJobCommand());
  60. $application->add(new BuildTaskCommand());
  61. $application->add(new BuildServiceCommand());
  62. /*
  63. * tests commands
  64. */
  65. $application->add(new TestsRunCommand());
  66. /*
  67. * factory commands
  68. */
  69. $application->add(new FactoryStartCommand());
  70. /*
  71. * queue commands
  72. */
  73. $application->add(new QueueStartCommand());
  74. $application->add(new QueueStatusCommand());
  75. $application->add(new QueueStopCommand());
  76. /*
  77. * scheduler commands
  78. */
  79. $application->add(new SchedulerStartCommand());
  80. $application->add(new SchedulerStatusCommand());
  81. $application->add(new SchedulerStopCommand());
  82. /*
  83. * run console
  84. */
  85. $application->run();