. * */ namespace Vvveb\Controller; use function Vvveb\__; use Vvveb\System\Import\Sql; #[\AllowDynamicProperties] class Index extends Base { function __construct() { } function import() { try { $engine = DB_ENGINE; $import = new Sql(); $import->setPath(__DIR__ . "../install/sql/$engine/schema/"); $import->createTables(); $import->setPath(__DIR__ . '../install/sql/insert/'); $import->insertData(); } catch (\Exception $e) { $this->view->errors[] = sprintf(__('Db error: "%s" Error code: "%s"'), $e->getMessage(), $e->getCode()); } } function index() { $this->import(); } }