Enable Discovery debug logging for production troubleshooting

- Add DISCOVERY_LOG_LEVEL=debug
- Add DISCOVERY_SHOW_PROGRESS=true
- Temporary changes for debugging InitializerProcessor fixes on production
This commit is contained in:
2025-08-11 20:13:26 +02:00
parent 59fd3dd3b1
commit 55a330b223
3683 changed files with 2956207 additions and 16948 deletions

View File

@@ -1,10 +1,12 @@
<?php
declare(strict_types=1);
namespace App\Framework\Console\Components;
use App\Framework\Console\ConsoleColor;
use App\Framework\Console\ConsoleOutput;
use App\Framework\Console\ConsoleOutputInterface;
/**
* Klasse für interaktive Menüs in der Konsole.
@@ -14,12 +16,16 @@ use App\Framework\Console\ConsoleOutput;
final class InteractiveMenu
{
private ConsoleOutput $output;
private array $menuItems = [];
private string $title = '';
private int $selectedIndex = 0;
private bool $showNumbers = true;
public function __construct(ConsoleOutput $output)
public function __construct(ConsoleOutputInterface $output)
{
$this->output = $output;
}
@@ -30,6 +36,7 @@ final class InteractiveMenu
public function setTitle(string $title): self
{
$this->title = $title;
return $this;
}
@@ -45,8 +52,9 @@ final class InteractiveMenu
$this->menuItems[] = [
'label' => $label,
'action' => $action,
'value' => $value ?? $label
'value' => $value ?? $label,
];
return $this;
}
@@ -59,8 +67,9 @@ final class InteractiveMenu
'label' => '---',
'action' => null,
'value' => null,
'separator' => true
'separator' => true,
];
return $this;
}
@@ -70,6 +79,7 @@ final class InteractiveMenu
public function showNumbers(bool $show = true): self
{
$this->showNumbers = $show;
return $this;
}
@@ -79,7 +89,7 @@ final class InteractiveMenu
public function showSimple(): mixed
{
// Verwende den ScreenManager anstelle des direkten clearScreen()
$this->output->screen()->newMenu();
$this->output->screen->newMenu();
if ($this->title) {
$this->output->writeLine($this->title, ConsoleColor::BRIGHT_CYAN);
@@ -90,6 +100,7 @@ final class InteractiveMenu
foreach ($this->menuItems as $index => $item) {
if (isset($item['separator'])) {
$this->output->writeLine($item['label'], ConsoleColor::GRAY);
continue;
}
@@ -104,7 +115,7 @@ final class InteractiveMenu
if (is_numeric($input)) {
$selectedIndex = (int)$input - 1;
if (isset($this->menuItems[$selectedIndex]) && !isset($this->menuItems[$selectedIndex]['separator'])) {
if (isset($this->menuItems[$selectedIndex]) && ! isset($this->menuItems[$selectedIndex]['separator'])) {
$item = $this->menuItems[$selectedIndex];
if ($item['action']) {
@@ -116,6 +127,7 @@ final class InteractiveMenu
}
$this->output->writeError('Ungültige Auswahl!');
return $this->showSimple();
}
@@ -124,7 +136,7 @@ final class InteractiveMenu
*/
public function showInteractive(): mixed
{
$this->output->screen()->setInteractiveMode();
$this->output->screen->setInteractiveMode();
// Terminal in Raw-Modus setzen für Tastatur-Input
$this->setRawMode(true);
@@ -137,9 +149,11 @@ final class InteractiveMenu
switch ($key) {
case "\033[A": // Pfeil hoch
$this->moveUp();
break;
case "\033[B": // Pfeil runter
$this->moveDown();
break;
case "\n": // Enter
case "\r":
@@ -162,7 +176,7 @@ final class InteractiveMenu
private function renderMenu(): void
{
// Verwende den ScreenManager anstelle des direkten clearScreen()
$this->output->screen()->newMenu();
$this->output->screen->newMenu();
if ($this->title) {
$this->output->writeLine($this->title, ConsoleColor::BRIGHT_CYAN);
@@ -173,6 +187,7 @@ final class InteractiveMenu
foreach ($this->menuItems as $index => $item) {
if (isset($item['separator'])) {
$this->output->writeLine($item['label'], ConsoleColor::GRAY);
continue;
}
@@ -229,6 +244,11 @@ final class InteractiveMenu
{
$key = fgetc(STDIN);
// Handle Docker/non-interactive environment
if ($key === false) {
return 'q'; // Auto-quit in non-interactive mode
}
// Behandle Escape-Sequenzen
if ($key === "\033") {
$key .= fgetc(STDIN);

View File

@@ -1,11 +1,12 @@
<?php
declare(strict_types=1);
namespace App\Framework\Console\Components;
use App\Framework\Console\ConsoleStyle;
use App\Framework\Console\ConsoleColor;
use App\Framework\Console\ConsoleFormat;
use App\Framework\Console\ConsoleStyle;
/**
* Rendert eine Tabelle in der Konsole.
@@ -13,8 +14,11 @@ use App\Framework\Console\ConsoleFormat;
final class Table
{
private array $headers = [];
private array $rows = [];
private array $columnWidths = [];
private int $padding = 1;
public function __construct(
@@ -35,6 +39,7 @@ final class Table
{
$this->headers = $headers;
$this->calculateColumnWidths();
return $this;
}
@@ -45,6 +50,7 @@ final class Table
{
$this->rows[] = $row;
$this->calculateColumnWidths();
return $this;
}
@@ -55,6 +61,7 @@ final class Table
{
$this->rows = $rows;
$this->calculateColumnWidths();
return $this;
}
@@ -64,6 +71,7 @@ final class Table
public function setPadding(int $padding): self
{
$this->padding = max(0, $padding);
return $this;
}
@@ -83,7 +91,7 @@ final class Table
}
// Header
if (!empty($this->headers)) {
if (! empty($this->headers)) {
$output .= $this->renderRow($this->headers, $this->headerStyle) . "\n";
if ($this->showBorders) {

View File

@@ -1,11 +1,11 @@
<?php
declare(strict_types=1);
namespace App\Framework\Console\Components;
use App\Framework\Console\ConsoleStyle;
use App\Framework\Console\ConsoleColor;
use App\Framework\Console\ConsoleFormat;
use App\Framework\Console\ConsoleStyle;
/**
* Rendert eine Textbox in der Konsole.
@@ -19,7 +19,8 @@ final readonly class TextBox
private ?ConsoleStyle $borderStyle = null,
private ?ConsoleStyle $contentStyle = null,
private ?string $title = null
) {}
) {
}
public function render(): string
{
@@ -104,7 +105,7 @@ final readonly class TextBox
if (mb_strlen($testLine) <= $width) {
$currentLine = $testLine;
} else {
if (!empty($currentLine)) {
if (! empty($currentLine)) {
$lines[] = $currentLine;
$currentLine = $word;
} else {
@@ -115,7 +116,7 @@ final readonly class TextBox
}
}
if (!empty($currentLine)) {
if (! empty($currentLine)) {
$lines[] = $currentLine;
}

View File

@@ -1,12 +1,13 @@
<?php
declare(strict_types=1);
namespace App\Framework\Console\Components;
use App\Framework\Console\ConsoleStyle;
use App\Framework\Console\ConsoleColor;
use App\Framework\Console\ConsoleFormat;
use App\Framework\Console\ConsoleOutput;
use App\Framework\Console\ConsoleStyle;
/**
* TreeHelper zum Anzeigen hierarchischer Baumstrukturen in der Konsole.
@@ -15,9 +16,13 @@ use App\Framework\Console\ConsoleOutput;
final class TreeHelper
{
private string $prefix = '';
private bool $isLastElement = true;
private ?ConsoleStyle $nodeStyle = null;
private ?ConsoleStyle $leafStyle = null;
private ?ConsoleStyle $lineStyle = null;
/**
@@ -40,6 +45,7 @@ final class TreeHelper
public function setNodeStyle(?ConsoleStyle $style): self
{
$this->nodeStyle = $style;
return $this;
}
@@ -49,6 +55,7 @@ final class TreeHelper
public function setLeafStyle(?ConsoleStyle $style): self
{
$this->leafStyle = $style;
return $this;
}
@@ -58,6 +65,7 @@ final class TreeHelper
public function setLineStyle(?ConsoleStyle $style): self
{
$this->lineStyle = $style;
return $this;
}
@@ -67,6 +75,7 @@ final class TreeHelper
public function setTitle(string $title): self
{
$this->title = $title;
return $this;
}
@@ -83,7 +92,7 @@ final class TreeHelper
$this->nodes[] = [
'title' => $title,
'node' => $node,
'isLeaf' => false
'isLeaf' => false,
];
return $node;
@@ -97,7 +106,7 @@ final class TreeHelper
$this->nodes[] = [
'title' => $title,
'node' => null,
'isLeaf' => true
'isLeaf' => true,
];
return $this;
@@ -108,7 +117,7 @@ final class TreeHelper
*/
public function display(): void
{
if (!empty($this->title)) {
if (! empty($this->title)) {
$this->output->writeLine($this->title, $this->nodeStyle);
}
@@ -122,7 +131,7 @@ final class TreeHelper
{
$output = '';
if (!empty($this->title)) {
if (! empty($this->title)) {
$output .= $this->nodeStyle->apply($this->title) . "\n";
}
@@ -139,6 +148,7 @@ final class TreeHelper
{
$this->prefix = $prefix;
$this->isLastElement = $isLastElement;
return $this;
}
@@ -168,7 +178,7 @@ final class TreeHelper
);
// Unterelemente rekursiv anzeigen
if (!$item['isLeaf'] && $item['node'] !== null) {
if (! $item['isLeaf'] && $item['node'] !== null) {
$item['node']
->setPrefix($nodePrefix, $isLast)
->displayTree();
@@ -201,7 +211,7 @@ final class TreeHelper
$style->apply($title) . "\n";
// Unterelemente rekursiv rendern
if (!$item['isLeaf'] && $item['node'] !== null) {
if (! $item['isLeaf'] && $item['node'] !== null) {
$childOutput = $item['node']
->setPrefix($nodePrefix, $isLast)
->renderTree();