Config
...
reinstall();
die('OK');
}
public function runAction() {
$msgId = V::get('_msgId', 0, $_REQUEST, 'int');
if ($msgId > 0) {
$this->runByMessageId($msgId);
}
$jsonData = new stdClass();
$jsonData->type = 'success';
$jsonData->msg = 'Gotowe';
echo json_encode($jsonData);
exit;
}
public function reinstall() {
$sqlList = array();
//$sqlList['RemoveTable'] = "DROP TABLE IF EXISTS `CRM_CONFIG`";
$sqlList['InstallTable'] = <<has_errors()) {
throw new Exception("DB Errors: " . implode("\n
", $db->get_errors()));
}
foreach ($sqlList as $sqlName => $sql) {
$res = $db->query($sql);
if ($db->has_errors()) {
throw new Exception("DB Errors at sql '{$sqlName}': " . implode("\n
", $db->get_errors()));
}
}
}
}