mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
🤖 Auto commit for release 'develop' on 2025-10-02
This commit is contained in:
@@ -37,7 +37,7 @@ class OutputsInstructions extends Command
|
||||
|
||||
protected $description = 'Instructions in case of upgrade trouble.';
|
||||
|
||||
protected $signature = 'firefly-iii:instructions {task=install}';
|
||||
protected $signature = 'firefly-iii:instructions {task=install}';
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
@@ -63,8 +63,8 @@ class OutputsInstructions extends Command
|
||||
$version = (string)config('firefly.version');
|
||||
|
||||
/** @var array $config */
|
||||
$config = config('upgrade.text.upgrade');
|
||||
$text = '';
|
||||
$config = config('upgrade.text.upgrade');
|
||||
$text = '';
|
||||
|
||||
/** @var string $compare */
|
||||
foreach (array_keys($config) as $compare) {
|
||||
@@ -79,7 +79,7 @@ class OutputsInstructions extends Command
|
||||
$text = 'Please set APP_ENV=production for a safer environment.';
|
||||
}
|
||||
|
||||
$prefix = 'v';
|
||||
$prefix = 'v';
|
||||
if (str_starts_with($version, 'develop') || str_starts_with($version, 'branch')) {
|
||||
$prefix = '';
|
||||
}
|
||||
@@ -116,8 +116,8 @@ class OutputsInstructions extends Command
|
||||
*/
|
||||
private function showLogo(): void
|
||||
{
|
||||
$today = Carbon::now()->format('m-d');
|
||||
$month = Carbon::now()->format('m');
|
||||
$today = Carbon::now()->format('m-d');
|
||||
$month = Carbon::now()->format('m');
|
||||
// variation in colors and effects just because I can!
|
||||
// default is Ukraine flag:
|
||||
$colors = ['blue', 'blue', 'blue', 'yellow', 'yellow', 'yellow', 'default', 'default'];
|
||||
@@ -166,7 +166,7 @@ class OutputsInstructions extends Command
|
||||
{
|
||||
$parts = explode("\n", wordwrap($text));
|
||||
foreach ($parts as $string) {
|
||||
$this->line('| ' . sprintf('%-77s', $string) . '|');
|
||||
$this->line('| '.sprintf('%-77s', $string).'|');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -177,7 +177,7 @@ class OutputsInstructions extends Command
|
||||
{
|
||||
$parts = explode("\n", wordwrap($text));
|
||||
foreach ($parts as $string) {
|
||||
$this->info('| ' . sprintf('%-77s', $string) . '|');
|
||||
$this->info('| '.sprintf('%-77s', $string).'|');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -196,8 +196,8 @@ class OutputsInstructions extends Command
|
||||
$version = (string)config('firefly.version');
|
||||
|
||||
/** @var array $config */
|
||||
$config = config('upgrade.text.install');
|
||||
$text = '';
|
||||
$config = config('upgrade.text.install');
|
||||
$text = '';
|
||||
|
||||
/** @var string $compare */
|
||||
foreach (array_keys($config) as $compare) {
|
||||
@@ -212,7 +212,7 @@ class OutputsInstructions extends Command
|
||||
$text = 'Please set APP_ENV=production for a safer environment.';
|
||||
}
|
||||
|
||||
$prefix = 'v';
|
||||
$prefix = 'v';
|
||||
if (str_starts_with($version, 'develop')) {
|
||||
$prefix = '';
|
||||
}
|
||||
|
@@ -243,6 +243,7 @@ class PiggyBankFactory
|
||||
}
|
||||
}
|
||||
Log::debug('Looping all accounts.');
|
||||
|
||||
/** @var array $info */
|
||||
foreach ($accounts as $info) {
|
||||
$account = $this->accountRepository->find((int)($info['account_id'] ?? 0));
|
||||
|
@@ -26,7 +26,6 @@ namespace FireflyIII\Http\Middleware;
|
||||
|
||||
use Closure;
|
||||
use FireflyIII\Exceptions\FireflyException;
|
||||
use FireflyIII\Support\FireflyConfig;
|
||||
use FireflyIII\Support\System\IsOldVersion;
|
||||
use FireflyIII\Support\System\OAuthKeys;
|
||||
use Illuminate\Database\QueryException;
|
||||
@@ -40,6 +39,7 @@ use Illuminate\Support\Facades\Log;
|
||||
class Installer
|
||||
{
|
||||
use IsOldVersion;
|
||||
|
||||
/**
|
||||
* Handle an incoming request.
|
||||
*
|
||||
|
@@ -40,6 +40,7 @@ use function Safe\json_decode;
|
||||
class UpdateRequest implements UpdateRequestInterface
|
||||
{
|
||||
use IsOldVersion;
|
||||
|
||||
public function getUpdateInformation(string $channel): array
|
||||
{
|
||||
Log::debug(sprintf('Now in getUpdateInformation(%s)', $channel));
|
||||
@@ -185,7 +186,7 @@ class UpdateRequest implements UpdateRequestInterface
|
||||
private function parseResultDevelop(string $current, string $latest, array $information): array
|
||||
{
|
||||
Log::debug(sprintf('User is running develop version "%s"', $current));
|
||||
$compare = $this->compareDevelopVersions($current, $latest);
|
||||
$compare = $this->compareDevelopVersions($current, $latest);
|
||||
$return = [];
|
||||
|
||||
if (-1 === $compare) {
|
||||
|
@@ -263,13 +263,13 @@ trait PeriodOverview
|
||||
|
||||
$entry
|
||||
= [
|
||||
'title' => $title,
|
||||
'route' => route(sprintf('%s.no-%s', Str::plural($model), $model), [$start->format('Y-m-d'), $end->format('Y-m-d')]),
|
||||
'total_transactions' => 0,
|
||||
'spent' => [],
|
||||
'earned' => [],
|
||||
'transferred' => [],
|
||||
];
|
||||
'title' => $title,
|
||||
'route' => route(sprintf('%s.no-%s', Str::plural($model), $model), [$start->format('Y-m-d'), $end->format('Y-m-d')]),
|
||||
'total_transactions' => 0,
|
||||
'spent' => [],
|
||||
'earned' => [],
|
||||
'transferred' => [],
|
||||
];
|
||||
$grouped = [];
|
||||
|
||||
/** @var PeriodStatistic $statistic */
|
||||
@@ -515,13 +515,13 @@ trait PeriodOverview
|
||||
}
|
||||
$entries[]
|
||||
= [
|
||||
'title' => $title,
|
||||
'route' => route('transactions.index', [$transactionType, $currentDate['start']->format('Y-m-d'), $currentDate['end']->format('Y-m-d')]),
|
||||
'total_transactions' => count($spent) + count($earned) + count($transferred),
|
||||
'spent' => $this->groupByCurrency($spent),
|
||||
'earned' => $this->groupByCurrency($earned),
|
||||
'transferred' => $this->groupByCurrency($transferred),
|
||||
];
|
||||
'title' => $title,
|
||||
'route' => route('transactions.index', [$transactionType, $currentDate['start']->format('Y-m-d'), $currentDate['end']->format('Y-m-d')]),
|
||||
'total_transactions' => count($spent) + count($earned) + count($transferred),
|
||||
'spent' => $this->groupByCurrency($spent),
|
||||
'earned' => $this->groupByCurrency($earned),
|
||||
'transferred' => $this->groupByCurrency($transferred),
|
||||
];
|
||||
++$loops;
|
||||
}
|
||||
|
||||
|
@@ -1,4 +1,6 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/*
|
||||
* IsOldVersion.php
|
||||
* Copyright (c) 2025 james@firefly-iii.org
|
||||
@@ -27,7 +29,6 @@ use Illuminate\Support\Facades\Log;
|
||||
|
||||
trait IsOldVersion
|
||||
{
|
||||
|
||||
/**
|
||||
* By default, version_compare() returns -1 if the first version is lower than the second, 0 if they are equal, and
|
||||
* 1 if the second is lower.
|
||||
@@ -38,18 +39,21 @@ trait IsOldVersion
|
||||
$latestParts = explode('/', $latest);
|
||||
if (2 !== count($currentParts) || 2 !== count($latestParts)) {
|
||||
Log::error(sprintf('Version "%s" or "%s" is not a valid develop-version.', $current, $latest));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
$currentDate = Carbon::createFromFormat('!Y-m-d', $currentParts[1]);
|
||||
$latestDate = Carbon::createFromFormat('!Y-m-d', $latestParts[1]);
|
||||
$currentDate = Carbon::createFromFormat('!Y-m-d', $currentParts[1]);
|
||||
$latestDate = Carbon::createFromFormat('!Y-m-d', $latestParts[1]);
|
||||
|
||||
if ($currentDate->lt($latestDate)) {
|
||||
Log::debug(sprintf('This current version is older, current = %s, latest version %s.', $current, $latest));
|
||||
|
||||
return -1;
|
||||
}
|
||||
if ($currentDate->gt($latestDate)) {
|
||||
Log::debug(sprintf('This current version is newer, current = %s, latest version %s.', $current, $latest));
|
||||
|
||||
return 1;
|
||||
}
|
||||
Log::debug(sprintf('This current version is of the same age, current = %s, latest version %s.', $current, $latest));
|
||||
@@ -89,6 +93,7 @@ trait IsOldVersion
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user