New: upgrade instructions when installing or upgrading composer packages.

This commit is contained in:
James Cole 2016-01-17 07:50:09 +01:00
parent 173d0290ea
commit 1b3198c143
4 changed files with 85 additions and 1 deletions

View File

@ -0,0 +1,67 @@
<?php
namespace FireflyIII\Console\Commands;
use Config;
use Illuminate\Console\Command;
/**
* Class UpgradeFireflyInstructions
*
* @package FireflyIII\Console\Commands
*/
class UpgradeFireflyInstructions extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'firefly:upgrade-instructions';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Command description';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
//
$version = Config::get('firefly.version');
$config = Config::get('upgrade.text');
$text = isset($config[$version]) ? $config[$version] : null;
$this->line('+------------------------------------------------------------------------------+');
$this->line('');
if (is_null($text)) {
$this->line('Thank you for installing Firefly III, v' . $version);
$this->info('There are no extra upgrade instructions.');
$this->line('Firefly III should be ready for use.');
} else {
$this->line('Thank you for installing Firefly III, v' . $version);
$this->line('Please follow these upgrade instructions carefully.');
$this->info(wordwrap($text));
}
$this->line('');
$this->line('+------------------------------------------------------------------------------+');
}
}

View File

@ -9,6 +9,7 @@
namespace FireflyIII\Console;
use FireflyIII\Console\Commands\UpgradeFireflyInstructions;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
@ -26,6 +27,7 @@ class Kernel extends ConsoleKernel
*/
protected $commands
= [
UpgradeFireflyInstructions::class
];
/**

View File

@ -2,7 +2,7 @@
return [
'chart' => 'chartjs',
'version' => '3.6.1',
'version' => '3.7.0',
'index_periods' => ['1D', '1W', '1M', '3M', '6M', '1Y', 'custom'],
'budget_periods' => ['daily', 'weekly', 'monthly', 'quarterly', 'half-year', 'yearly'],
'csv_import_enabled' => true,

15
config/upgrade.php Normal file
View File

@ -0,0 +1,15 @@
<?php
/**
* upgrade.php
* Copyright (C) 2016 Sander Dorigo
*
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
*/
return [
'text' => [
'3.7.0' => 'Because of the upgrade to Laravel 5.2, several manual changes must be made to your Firefly III installation. ' .
'Please follow the instructions on the following page: https://github.com/JC5/firefly-iii/wiki/Upgrade-to-3.7.0'],
];