Skip to content
Snippets Groups Projects
Commit 6cc95029 authored by Igor Biki's avatar Igor Biki
Browse files

ISTWCMS-5409: Removing host from drush command, and using path instead that...

ISTWCMS-5409: Removing host from drush command, and using path instead that needs to be prefixed with correct host.
parent a946a535
No related branches found
No related tags found
1 merge request!229ISTWCMS-5409: Removing host from drush command, and using path instead that...
......@@ -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;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment