diff --git a/Console/Command/ConfigShowDefaultUrlCommand.php b/Console/Command/ConfigShowDefaultUrlCommand.php new file mode 100644 index 0000000..20c69be --- /dev/null +++ b/Console/Command/ConfigShowDefaultUrlCommand.php @@ -0,0 +1,59 @@ +storeManager = $storeManager; + } + + /** + * @inheritdoc + */ + protected function configure() + { + $this->setName('config:show:default-url') + ->setDescription('Shows base url for default store of default website'); + + parent::configure(); + } + + /** + * Returns base url for default store of default website + * + * {@inheritdoc} + */ + protected function execute(InputInterface $input, OutputInterface $output) + { + /** @var Store $store */ + $store = $this->storeManager->getDefaultStoreView(); + $output->write($store->getBaseUrl(UrlInterface::URL_TYPE_LINK, $store->isUrlSecure())); + + return Cli::RETURN_SUCCESS; + } +} diff --git a/etc/di.xml b/etc/di.xml index 7c3b704..e531790 100644 --- a/etc/di.xml +++ b/etc/di.xml @@ -11,6 +11,7 @@ Magento\CloudComponents\Console\Command\ConfigShowStoreUrlCommand Magento\CloudComponents\Console\Command\ConfigShowEntityUrlsCommand + Magento\CloudComponents\Console\Command\ConfigShowDefaultUrlCommand