Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

console 1.2KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #!/usr/bin/env php
  2. <?php
  3. use App\Kernel;
  4. use Symfony\Bundle\FrameworkBundle\Console\Application;
  5. use Symfony\Component\Console\Input\ArgvInput;
  6. use Symfony\Component\Debug\Debug;
  7. use Symfony\Component\Dotenv\Dotenv;
  8. set_time_limit(0);
  9. require __DIR__.'/../vendor/autoload.php';
  10. if (!class_exists(Application::class)) {
  11. throw new \RuntimeException('You need to add "symfony/framework-bundle" as a Composer dependency.');
  12. }
  13. $_SERVER['APP_ENV']='helloworld';
  14. if (!isset($_SERVER['APP_ENV'])) {
  15. if (!class_exists(Dotenv::class)) {
  16. throw new \RuntimeException('APP_ENV environment variable is not defined. You need to define environment variables for configuration or add "symfony/dotenv" as a Composer dependency to load variables from a .env file.');
  17. }
  18. (new Dotenv())->load(__DIR__.'/../.env');
  19. }
  20. $input = new ArgvInput();
  21. $env = $input->getParameterOption(['--env', '-e'], $_SERVER['APP_ENV'] ?? 'dev');
  22. $debug = ($_SERVER['APP_DEBUG'] ?? ('prod' !== $env)) && !$input->hasParameterOption(['--no-debug', '']);
  23. if ($debug) {
  24. umask(0000);
  25. if (class_exists(Debug::class)) {
  26. Debug::enable();
  27. }
  28. }
  29. $kernel = new Kernel($env, $debug);
  30. $application = new Application($kernel);
  31. $application->run($input);