This commit is contained in:
Yuri Kuznetsov
2023-02-27 16:20:57 +02:00
parent 5ecce30720
commit aeecd1f3a6
3 changed files with 8 additions and 11 deletions
+4 -7
View File
@@ -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)
+3 -3
View File
@@ -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);
echo json_encode($result);
+1 -1
View File
@@ -330,7 +330,7 @@ class Tester
$this->dropTables();
$installer = new \Installer(); //reload installer to get all config data
$installer->buildDatabase();
$installer->rebuild();
$installer->setSuccess();
}