mirror of
https://github.com/Relintai/rcpp_framework.git
synced 2024-11-14 04:57:21 +01:00
Moved core/databases to just datatbases. Also fox database module detection login.
This commit is contained in:
parent
309208d359
commit
81780683a4
@ -207,7 +207,7 @@ database_list = []
|
|||||||
if env_base["databases"]:
|
if env_base["databases"]:
|
||||||
env_base.Append(CPPDEFINES=["DATABASES_ENABLED"])
|
env_base.Append(CPPDEFINES=["DATABASES_ENABLED"])
|
||||||
|
|
||||||
for x in sorted(glob.glob("database/*")):
|
for x in sorted(glob.glob("database_modules/*")):
|
||||||
if not os.path.isdir(x) or not os.path.exists(x + "/detect.py"):
|
if not os.path.isdir(x) or not os.path.exists(x + "/detect.py"):
|
||||||
continue
|
continue
|
||||||
tmppath = "./" + x
|
tmppath = "./" + x
|
||||||
@ -216,8 +216,8 @@ if env_base["databases"]:
|
|||||||
import detect
|
import detect
|
||||||
|
|
||||||
if detect.is_active() and detect.can_build():
|
if detect.is_active() and detect.can_build():
|
||||||
x = x.replace("database/", "") # rest of world
|
x = x.replace("database_modules/", "") # rest of world
|
||||||
x = x.replace("database\\", "") # win32
|
x = x.replace("database_modules\\", "") # win32
|
||||||
database_list += [x]
|
database_list += [x]
|
||||||
|
|
||||||
sys.path.remove(tmppath)
|
sys.path.remove(tmppath)
|
||||||
@ -278,7 +278,7 @@ SConscript("web/SCsub")
|
|||||||
SConscript("platform/SCsub")
|
SConscript("platform/SCsub")
|
||||||
|
|
||||||
if env_base["databases"]:
|
if env_base["databases"]:
|
||||||
#add db folder
|
SConscript("database/SCsub")
|
||||||
|
|
||||||
for d in database_list:
|
for d in database_list:
|
||||||
tmppath = "./database_modules/" + d
|
tmppath = "./database_modules/" + d
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#include "object.h"
|
#include "object.h"
|
||||||
|
|
||||||
#include "core/database/database.h"
|
#include "database/database.h"
|
||||||
|
|
||||||
Object::Object() {
|
Object::Object() {
|
||||||
db = nullptr;
|
db = nullptr;
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
#include "db_settings.h"
|
#include "db_settings.h"
|
||||||
|
|
||||||
#include "core/database/database.h"
|
#include "database/database.h"
|
||||||
#include "core/database/database_manager.h"
|
#include "database/database_manager.h"
|
||||||
#include "core/database/query_builder.h"
|
#include "database/query_builder.h"
|
||||||
#include "core/database/query_result.h"
|
#include "database/query_result.h"
|
||||||
#include "core/database/table_builder.h"
|
#include "database/table_builder.h"
|
||||||
|
|
||||||
void DBSettings::set_value(const String &key, const Variant &value) {
|
void DBSettings::set_value(const String &key, const Variant &value) {
|
||||||
const Variant &v = _data[key];
|
const Variant &v = _data[key];
|
||||||
|
11
database/SCsub
Normal file
11
database/SCsub
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
|
||||||
|
Import("env")
|
||||||
|
|
||||||
|
env.core_sources = []
|
||||||
|
|
||||||
|
env.add_source_files(env.core_sources, "*.cpp")
|
||||||
|
|
||||||
|
# Build it all as a library
|
||||||
|
lib = env.add_library("database", env.core_sources)
|
||||||
|
env.Prepend(LIBS=[lib])
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
|
|
||||||
#include "core/database/database_manager.h"
|
#include "database/database_manager.h"
|
||||||
|
|
||||||
#include "mysql_query_builder.h"
|
#include "mysql_query_builder.h"
|
||||||
#include "mysql_query_result.h"
|
#include "mysql_query_result.h"
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
#include "core/string.h"
|
#include "core/string.h"
|
||||||
|
|
||||||
#include "core/database/database.h"
|
#include "database/database.h"
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
#include <memory>
|
#include <memory>
|
||||||
#include "core/string.h"
|
#include "core/string.h"
|
||||||
|
|
||||||
#include "core/database/query_builder.h"
|
#include "database/query_builder.h"
|
||||||
|
|
||||||
class MysqlDatabase;
|
class MysqlDatabase;
|
||||||
class MysqlQueryResult;
|
class MysqlQueryResult;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#ifndef MYSQL_QUERY_RESULT_H
|
#ifndef MYSQL_QUERY_RESULT_H
|
||||||
#define MYSQL_QUERY_RESULT_H
|
#define MYSQL_QUERY_RESULT_H
|
||||||
|
|
||||||
#include "core/database/query_result.h"
|
#include "database/query_result.h"
|
||||||
|
|
||||||
#include <mysql.h>
|
#include <mysql.h>
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
#include "core/string.h"
|
#include "core/string.h"
|
||||||
|
|
||||||
#include "core/database/table_builder.h"
|
#include "database/table_builder.h"
|
||||||
|
|
||||||
class MysqlTableBuilder : public TableBuilder {
|
class MysqlTableBuilder : public TableBuilder {
|
||||||
RCPP_OBJECT(MysqlTableBuilder, TableBuilder);
|
RCPP_OBJECT(MysqlTableBuilder, TableBuilder);
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#include "pgsql_database.h"
|
#include "pgsql_database.h"
|
||||||
|
|
||||||
#include "core/database/database_manager.h"
|
#include "database/database_manager.h"
|
||||||
|
|
||||||
Database *PGSQLDatabase::_creation_func() {
|
Database *PGSQLDatabase::_creation_func() {
|
||||||
return new PGSQLDatabase();
|
return new PGSQLDatabase();
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#ifndef PGSQL_CONNECTION
|
#ifndef PGSQL_CONNECTION
|
||||||
#define PGSQL_CONNECTION
|
#define PGSQL_CONNECTION
|
||||||
|
|
||||||
#include "core/database/database.h"
|
#include "database/database.h"
|
||||||
|
|
||||||
//Brynet has it aswell, and because of using namespace it is defined here aswell
|
//Brynet has it aswell, and because of using namespace it is defined here aswell
|
||||||
//later this will be fixed better
|
//later this will be fixed better
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#include "sqlite3_database.h"
|
#include "sqlite3_database.h"
|
||||||
|
|
||||||
#include "core/database/database_manager.h"
|
#include "database/database_manager.h"
|
||||||
|
|
||||||
#include "sqlite3_query_builder.h"
|
#include "sqlite3_query_builder.h"
|
||||||
#include "sqlite3_query_result.h"
|
#include "sqlite3_query_result.h"
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#ifndef SQLITE3_CONNECTION
|
#ifndef SQLITE3_CONNECTION
|
||||||
#define SQLITE3_CONNECTION
|
#define SQLITE3_CONNECTION
|
||||||
|
|
||||||
#include "core/database/database.h"
|
#include "database/database.h"
|
||||||
|
|
||||||
//Brynet has it aswell, and because of using namespace it is defined here aswell
|
//Brynet has it aswell, and because of using namespace it is defined here aswell
|
||||||
//later this will be fixed better
|
//later this will be fixed better
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
#include <memory>
|
#include <memory>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "core/database/query_builder.h"
|
#include "database/query_builder.h"
|
||||||
|
|
||||||
class SQLite3Database;
|
class SQLite3Database;
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
#include "core/string.h"
|
#include "core/string.h"
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "core/database/query_result.h"
|
#include "database/query_result.h"
|
||||||
|
|
||||||
#include "./sqlite/sqlite3.h"
|
#include "./sqlite/sqlite3.h"
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#include "sqlite3_table_builder.h"
|
#include "sqlite3_table_builder.h"
|
||||||
|
|
||||||
#include "core/database/query_result.h"
|
#include "database/query_result.h"
|
||||||
|
|
||||||
#include "sqlite3_database.h"
|
#include "sqlite3_database.h"
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
#include "core/string.h"
|
#include "core/string.h"
|
||||||
|
|
||||||
#include "core/database/table_builder.h"
|
#include "database/table_builder.h"
|
||||||
|
|
||||||
class SQLite3Database;
|
class SQLite3Database;
|
||||||
|
|
||||||
|
@ -4,10 +4,10 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
||||||
#include "core/database/database_manager.h"
|
#include "database/database_manager.h"
|
||||||
#include "core/database/query_builder.h"
|
#include "database/query_builder.h"
|
||||||
#include "core/database/query_result.h"
|
#include "database/query_result.h"
|
||||||
#include "core/database/table_builder.h"
|
#include "database/table_builder.h"
|
||||||
|
|
||||||
#include "core/hash/sha256.h"
|
#include "core/hash/sha256.h"
|
||||||
|
|
||||||
|
@ -8,11 +8,11 @@
|
|||||||
#include "core/settings/settings.h"
|
#include "core/settings/settings.h"
|
||||||
|
|
||||||
#ifdef DATABASES_ENABLED
|
#ifdef DATABASES_ENABLED
|
||||||
#include "core/database/database.h"
|
#include "database/database.h"
|
||||||
#include "core/database/database_manager.h"
|
#include "database/database_manager.h"
|
||||||
#include "core/database/query_builder.h"
|
#include "database/query_builder.h"
|
||||||
#include "core/database/query_result.h"
|
#include "database/query_result.h"
|
||||||
#include "core/database/table_builder.h"
|
#include "database/table_builder.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
String WebNode::get_uri_segment() {
|
String WebNode::get_uri_segment() {
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include "core/file_cache.h"
|
#include "core/file_cache.h"
|
||||||
#include "core/database/database_manager.h"
|
#include "database/database_manager.h"
|
||||||
#include "web/html/html_builder.h"
|
#include "web/html/html_builder.h"
|
||||||
|
|
||||||
void StaticFolderPage::handle_request_main(Request *request) {
|
void StaticFolderPage::handle_request_main(Request *request) {
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
#include "message_page.h"
|
#include "message_page.h"
|
||||||
|
|
||||||
#include "core/database/database.h"
|
#include "database/database.h"
|
||||||
|
|
||||||
#include "core/database/query_builder.h"
|
#include "database/query_builder.h"
|
||||||
#include "core/database/table_builder.h"
|
#include "database/table_builder.h"
|
||||||
#include "core/database/query_result.h"
|
#include "database/query_result.h"
|
||||||
|
|
||||||
void MessagePage::handle_request_main(Request *request) {
|
void MessagePage::handle_request_main(Request *request) {
|
||||||
Ref<QueryBuilder> b = db->get_query_builder();
|
Ref<QueryBuilder> b = db->get_query_builder();
|
||||||
|
@ -11,11 +11,11 @@
|
|||||||
#include "rbac_default_permissions.h"
|
#include "rbac_default_permissions.h"
|
||||||
#include "web_modules/users/user.h"
|
#include "web_modules/users/user.h"
|
||||||
|
|
||||||
#include "core/database/database.h"
|
#include "database/database.h"
|
||||||
#include "core/database/database_manager.h"
|
#include "database/database_manager.h"
|
||||||
#include "core/database/query_builder.h"
|
#include "database/query_builder.h"
|
||||||
#include "core/database/query_result.h"
|
#include "database/query_result.h"
|
||||||
#include "core/database/table_builder.h"
|
#include "database/table_builder.h"
|
||||||
|
|
||||||
void RBACController::handle_request_main(Request *request) {
|
void RBACController::handle_request_main(Request *request) {
|
||||||
}
|
}
|
||||||
|
@ -8,10 +8,10 @@
|
|||||||
#include <tinydir/tinydir.h>
|
#include <tinydir/tinydir.h>
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
|
|
||||||
#include "core/database/database_manager.h"
|
#include "database/database_manager.h"
|
||||||
#include "core/database/query_builder.h"
|
#include "database/query_builder.h"
|
||||||
#include "core/database/query_result.h"
|
#include "database/query_result.h"
|
||||||
#include "core/database/table_builder.h"
|
#include "database/table_builder.h"
|
||||||
|
|
||||||
#include "web/html/form_validator.h"
|
#include "web/html/form_validator.h"
|
||||||
#include "web/html/html_builder.h"
|
#include "web/html/html_builder.h"
|
||||||
|
@ -7,11 +7,11 @@
|
|||||||
#include "web/http/request.h"
|
#include "web/http/request.h"
|
||||||
#include "web/http/session_manager.h"
|
#include "web/http/session_manager.h"
|
||||||
|
|
||||||
#include "core/database/database.h"
|
#include "database/database.h"
|
||||||
#include "core/database/database_manager.h"
|
#include "database/database_manager.h"
|
||||||
#include "core/database/query_builder.h"
|
#include "database/query_builder.h"
|
||||||
#include "core/database/query_result.h"
|
#include "database/query_result.h"
|
||||||
#include "core/database/table_builder.h"
|
#include "database/table_builder.h"
|
||||||
|
|
||||||
#include "core/hash/sha256.h"
|
#include "core/hash/sha256.h"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user