88namespace Drupal \Console \Command \Multisite ;
99
1010use Drupal \Console \Core \Command \Command ;
11+ use Drupal \Console \Utils \Site ;
1112use Symfony \Component \Console \Input \InputInterface ;
1213use Symfony \Component \Console \Input \InputOption ;
1314use Symfony \Component \Console \Output \OutputInterface ;
@@ -23,14 +24,21 @@ class UpdateCommand extends Command
2324{
2425 protected $ appRoot ;
2526
27+ /**
28+ * @var Site
29+ */
30+ protected $ site ;
31+
2632 /**
2733 * DebugCommand constructor.
2834 *
2935 * @param $appRoot
36+ * @param Site $site
3037 */
31- public function __construct ($ appRoot )
38+ public function __construct ($ appRoot, Site $ site )
3239 {
3340 $ this ->appRoot = $ appRoot ;
41+ $ this ->site = $ site ;
3442 parent ::__construct ();
3543 }
3644
@@ -81,7 +89,7 @@ public function configure()
8189 */
8290 protected function interact (InputInterface $ input , OutputInterface $ output )
8391 {
84- $ this ->uri = parse_url ( $ input -> getParameterOption ([ ' --uri ' , ' -l ' ], ' default ' ), PHP_URL_HOST );
92+ $ this ->uri = $ this -> site -> getMultisiteName ( $ input );
8593
8694 $ sites = $ this ->getMultisite ($ this ->uri );
8795 if ($ this ->uri == "default " ) {
@@ -113,7 +121,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
113121 $ this ->fs = new Filesystem ();
114122
115123 if (empty ($ this ->uri )) {
116- $ uri = parse_url ( $ input -> getParameterOption ([ ' --uri ' , ' -l ' ], ' default ' ), PHP_URL_HOST );
124+ $ uri = $ this -> site -> getMultisiteName ( $ input );
117125 $ sites = $ this ->getMultisite ($ uri );
118126 $ this ->uri = $ sites [$ uri ];
119127 }
0 commit comments