Updated the engine.

This commit is contained in:
Relintai 2022-02-05 23:18:25 +01:00
parent c5654aad58
commit 27542ab3fd
12 changed files with 79 additions and 121 deletions

2
HEADS
View File

@ -1 +1 @@
{"engine": {"master": "33be242319960d48b972599af652d2703d259956"}}
{"engine": {"master": "f711d413d63b9a8145c854032252c7805aa083a0"}}

View File

@ -1,24 +1,24 @@
#include "ccms_root.h"
#include "core/http/request.h"
#include "web/http/request.h"
#include <iostream>
#include "core/file_cache.h"
#include "web/file_cache.h"
#include "core/database/database_manager.h"
#include "database/database_manager.h"
#include "core/html/html_builder.h"
#include "core/http/csrf_token.h"
#include "core/http/http_session.h"
#include "core/http/session_manager.h"
#include "web/html/html_builder.h"
#include "web/http/csrf_token.h"
#include "web/http/http_session.h"
#include "web/http/session_manager.h"
#include "modules/users/user.h"
//#include "modules/users/user_controller.h"
#include "modules/rbac_users/rbac_user_controller.h"
#include "web_modules/users/user.h"
//#include "web_modules/users/user_controller.h"
#include "web_modules/rbac_users/rbac_user_controller.h"
#include "modules/admin_panel/admin_panel.h"
#include "modules/rbac/rbac_controller.h"
#include "web_modules/admin_panel/admin_panel.h"
#include "web_modules/rbac/rbac_controller.h"
#include "ccms_user_controller.h"

View File

@ -1,17 +1,13 @@
#ifndef CCMS_ROOT_H
#define CCMS_ROOT_H
//#include "core/http/web_application.h"
//#include "web/http/web_application.h"
#include "core/object.h"
#include "core/http/web_root.h"
#include "web/http/web_root.h"
#undef LOG_TRACE
#undef LOG_WARN
#include "modules/list_page/list_page.h"
#include "modules/message_page/message_page.h"
#include "modules/paged_article/paged_article.h"
#include "modules/paged_list/paged_list.h"
#include "page_manager/page_manager.h"
class AdminPanel;

View File

@ -1,11 +1,11 @@
#include "ccms_user_controller.h"
#include "core/html/form_validator.h"
#include "core/html/html_builder.h"
#include "core/http/cookie.h"
#include "core/http/http_session.h"
#include "core/http/request.h"
#include "core/http/session_manager.h"
#include "web/html/form_validator.h"
#include "web/html/html_builder.h"
#include "web/http/cookie.h"
#include "web/http/http_session.h"
#include "web/http/request.h"
#include "web/http/session_manager.h"
void CCMSUserController::render_login_request_default(Request *request, LoginRequestData *data) {
HTMLBuilder b;

View File

@ -1,10 +1,10 @@
#ifndef CCMS_USER_CONTROLLER_H
#define CCMS_USER_CONTROLLER_H
#include "modules/rbac_users/rbac_user_controller.h"
#include "web_modules/rbac_users/rbac_user_controller.h"
#include <string>
#include "modules/users/user.h"
#include "web_modules/users/user.h"
class Request;
class FormValidator;

View File

@ -2,18 +2,18 @@
#include "core/error_macros.h"
#include "core/html/form_validator.h"
#include "core/html/html_builder.h"
#include "core/http/cookie.h"
#include "core/http/http_session.h"
#include "core/http/request.h"
#include "core/http/session_manager.h"
#include "web/html/form_validator.h"
#include "web/html/html_builder.h"
#include "web/http/cookie.h"
#include "web/http/http_session.h"
#include "web/http/request.h"
#include "web/http/session_manager.h"
#include "core/database/database.h"
#include "core/database/database_manager.h"
#include "core/database/query_builder.h"
#include "core/database/query_result.h"
#include "core/database/table_builder.h"
#include "database/database.h"
#include "database/database_manager.h"
#include "database/query_builder.h"
#include "database/query_result.h"
#include "database/table_builder.h"
void MenuNode::render(Request *request) {
HTMLBuilder b;

View File

@ -1,7 +1,7 @@
#ifndef MENU_NODE_H
#define MENU_NODE_H
#include "modules/admin_panel/admin_node.h"
#include "web_modules/admin_panel/admin_node.h"
#include "core/containers/vector.h"
#include "core/string.h"

View File

@ -1,11 +1,11 @@
#include "text_content.h"
#include "core/html/form_validator.h"
#include "core/html/html_builder.h"
#include "core/http/cookie.h"
#include "core/http/http_session.h"
#include "core/http/request.h"
#include "core/http/session_manager.h"
#include "web/html/form_validator.h"
#include "web/html/html_builder.h"
#include "web/http/cookie.h"
#include "web/http/http_session.h"
#include "web/http/request.h"
#include "web/http/session_manager.h"
TextContent::TextContent() :

View File

@ -1,11 +1,11 @@
#include "page_content.h"
#include "core/html/form_validator.h"
#include "core/html/html_builder.h"
#include "core/http/cookie.h"
#include "core/http/http_session.h"
#include "core/http/request.h"
#include "core/http/session_manager.h"
#include "web/html/form_validator.h"
#include "web/html/html_builder.h"
#include "web/http/cookie.h"
#include "web/http/http_session.h"
#include "web/http/request.h"
#include "web/http/session_manager.h"
PageContent::PageContent() :
Reference() {

View File

@ -3,18 +3,18 @@
#include "core/error_macros.h"
#include "core/nodes/node_tree.h"
#include "core/html/form_validator.h"
#include "core/html/html_builder.h"
#include "core/http/cookie.h"
#include "core/http/http_session.h"
#include "core/http/request.h"
#include "core/http/session_manager.h"
#include "web/html/form_validator.h"
#include "web/html/html_builder.h"
#include "web/http/cookie.h"
#include "web/http/http_session.h"
#include "web/http/request.h"
#include "web/http/session_manager.h"
#include "core/database/database.h"
#include "core/database/database_manager.h"
#include "core/database/query_builder.h"
#include "core/database/query_result.h"
#include "core/database/table_builder.h"
#include "database/database.h"
#include "database/database_manager.h"
#include "database/query_builder.h"
#include "database/query_result.h"
#include "database/table_builder.h"
#include "page_content.h"
#include "page.h"

View File

@ -1,7 +1,7 @@
#ifndef PAGE_MANAGER_H
#define PAGE_MANAGER_H
#include "modules/admin_panel/admin_node.h"
#include "web_modules/admin_panel/admin_node.h"
#include "core/containers/vector.h"
#include "core/string.h"

View File

@ -1,33 +1,14 @@
#include <string.h>
#include <iostream>
#include <string>
#include "core/file_cache.h"
#include "core/http/web_root.h"
#include "app/ccms_root.h"
#include "database/db_init.h"
#include "core/settings/db_settings.h"
#include "core/settings/settings.h"
#include "core/http/session_manager.h"
#include "backends/drogon/drogon_web_server.h"
// Backends
#include "backends/hash_hashlib/setup.h"
#include "core/database/database_manager.h"
#include "platform/platform_initializer.h"
#include "core/os/platform.h"
#include "core/settings/settings.h"
#include "database/database_manager.h"
#include "database_modules/db_settings/db_settings.h"
#include "web/file_cache.h"
#include "web/http/session_manager.h"
#include "web_backends/drogon/drogon_web_server.h"
void initialize_backends() {
initialize_database_backends();
backend_hash_hashlib_install_providers();
}
#include "rcpp_framework.h"
void create_databases() {
DatabaseManager *dbm = DatabaseManager::get_singleton();
@ -38,63 +19,44 @@ void create_databases() {
}
int main(int argc, char **argv, char **envp) {
PlatformInitializer::allocate_all();
PlatformInitializer::arg_setup(argc, argv, envp);
initialize_backends();
::SessionManager *session_manager = new ::SessionManager();
DBSettings *settings = new DBSettings(true);
// settings->parse_file("settings.json");
FileCache *file_cache = new FileCache(true);
file_cache->wwwroot = "./www";
file_cache->wwwroot_refresh_cache();
DatabaseManager *dbm = new DatabaseManager();
RCPPFramework::create_and_init(argc, argv, envp);
RCPPFramework::get_singleton()->www_root = "./www";
create_databases();
DrogonWebServer *app = new DrogonWebServer();
RCPPFramework::get_singleton()->manage_object(app);
CCMSRoot *app_root = new CCMSRoot();
app_root->setup();
app->set_root(app_root);
app->add_listener("127.0.0.1", 8080);
LOG_INFO << "Server running on 127.0.0.1:8080";
bool migrate = Platform::get_singleton()->arg_parser.has_arg("-m");
if (!migrate) {
settings->load();
session_manager->load_sessions();
printf("Initialized!\n");
RCPPFramework::get_singleton()->load();
RLOG_MSG("Initialized!\n");
app->add_listener("127.0.0.1", 8080);
RLOG_MSG("Server running on 127.0.0.1:8080");
app->run();
} else {
printf("Running migrations.\n");
RLOG_MSG("Running migrations.\n");
settings->migrate();
session_manager->migrate();
RCPPFramework::get_singleton()->migrate();
bool seed_db = Platform::get_singleton()->arg_parser.has_arg("-s");
if (seed_db) {
printf("Seeding database.\n");
RLOG_MSG("Seeding database.\n");
}
app_root->migrate(true, seed_db);
}
delete app;
delete dbm;
delete file_cache;
delete settings;
delete session_manager;
PlatformInitializer::free_all();
RCPPFramework::destroy();
return 0;
}