mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2026-01-31 09:46:20 +00:00
🤖 Auto commit for release 'develop' on 2026-01-23
This commit is contained in:
@@ -137,14 +137,14 @@ class DebugController extends Controller
|
||||
*/
|
||||
public function index(): Factory|\Illuminate\Contracts\View\View
|
||||
{
|
||||
$table = $this->generateTable();
|
||||
$table = str_replace(["\n", "\t", ' '], '', $table);
|
||||
$now = now(config('app.timezone'))->format('Y-m-d H:i:s');
|
||||
$table = $this->generateTable();
|
||||
$table = str_replace(["\n", "\t", ' '], '', $table);
|
||||
$now = now(config('app.timezone'))->format('Y-m-d H:i:s');
|
||||
|
||||
// get latest log file:
|
||||
$logger = Log::driver();
|
||||
$logger = Log::driver();
|
||||
// PHPstan doesn't recognize the method because of its polymorphic nature.
|
||||
$handlers = $logger->getHandlers(); // @phpstan-ignore-line
|
||||
$handlers = $logger->getHandlers(); // @phpstan-ignore-line
|
||||
$logContent = '';
|
||||
foreach ($handlers as $handler) {
|
||||
if ($handler instanceof RotatingFileHandler) {
|
||||
@@ -156,7 +156,7 @@ class DebugController extends Controller
|
||||
}
|
||||
if ('' !== $logContent) {
|
||||
// last few lines
|
||||
$logContent = 'Truncated from this point <----|' . substr($logContent, -16384);
|
||||
$logContent = 'Truncated from this point <----|'.substr($logContent, -16384);
|
||||
}
|
||||
|
||||
return view('debug', ['table' => $table, 'now' => $now, 'logContent' => $logContent]);
|
||||
@@ -198,18 +198,18 @@ class DebugController extends Controller
|
||||
'error_reporting' => $this->errorReporting((int) ini_get('error_reporting')),
|
||||
'upload_size' => min($maxFileSize, $maxPostSize),
|
||||
'all_drivers' => $drivers,
|
||||
'current_driver' => $currentDriver
|
||||
'current_driver' => $currentDriver,
|
||||
];
|
||||
}
|
||||
|
||||
private function getBuildInfo(): array
|
||||
{
|
||||
$return = [
|
||||
'is_docker' => env('IS_DOCKER', false), // @phpstan-ignore-line
|
||||
'is_docker' => env('IS_DOCKER', false), // @phpstan-ignore-line
|
||||
'build' => '(unknown)',
|
||||
'build_date' => '(unknown)',
|
||||
'base_build' => '(unknown)',
|
||||
'base_build_date' => '(unknown)'
|
||||
'base_build_date' => '(unknown)',
|
||||
];
|
||||
|
||||
try {
|
||||
@@ -242,7 +242,7 @@ class DebugController extends Controller
|
||||
|
||||
private function getAppInfo(): array
|
||||
{
|
||||
$userGuard = config('auth.defaults.guard');
|
||||
$userGuard = config('auth.defaults.guard');
|
||||
|
||||
$config = FireflyConfig::get('last_rt_job', 0);
|
||||
$lastTime = (int) $config->data;
|
||||
@@ -267,26 +267,26 @@ class DebugController extends Controller
|
||||
// any of the cron jobs will do, they always run at the same time.
|
||||
// but this job is the oldest, so the biggest chance it ran once
|
||||
|
||||
'last_cronjob' => $lastCronjob,
|
||||
'last_cronjob_ago' => $lastCronjobAgo
|
||||
'last_cronjob' => $lastCronjob,
|
||||
'last_cronjob_ago' => $lastCronjobAgo,
|
||||
];
|
||||
}
|
||||
|
||||
private function getUserInfo(): array
|
||||
{
|
||||
$userFlags = $this->getUserFlags();
|
||||
$userFlags = $this->getUserFlags();
|
||||
|
||||
// user info
|
||||
$userAgent = request()->header('user-agent');
|
||||
$userAgent = request()->header('user-agent');
|
||||
|
||||
// set languages, see what happens:
|
||||
$original = setlocale(LC_ALL, '0');
|
||||
$localeAttempts = [];
|
||||
$parts = Steam::getLocaleArray(Steam::getLocale());
|
||||
foreach ($parts as $code) {
|
||||
$code = trim($code);
|
||||
$code = trim($code);
|
||||
Log::debug(sprintf('Trying to set %s', $code));
|
||||
$result = setlocale(LC_ALL, $code);
|
||||
$result = setlocale(LC_ALL, $code);
|
||||
$localeAttempts[$code] = $result === $code;
|
||||
}
|
||||
setlocale(LC_ALL, (string) $original);
|
||||
@@ -301,16 +301,16 @@ class DebugController extends Controller
|
||||
'locale_attempts' => $localeAttempts,
|
||||
'locale' => Steam::getLocale(),
|
||||
'language' => Steam::getLanguage(),
|
||||
'view_range' => Preferences::get('viewRange', '1M')->data
|
||||
'view_range' => Preferences::get('viewRange', '1M')->data,
|
||||
];
|
||||
}
|
||||
|
||||
private function getUserFlags(): string
|
||||
{
|
||||
$flags = [];
|
||||
$flags = [];
|
||||
|
||||
/** @var User $user */
|
||||
$user = auth()->user();
|
||||
$user = auth()->user();
|
||||
|
||||
// has liabilities
|
||||
if ($user->accounts()->accountTypeIn([AccountTypeEnum::DEBT->value, AccountTypeEnum::LOAN->value, AccountTypeEnum::MORTGAGE->value])->count() > 0) {
|
||||
@@ -326,7 +326,7 @@ class DebugController extends Controller
|
||||
}
|
||||
|
||||
// has stored reconciliations
|
||||
$type = TransactionType::whereType(TransactionTypeEnum::RECONCILIATION->value)->first();
|
||||
$type = TransactionType::whereType(TransactionTypeEnum::RECONCILIATION->value)->first();
|
||||
if ($user->transactionJournals()->where('transaction_type_id', $type->id)->count() > 0) {
|
||||
$flags[] = '<span title="Has reconciled">:ledger:</span>';
|
||||
}
|
||||
@@ -386,7 +386,7 @@ class DebugController extends Controller
|
||||
if (null === $route->getName()) {
|
||||
var_dump($route);
|
||||
|
||||
exit();
|
||||
exit;
|
||||
}
|
||||
|
||||
echo substr($route->uri(), 3);
|
||||
@@ -398,7 +398,7 @@ class DebugController extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
exit();
|
||||
exit;
|
||||
}
|
||||
|
||||
$return = [];
|
||||
@@ -427,25 +427,25 @@ class DebugController extends Controller
|
||||
if (null === $route->getName()) {
|
||||
var_dump($route);
|
||||
|
||||
exit();
|
||||
exit;
|
||||
}
|
||||
if (!str_contains($route->uri(), '{')) {
|
||||
$return[$route->getName()] = route($route->getName());
|
||||
|
||||
continue;
|
||||
}
|
||||
$params = [];
|
||||
$params = [];
|
||||
foreach ($route->parameterNames() as $name) {
|
||||
$params[] = $this->getParameter($name);
|
||||
}
|
||||
$return[$route->getName()] = route($route->getName(), $params);
|
||||
}
|
||||
$count = 0;
|
||||
$count = 0;
|
||||
echo '<hr>';
|
||||
echo '<h1>Routes</h1>';
|
||||
echo sprintf('<h2>%s</h2>', $count);
|
||||
foreach ($return as $name => $path) {
|
||||
echo sprintf('<a href="%1$s">%2$s</a><br>', $path, $name) . PHP_EOL;
|
||||
echo sprintf('<a href="%1$s">%2$s</a><br>', $path, $name).PHP_EOL;
|
||||
++$count;
|
||||
if (0 === ($count % 10)) {
|
||||
echo '<hr>';
|
||||
@@ -453,7 +453,7 @@ class DebugController extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
exit();
|
||||
exit;
|
||||
}
|
||||
|
||||
private function getParameter(string $name): string
|
||||
|
||||
Reference in New Issue
Block a user