| 
									
										
										
										
											2016-01-17 07:50:09 +01:00
										 |  |  | <?php | 
					
						
							| 
									
										
										
										
											2016-02-05 12:08:25 +01:00
										 |  |  | declare(strict_types = 1); | 
					
						
							| 
									
										
										
										
											2016-01-17 07:50:09 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | namespace FireflyIII\Console\Commands; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | use Config; | 
					
						
							|  |  |  | use Illuminate\Console\Command; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /** | 
					
						
							|  |  |  |  * Class UpgradeFireflyInstructions | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * @package FireflyIII\Console\Commands | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | class UpgradeFireflyInstructions extends Command | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     /** | 
					
						
							| 
									
										
										
										
											2016-01-19 13:59:54 +01:00
										 |  |  |      * The console command description. | 
					
						
							| 
									
										
										
										
											2016-01-17 07:50:09 +01:00
										 |  |  |      * | 
					
						
							|  |  |  |      * @var string | 
					
						
							|  |  |  |      */ | 
					
						
							| 
									
										
										
										
											2016-01-19 13:59:54 +01:00
										 |  |  |     protected $description = 'Command description'; | 
					
						
							| 
									
										
										
										
											2016-01-17 07:50:09 +01:00
										 |  |  |     /** | 
					
						
							| 
									
										
										
										
											2016-01-19 13:59:54 +01:00
										 |  |  |      * The name and signature of the console command. | 
					
						
							| 
									
										
										
										
											2016-01-17 07:50:09 +01:00
										 |  |  |      * | 
					
						
							|  |  |  |      * @var string | 
					
						
							|  |  |  |      */ | 
					
						
							| 
									
										
										
										
											2016-01-19 13:59:54 +01:00
										 |  |  |     protected $signature = 'firefly:upgrade-instructions'; | 
					
						
							| 
									
										
										
										
											2016-01-17 07:50:09 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |     /** | 
					
						
							|  |  |  |      * Create a new command instance. | 
					
						
							|  |  |  |      * | 
					
						
							|  |  |  |      */ | 
					
						
							|  |  |  |     public function __construct() | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         parent::__construct(); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     /** | 
					
						
							|  |  |  |      * Execute the console command. | 
					
						
							|  |  |  |      * | 
					
						
							|  |  |  |      * @return mixed | 
					
						
							|  |  |  |      */ | 
					
						
							|  |  |  |     public function handle() | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         //
 | 
					
						
							|  |  |  |         $version = Config::get('firefly.version'); | 
					
						
							|  |  |  |         $config  = Config::get('upgrade.text'); | 
					
						
							| 
									
										
										
										
											2016-02-05 08:03:26 +01:00
										 |  |  |         $text    = $config[$version] ?? null; | 
					
						
							| 
									
										
										
										
											2016-01-17 07:50:09 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |         $this->line('+------------------------------------------------------------------------------+'); | 
					
						
							|  |  |  |         $this->line(''); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         if (is_null($text)) { | 
					
						
							|  |  |  |             $this->line('Thank you for installing Firefly III, v' . $version); | 
					
						
							| 
									
										
										
										
											2016-01-17 07:55:23 +01:00
										 |  |  |             $this->line('If you are upgrading from a previous version,'); | 
					
						
							|  |  |  |             $this->info('there are no extra upgrade instructions.'); | 
					
						
							| 
									
										
										
										
											2016-01-17 07:50:09 +01:00
										 |  |  |             $this->line('Firefly III should be ready for use.'); | 
					
						
							|  |  |  |         } else { | 
					
						
							|  |  |  |             $this->line('Thank you for installing Firefly III, v' . $version); | 
					
						
							| 
									
										
										
										
											2016-01-17 07:55:23 +01:00
										 |  |  |             $this->line('If you are upgrading from a previous version,'); | 
					
						
							|  |  |  |             $this->line('please follow these upgrade instructions carefully:'); | 
					
						
							| 
									
										
										
										
											2016-01-17 07:50:09 +01:00
										 |  |  |             $this->info(wordwrap($text)); | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         $this->line(''); | 
					
						
							|  |  |  |         $this->line('+------------------------------------------------------------------------------+'); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | } |