From aeecd1f3a68daa6b77a852ccab30677cc45f7eb6 Mon Sep 17 00:00:00 2001 From: Yuri Kuznetsov Date: Mon, 27 Feb 2023 16:20:57 +0200 Subject: [PATCH] ref --- install/core/Installer.php | 11 ++++------- install/core/actions/buildDatabase.php | 6 +++--- tests/integration/Core/Tester.php | 2 +- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/install/core/Installer.php b/install/core/Installer.php index 5e21956c38..578eb716b8 100644 --- a/install/core/Installer.php +++ b/install/core/Installer.php @@ -29,6 +29,7 @@ use Espo\Core\Application; use Espo\Core\Container; +use Espo\Core\DataManager; use Espo\Core\InjectableFactory; use Espo\Core\ORM\DatabaseParamsFactory; use Espo\Core\Utils\Id\RecordIdGenerator; @@ -408,20 +409,16 @@ class Installer return true; } - public function buildDatabase() + public function rebuild(): void { try { - $this->app->getContainer()->get('dataManager')->rebuild(); - - return true; + $this->app->getContainer()->getByClass(DataManager::class)->rebuild(); } catch (Exception) { $this->auth(); - $this->app->getContainer()->get('dataManager')->rebuild(); + $this->app->getContainer()->getByClass(DataManager::class)->rebuild(); } - - return true; } public function savePreferences(array $rawPreferences) diff --git a/install/core/actions/buildDatabase.php b/install/core/actions/buildDatabase.php index 713aa4fb67..f1d245c1a1 100644 --- a/install/core/actions/buildDatabase.php +++ b/install/core/actions/buildDatabase.php @@ -25,12 +25,12 @@ * * In accordance with Section 7(b) of the GNU General Public License version 3, * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. - ************************************************************************/ + ************************************************************************/ ob_start(); $result = array('success' => true, 'errorMsg' => ''); -$installer->buildDatabase(); +$installer->rebuild(); ob_clean(); -echo json_encode($result); \ No newline at end of file +echo json_encode($result); diff --git a/tests/integration/Core/Tester.php b/tests/integration/Core/Tester.php index acc6ecfbc1..693fac6649 100644 --- a/tests/integration/Core/Tester.php +++ b/tests/integration/Core/Tester.php @@ -330,7 +330,7 @@ class Tester $this->dropTables(); $installer = new \Installer(); //reload installer to get all config data - $installer->buildDatabase(); + $installer->rebuild(); $installer->setSuccess(); }