Cleanup of some console commands

This commit is contained in:
Nabeel Shahzad
2017-12-29 10:23:42 -06:00
parent a5c5518a12
commit 5ec99167e8
7 changed files with 131 additions and 52 deletions

View File

@@ -2,13 +2,9 @@
namespace App\Console\Commands;
use Illuminate\Console\Command;
use App\Console\BaseCommand;
use Symfony\Component\Process\Process;
use Symfony\Component\Process\Exception\ProcessFailedException;
class CreateDatabase extends Command
class CreateDatabase extends BaseCommand
{
protected $signature = 'database:create {--reset} {--conn=?}';
protected $description = 'Create a database';
@@ -20,21 +16,6 @@ class CreateDatabase extends Command
$this->os = new \Tivie\OS\Detector();
}
protected function runCommand($cmd)
{
$cmd = join(' ', $cmd);
$this->info('Running "' . $cmd . '"');
$proc = new Process($cmd);
$proc->run();
if (!$proc->isSuccessful()) {
throw new ProcessFailedException($proc);
}
echo $proc->getOutput();
}
/**
* create the mysql database
* @param $dbkey