ORIENT/modules/system/console/OctoberDown.php

72 lines
1.5 KiB
PHP
Raw Normal View History

2014-05-14 13:24:20 +00:00
<?php namespace System\Console;
use Illuminate\Console\Command;
use System\Classes\UpdateManager;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputArgument;
class OctoberDown extends Command
{
use \Illuminate\Console\ConfirmableTrait;
2014-05-14 13:24:20 +00:00
/**
* The console command name.
*/
protected $name = 'october:down';
/**
* The console command description.
*/
protected $description = 'Destroys all database tables for October and all plugins.';
/**
* Create a new command instance.
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*/
public function fire()
{
if (!$this->confirmToProceed('This will DESTROY all database tables.'))
return;
2014-05-14 13:24:20 +00:00
$manager = UpdateManager::instance()->resetNotes()->uninstall();
2014-05-14 13:24:20 +00:00
foreach ($manager->getNotes() as $note)
$this->output->writeln($note);
2014-05-14 13:24:20 +00:00
}
/**
* Get the console command arguments.
*/
protected function getArguments()
{
return [];
}
/**
* Get the console command options.
*/
protected function getOptions()
{
return [
['force', null, InputOption::VALUE_NONE, 'Force the operation to run.'],
];
}
/**
* Get the default confirmation callback.
* @return \Closure
*/
protected function getDefaultConfirmCallback()
{
return function() { return true; };
2014-05-14 13:24:20 +00:00
}
}