2016-01-17 00:50:09 -06:00
|
|
|
<?php
|
2016-05-20 04:59:54 -05:00
|
|
|
/**
|
|
|
|
* UpgradeFireflyInstructions.php
|
|
|
|
* Copyright (C) 2016 thegrumpydictator@gmail.com
|
|
|
|
*
|
|
|
|
* This software may be modified and distributed under the terms
|
|
|
|
* of the MIT license. See the LICENSE file for details.
|
|
|
|
*/
|
|
|
|
|
2016-02-05 05:08:25 -06:00
|
|
|
declare(strict_types = 1);
|
2016-01-17 00:50:09 -06:00
|
|
|
|
|
|
|
namespace FireflyIII\Console\Commands;
|
|
|
|
|
|
|
|
use Illuminate\Console\Command;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Class UpgradeFireflyInstructions
|
|
|
|
*
|
|
|
|
* @package FireflyIII\Console\Commands
|
|
|
|
*/
|
|
|
|
class UpgradeFireflyInstructions extends Command
|
|
|
|
{
|
|
|
|
/**
|
2016-01-19 06:59:54 -06:00
|
|
|
* The console command description.
|
2016-01-17 00:50:09 -06:00
|
|
|
*
|
|
|
|
* @var string
|
|
|
|
*/
|
2016-07-15 15:26:08 -05:00
|
|
|
protected $description = 'Instructions in case of upgrade trouble.';
|
2016-01-17 00:50:09 -06:00
|
|
|
/**
|
2016-01-19 06:59:54 -06:00
|
|
|
* The name and signature of the console command.
|
2016-01-17 00:50:09 -06:00
|
|
|
*
|
|
|
|
* @var string
|
|
|
|
*/
|
2016-01-19 06:59:54 -06:00
|
|
|
protected $signature = 'firefly:upgrade-instructions';
|
2016-01-17 00:50:09 -06:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Create a new command instance.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
public function __construct()
|
|
|
|
{
|
|
|
|
parent::__construct();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Execute the console command.
|
|
|
|
*/
|
|
|
|
public function handle()
|
|
|
|
{
|
|
|
|
//
|
2016-04-26 14:40:15 -05:00
|
|
|
/** @var string $version */
|
|
|
|
$version = config('firefly.version');
|
|
|
|
$config = config('upgrade.text');
|
2016-09-16 05:07:45 -05:00
|
|
|
$text = null;
|
2016-09-14 13:35:45 -05:00
|
|
|
foreach (array_keys($config) as $compare) {
|
|
|
|
// if string starts with:
|
|
|
|
$len = strlen($compare);
|
|
|
|
if (substr($version, 0, $len) === $compare) {
|
|
|
|
$text = $config[$compare];
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
2016-01-17 00:50:09 -06:00
|
|
|
|
|
|
|
$this->line('+------------------------------------------------------------------------------+');
|
|
|
|
$this->line('');
|
|
|
|
|
|
|
|
if (is_null($text)) {
|
|
|
|
$this->line('Thank you for installing Firefly III, v' . $version);
|
2016-09-14 13:35:45 -05:00
|
|
|
$this->info('There are no extra upgrade instructions.');
|
2016-01-17 00:50:09 -06:00
|
|
|
$this->line('Firefly III should be ready for use.');
|
|
|
|
} else {
|
|
|
|
$this->line('Thank you for installing Firefly III, v' . $version);
|
2016-01-17 00:55:23 -06:00
|
|
|
$this->line('If you are upgrading from a previous version,');
|
|
|
|
$this->line('please follow these upgrade instructions carefully:');
|
2016-01-17 00:50:09 -06:00
|
|
|
$this->info(wordwrap($text));
|
|
|
|
}
|
|
|
|
|
|
|
|
$this->line('');
|
|
|
|
$this->line('+------------------------------------------------------------------------------+');
|
|
|
|
}
|
|
|
|
}
|