From f3d45902fc0366dbcd560ac921d4ef3425be8535 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Wed, 26 Aug 2015 17:46:49 +0930 Subject: [PATCH] Delete config.php if installation fails --- .../src/Install/Console/InstallCommand.php | 31 ++++++++++++------- 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/framework/core/src/Install/Console/InstallCommand.php b/framework/core/src/Install/Console/InstallCommand.php index c609754db..e88025497 100644 --- a/framework/core/src/Install/Console/InstallCommand.php +++ b/framework/core/src/Install/Console/InstallCommand.php @@ -1,4 +1,4 @@ -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'); - Model::setConnectionResolver($resolver); - Model::setEventDispatcher($this->container->make('events')); + $resolver = $this->container->make('Illuminate\Database\ConnectionResolverInterface'); + Model::setConnectionResolver($resolver); + Model::setEventDispatcher($this->container->make('events')); - $this->seedGroups(); - $this->seedPermissions(); + $this->seedGroups(); + $this->seedPermissions(); - $this->createAdminUser(); + $this->createAdminUser(); - $this->enableBundledExtensions(); + $this->enableBundledExtensions(); + } catch (Exception $e) { + @unlink(base_path('../config.php')); + + throw $e; + } } protected function storeConfiguration()