Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
InfoAdminUriCommand.php
Go to the documentation of this file.
1 <?php
8 
9 use Symfony\Component\Console\Input\InputInterface;
10 use Symfony\Component\Console\Output\OutputInterface;
11 use Symfony\Component\Console\Command\Command;
12 use \Magento\Backend\Setup\ConfigOptionsList as BackendConfigOptionsList;
13 
14 class InfoAdminUriCommand extends Command
15 {
19  private $deploymentConfig;
20 
28  public function __construct(\Magento\Framework\App\DeploymentConfig $deploymentConfig)
29  {
30  $this->deploymentConfig = $deploymentConfig;
31  parent::__construct();
32  }
33 
39  protected function configure()
40  {
41  $this->setName('info:adminuri')
42  ->setDescription('Displays the Magento Admin URI');
43  parent::configure();
44  }
45 
49  protected function execute(InputInterface $input, OutputInterface $output)
50  {
51  $output->writeln(
52  "\nAdmin URI: /"
53  . $this->deploymentConfig->get(BackendConfigOptionsList::CONFIG_PATH_BACKEND_FRONTNAME)
54  . "\n"
55  );
56  return \Magento\Framework\Console\Cli::RETURN_SUCCESS;
57  }
58 }
__construct(\Magento\Framework\App\DeploymentConfig $deploymentConfig)
$deploymentConfig
execute(InputInterface $input, OutputInterface $output)