generate-proxy-class.php 817 B

12345678910111213141516171819202122232425262728
  1. #!/usr/bin/env php
  2. <?php
  3. /**
  4. * @file
  5. * A command line application to generate proxy classes.
  6. */
  7. use Drupal\Core\Command\GenerateProxyClassApplication;
  8. use Drupal\Core\DrupalKernel;
  9. use Drupal\Core\ProxyBuilder\ProxyBuilder;
  10. use Drupal\Core\Site\Settings;
  11. use Symfony\Component\HttpFoundation\Request;
  12. if (PHP_SAPI !== 'cli') {
  13. return;
  14. }
  15. // Bootstrap.
  16. $autoloader = require __DIR__ . '/../../autoload.php';
  17. require_once __DIR__ . '/../includes/bootstrap.inc';
  18. $request = Request::createFromGlobals();
  19. Settings::initialize(dirname(dirname(__DIR__)), DrupalKernel::findSitePath($request), $autoloader);
  20. $kernel = DrupalKernel::createFromRequest($request, $autoloader, 'prod')->boot();
  21. // Run the database dump command.
  22. $application = new GenerateProxyClassApplication(new ProxyBuilder());
  23. $application->run();