mirror of
https://github.com/flarum/framework.git
synced 2025-05-03 18:14:03 +08:00
Delete config.php if installation fails
This commit is contained in:
parent
f331f1d07d
commit
f3d45902fc
@ -1,4 +1,4 @@
|
|||||||
<?php
|
<?php
|
||||||
/*
|
/*
|
||||||
* This file is part of Flarum.
|
* This file is part of Flarum.
|
||||||
*
|
*
|
||||||
@ -20,6 +20,7 @@ use Symfony\Component\Console\Input\InputInterface;
|
|||||||
use Symfony\Component\Console\Input\InputOption;
|
use Symfony\Component\Console\Input\InputOption;
|
||||||
use Symfony\Component\Console\Input\InputArgument;
|
use Symfony\Component\Console\Input\InputArgument;
|
||||||
use Symfony\Component\Console\Output\OutputInterface;
|
use Symfony\Component\Console\Output\OutputInterface;
|
||||||
|
use Exception;
|
||||||
|
|
||||||
class InstallCommand extends Command
|
class InstallCommand extends Command
|
||||||
{
|
{
|
||||||
@ -85,24 +86,30 @@ class InstallCommand extends Command
|
|||||||
|
|
||||||
protected function install()
|
protected function install()
|
||||||
{
|
{
|
||||||
$this->storeConfiguration();
|
try {
|
||||||
|
$this->storeConfiguration();
|
||||||
|
|
||||||
$this->runMigrations();
|
$this->runMigrations();
|
||||||
|
|
||||||
$this->writeSettings();
|
$this->writeSettings();
|
||||||
|
|
||||||
$this->container->register('Flarum\Core\CoreServiceProvider');
|
$this->container->register('Flarum\Core\CoreServiceProvider');
|
||||||
|
|
||||||
$resolver = $this->container->make('Illuminate\Database\ConnectionResolverInterface');
|
$resolver = $this->container->make('Illuminate\Database\ConnectionResolverInterface');
|
||||||
Model::setConnectionResolver($resolver);
|
Model::setConnectionResolver($resolver);
|
||||||
Model::setEventDispatcher($this->container->make('events'));
|
Model::setEventDispatcher($this->container->make('events'));
|
||||||
|
|
||||||
$this->seedGroups();
|
$this->seedGroups();
|
||||||
$this->seedPermissions();
|
$this->seedPermissions();
|
||||||
|
|
||||||
$this->createAdminUser();
|
$this->createAdminUser();
|
||||||
|
|
||||||
$this->enableBundledExtensions();
|
$this->enableBundledExtensions();
|
||||||
|
} catch (Exception $e) {
|
||||||
|
@unlink(base_path('../config.php'));
|
||||||
|
|
||||||
|
throw $e;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function storeConfiguration()
|
protected function storeConfiguration()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user