Text tweaks
parent
35cca1ed7f
commit
a8aef7e203
|
@ -120,7 +120,7 @@ class RemoteFilesystem
|
||||||
}
|
}
|
||||||
|
|
||||||
if (false === $result) {
|
if (false === $result) {
|
||||||
throw new \RuntimeException("the '$fileUrl' file could not be downloaded");
|
throw new \RuntimeException("The '$fileUrl' file could not be downloaded");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -141,7 +141,7 @@ class RemoteFilesystem
|
||||||
case STREAM_NOTIFY_FAILURE:
|
case STREAM_NOTIFY_FAILURE:
|
||||||
// for private repository returning 404 error when the authorization is incorrect
|
// for private repository returning 404 error when the authorization is incorrect
|
||||||
$auth = $this->io->getAuthorization($this->originUrl);
|
$auth = $this->io->getAuthorization($this->originUrl);
|
||||||
$ps = $this->firstCall && 404 === $messageCode && null === $auth['username'];
|
$attemptAuthentication = $this->firstCall && 404 === $messageCode && null === $auth['username'];
|
||||||
|
|
||||||
if (404 === $messageCode && !$this->firstCall) {
|
if (404 === $messageCode && !$this->firstCall) {
|
||||||
throw new \RuntimeException("The '" . $this->fileUrl . "' URL not found");
|
throw new \RuntimeException("The '" . $this->fileUrl . "' URL not found");
|
||||||
|
@ -150,18 +150,18 @@ class RemoteFilesystem
|
||||||
$this->firstCall = false;
|
$this->firstCall = false;
|
||||||
|
|
||||||
// get authorization informations
|
// get authorization informations
|
||||||
if (401 === $messageCode || $ps) {
|
if (401 === $messageCode || $attemptAuthentication) {
|
||||||
if (!$this->io->isInteractive()) {
|
if (!$this->io->isInteractive()) {
|
||||||
$mess = "The '" . $this->fileUrl . "' URL was not found";
|
$mess = "The '" . $this->fileUrl . "' URL was not found";
|
||||||
|
|
||||||
if (401 === $code || $ps) {
|
if (401 === $code || $attemptAuthentication) {
|
||||||
$mess = "The '" . $this->fileUrl . "' URL required the authorization.\nYou must be using the interactive console";
|
$mess = "The '" . $this->fileUrl . "' URL required authentication.\nYou must be using the interactive console";
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new \RuntimeException($mess);
|
throw new \RuntimeException($mess);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->io->overwrite(' Authorization required (<info>'.parse_url($this->fileUrl, PHP_URL_HOST).'</info>):');
|
$this->io->overwrite(' Authentication required (<info>'.parse_url($this->fileUrl, PHP_URL_HOST).'</info>):');
|
||||||
$username = $this->io->ask(' Username: ');
|
$username = $this->io->ask(' Username: ');
|
||||||
$password = $this->io->askAndHideAnswer(' Password: ');
|
$password = $this->io->askAndHideAnswer(' Password: ');
|
||||||
$this->io->setAuthorization($this->originUrl, $username, $password);
|
$this->io->setAuthorization($this->originUrl, $username, $password);
|
||||||
|
|
Loading…
Reference in New Issue