mirror of
https://github.com/Sarjuuk/aowow.git
synced 2025-11-29 15:58:16 +08:00
DB/Errors
* improve db error handling * web view should always result in an user friendly error if the db connection is missing or erronous * cli use should never fatal if the db connection is erronous. How are you going to fix it, d'uh. * if some CLISetup script requires a db connection check it individually
This commit is contained in:
@@ -175,14 +175,14 @@ abstract class CLI
|
||||
$nCols = count($row);
|
||||
|
||||
for ($j = 0; $j < $nCols - 1; $j++) // don't pad last column
|
||||
$pads[$j] = max($pads[$j] ?? 0, mb_strlen($row[$j]));
|
||||
$pads[$j] = max($pads[$j] ?? 0, mb_strlen($row[$j] ?? ''));
|
||||
}
|
||||
self::write();
|
||||
|
||||
foreach ($out as $row)
|
||||
{
|
||||
for ($i = 0; $i < $nCols - 1; $i++) // don't pad last column
|
||||
$row[$i] = str_pad($row[$i], $pads[$i] + 2);
|
||||
$row[$i] = str_pad($row[$i] ?? '', $pads[$i] + 2);
|
||||
|
||||
self::write(' '.implode($row), -1, $timestamp);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user