diff --git a/src/Commands/UwDrushCommands.php b/src/Commands/UwDrushCommands.php index 8ec677b949609a6f72e9204a475ff6aed68c6a38..ad59a42b8dd8fcc89f9a054de722a203deb2dd66 100644 --- a/src/Commands/UwDrushCommands.php +++ b/src/Commands/UwDrushCommands.php @@ -8,7 +8,6 @@ use Drupal\uw_cfg_common\Service\UWMissingBlocks; use Drupal\uw_cfg_common\UwRoles\UwRoles; use Drush\Commands\DrushCommands; use Drush\Utils\StringUtils; -use Symfony\Component\HttpFoundation\RequestStack; /** * Drush commands for uw_cfg_common module. @@ -38,21 +37,13 @@ class UwDrushCommands extends DrushCommands { */ protected $configFactory; - /** - * Request from core. - * - * @var \Symfony\Component\HttpFoundation\Request - */ - protected $request; - /** * {@inheritDoc} */ - public function __construct(EntityTypeManagerInterface $entityTypeManager, UWMissingBlocks $missingBlocks, ConfigFactoryInterface $configFactory, RequestStack $requestStack) { + public function __construct(EntityTypeManagerInterface $entityTypeManager, UWMissingBlocks $missingBlocks, ConfigFactoryInterface $configFactory) { $this->entityTypeManager = $entityTypeManager; $this->missingBlocks = $missingBlocks; $this->configFactory = $configFactory; - $this->request = $requestStack->getCurrentRequest(); } /** @@ -208,25 +199,24 @@ class UwDrushCommands extends DrushCommands { } /** - * Command to retrieve scheduler's lightweight cron url. + * Command to retrieve scheduler's lightweight cron path. * * @return string - * Lightweight cron url. + * Lightweight cron path. * - * @command uw:lightweight-cron-url - * @aliases uw-lwc-url - * @usage drush uw-lwc-url + * @command uw:lightweight-cron-path + * @aliases uw-lwc-path + * @usage drush uw-lwc-path * - Return light weight cron url with key. */ - public function getLightWeightCronUrl(): string { - $url = ''; - $host = $this->request->getSchemeAndHttpHost(); + public function getLightWeightCronPath(): string { + $path = ''; if ($key = $this->getLightWeightCronKey()) { - $url = $host . '/scheduler/cron/' . $key; + $path = '/scheduler/cron/' . $key; } - return $url; + return $path; } }