command.php 836 B

1234567891011121314151617181920212223
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. require_once __DIR__ . '/../../../../app/bootstrap.php';
  7. use Symfony\Component\Console\Input\StringInput;
  8. use Symfony\Component\Console\Output\NullOutput;
  9. if (isset($_GET['command'])) {
  10. $command = urldecode($_GET['command']);
  11. $magentoObjectManagerFactory = \Magento\Framework\App\Bootstrap::createObjectManagerFactory(BP, $_SERVER);
  12. $magentoObjectManager = $magentoObjectManagerFactory->create($_SERVER);
  13. $cli = $magentoObjectManager->create(\Magento\Framework\Console\Cli::class);
  14. $input = new StringInput($command);
  15. $input->setInteractive(false);
  16. $output = new NullOutput();
  17. $cli->doRun($input, $output);
  18. } else {
  19. throw new \InvalidArgumentException("Command GET parameter is not set.");
  20. }