update to laravel 5.7 and try getting autologin saved

This commit is contained in:
Kode
2018-10-14 20:50:32 +01:00
parent c3da17befc
commit 6501aacb1b
2402 changed files with 79064 additions and 28971 deletions

View File

@@ -46,7 +46,7 @@ class SymfonyStyle extends OutputStyle
$this->bufferedOutput = new BufferedOutput($output->getVerbosity(), false, clone $output->getFormatter());
// Windows cmd wraps lines as soon as the terminal width is reached, whether there are following chars or not.
$width = (new Terminal())->getWidth() ?: self::MAX_LINE_LENGTH;
$this->lineLength = min($width - (int) (DIRECTORY_SEPARATOR === '\\'), self::MAX_LINE_LENGTH);
$this->lineLength = min($width - (int) (\DIRECTORY_SEPARATOR === '\\'), self::MAX_LINE_LENGTH);
parent::__construct($output);
}
@@ -63,7 +63,7 @@ class SymfonyStyle extends OutputStyle
*/
public function block($messages, $type = null, $style = null, $prefix = ' ', $padding = false, $escape = true)
{
$messages = is_array($messages) ? array_values($messages) : array($messages);
$messages = \is_array($messages) ? array_values($messages) : array($messages);
$this->autoPrependBlock();
$this->writeln($this->createBlock($messages, $type, $style, $prefix, $padding, $escape));
@@ -117,7 +117,7 @@ class SymfonyStyle extends OutputStyle
{
$this->autoPrependText();
$messages = is_array($message) ? array_values($message) : array($message);
$messages = \is_array($message) ? array_values($message) : array($message);
foreach ($messages as $message) {
$this->writeln(sprintf(' %s', $message));
}
@@ -269,7 +269,7 @@ class SymfonyStyle extends OutputStyle
{
$progressBar = parent::createProgressBar($max);
if ('\\' !== DIRECTORY_SEPARATOR) {
if ('\\' !== \DIRECTORY_SEPARATOR || 'Hyper' === getenv('TERM_PROGRAM')) {
$progressBar->setEmptyBarCharacter('░'); // light shade character \u2591
$progressBar->setProgressCharacter('');
$progressBar->setBarCharacter('▓'); // dark shade character \u2593
@@ -306,8 +306,14 @@ class SymfonyStyle extends OutputStyle
*/
public function writeln($messages, $type = self::OUTPUT_NORMAL)
{
parent::writeln($messages, $type);
$this->bufferedOutput->writeln($this->reduceBuffer($messages), $type);
if (!is_iterable($messages)) {
$messages = array($messages);
}
foreach ($messages as $message) {
parent::writeln($message, $type);
$this->writeBuffer($message, true, $type);
}
}
/**
@@ -315,8 +321,14 @@ class SymfonyStyle extends OutputStyle
*/
public function write($messages, $newline = false, $type = self::OUTPUT_NORMAL)
{
parent::write($messages, $newline, $type);
$this->bufferedOutput->write($this->reduceBuffer($messages), $newline, $type);
if (!is_iterable($messages)) {
$messages = array($messages);
}
foreach ($messages as $message) {
parent::write($message, $newline, $type);
$this->writeBuffer($message, $newline, $type);
}
}
/**
@@ -338,10 +350,7 @@ class SymfonyStyle extends OutputStyle
return new self($this->input, $this->getErrorOutput());
}
/**
* @return ProgressBar
*/
private function getProgressBar()
private function getProgressBar(): ProgressBar
{
if (!$this->progressBar) {
throw new RuntimeException('The ProgressBar is not started.');
@@ -350,18 +359,20 @@ class SymfonyStyle extends OutputStyle
return $this->progressBar;
}
private function autoPrependBlock()
private function autoPrependBlock(): void
{
$chars = substr(str_replace(PHP_EOL, "\n", $this->bufferedOutput->fetch()), -2);
if (!isset($chars[0])) {
return $this->newLine(); //empty history, so we should start with a new line.
$this->newLine(); //empty history, so we should start with a new line.
return;
}
//Prepend new line for each non LF chars (This means no blank line was output before)
$this->newLine(2 - substr_count($chars, "\n"));
}
private function autoPrependText()
private function autoPrependText(): void
{
$fetched = $this->bufferedOutput->fetch();
//Prepend new line if last char isn't EOL:
@@ -370,16 +381,14 @@ class SymfonyStyle extends OutputStyle
}
}
private function reduceBuffer($messages)
private function writeBuffer(string $message, bool $newLine, int $type): void
{
// We need to know if the two last chars are PHP_EOL
// Preserve the last 4 chars inserted (PHP_EOL on windows is two chars) in the history buffer
return array_map(function ($value) {
return substr($value, -4);
}, array_merge(array($this->bufferedOutput->fetch()), (array) $messages));
$this->bufferedOutput->write(substr($message, -4), $newLine, $type);
}
private function createBlock($messages, $type = null, $style = null, $prefix = ' ', $padding = false, $escape = false)
private function createBlock(iterable $messages, string $type = null, string $style = null, string $prefix = ' ', bool $padding = false, bool $escape = false)
{
$indentLength = 0;
$prefixLength = Helper::strlenWithoutDecoration($this->getFormatter(), $prefix);
@@ -387,7 +396,7 @@ class SymfonyStyle extends OutputStyle
if (null !== $type) {
$type = sprintf('[%s] ', $type);
$indentLength = strlen($type);
$indentLength = \strlen($type);
$lineIndentation = str_repeat(' ', $indentLength);
}
@@ -399,7 +408,7 @@ class SymfonyStyle extends OutputStyle
$lines = array_merge($lines, explode(PHP_EOL, wordwrap($message, $this->lineLength - $prefixLength - $indentLength, PHP_EOL, true)));
if (count($messages) > 1 && $key < count($messages) - 1) {
if (\count($messages) > 1 && $key < \count($messages) - 1) {
$lines[] = '';
}
}