mirror of
https://github.com/Karaka-Management/oms-OnlineResourceWatcher.git
synced 2026-02-07 11:58:41 +00:00
continue drafting NO_CI
This commit is contained in:
parent
496b7160b6
commit
122c360504
|
|
@ -1 +1 @@
|
|||
Subproject commit 7b31df32bccde804f13ed288f4881a27bf6f5ac9
|
||||
Subproject commit 324801f79a04c39558c4ca0d5dcb88236a851d26
|
||||
|
|
@ -31,6 +31,8 @@ App app;
|
|||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
/* --------------- Basic setup --------------- */
|
||||
|
||||
char *arg = Utils::ApplicationUtils::compile_arg_line(argc, argv);
|
||||
|
||||
// Set program path as cwd
|
||||
|
|
@ -43,13 +45,40 @@ int main(int argc, char **argv)
|
|||
|
||||
Utils::ApplicationUtils::chdir_application(cwd, argv[0]);
|
||||
|
||||
// Load config
|
||||
// Check config
|
||||
if (!Utils::FileUtils::file_exists("config.json")) {
|
||||
Controller::ApiController::notInstalled(argc, argv);
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* --------------- App setup --------------- */
|
||||
|
||||
// Load config
|
||||
FILE *in = fopen("config.json", "r");
|
||||
if (in == NULL) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
app.config = nlohmann::json::parse(in);
|
||||
|
||||
fclose(in);
|
||||
|
||||
// Setup db connection
|
||||
DataStorage::Database::DbConnectionConfig dbdata = (DataStorage::Database::DbConnectionConfig) {
|
||||
db = DataStorage::Database::database_type_from_str(&app.config["db"]["core"]["masters"]["admin"]["db"]),
|
||||
database = &app.config["db"]["core"]["masters"]["admin"]["database"],
|
||||
host = &app.config["db"]["core"]["masters"]["admin"]["host"],
|
||||
port = app.config["db"]["core"]["masters"]["admin"]["port"],
|
||||
login = &app.config["db"]["core"]["masters"]["admin"]["login"],
|
||||
password = &app.config["db"]["core"]["masters"]["admin"]["password"],
|
||||
};
|
||||
|
||||
app->db = DataStorage::Database::create_connection(dbdata);
|
||||
app->db->connect();
|
||||
|
||||
/* --------------- Handle request --------------- */
|
||||
|
||||
// Handle routes
|
||||
Stdlib::HashTable::ht *routes = generate_routes();
|
||||
if (routes == NULL) {
|
||||
|
|
@ -61,8 +90,14 @@ int main(int argc, char **argv)
|
|||
// Dispatch found endpoint
|
||||
(*ptr)(argc, argv);
|
||||
|
||||
/* --------------- Cleanup --------------- */
|
||||
|
||||
app->db->close();
|
||||
$app->db = NULL;
|
||||
|
||||
Stdlib::HashTable::free_table(routes);
|
||||
free(routes);
|
||||
routes = NULL;
|
||||
|
||||
free(arg);
|
||||
arg = NULL;
|
||||
|
|
|
|||
|
|
@ -5,4 +5,133 @@ namespace Controllers;
|
|||
|
||||
class FrontController
|
||||
{
|
||||
|
||||
/* Service provider */
|
||||
|
||||
public function viewFrontend(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : RenderableInterface
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function viewFrontendLogin(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : RenderableInterface
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function viewFrontendForgot(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : RenderableInterface
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function viewFrontendPricing(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : RenderableInterface
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function viewFrontendContact(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : RenderableInterface
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function viewFrontendImprint(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : RenderableInterface
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function viewFrontendTerms(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : RenderableInterface
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function viewFrontendAbout(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : RenderableInterface
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function viewFrontendPrivacy(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : RenderableInterface
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function viewFrontendDemo(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : RenderableInterface
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function viewFrontendOrganizationList(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : RenderableInterface
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function viewFrontendOrganizationSetting(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : RenderableInterface
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function viewFrontendUserList(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : RenderableInterface
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function viewFrontendUserSetting(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : RenderableInterface
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/* User */
|
||||
|
||||
public function viewBackendDashboard(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : RenderableInterface
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function viewBackendLogin(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : RenderableInterface
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function viewBackendForgot(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : RenderableInterface
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function viewBackendOrgSettings(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : RenderableInterface
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function viewBackendUserList(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : RenderableInterface
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function viewBackendUserSettings(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : RenderableInterface
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function viewBackendPosts(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : RenderableInterface
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function viewBackendImprint(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : RenderableInterface
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function viewBackendTerms(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : RenderableInterface
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function viewBackendPrivacy(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : RenderableInterface
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function viewBuildSoftware(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : RenderableInterface
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -159,7 +159,12 @@ class WebApplication extends ApplicationAbstract
|
|||
$appName = $this->getApplicationNameFromString($appName);
|
||||
|
||||
if ($appName !== 'E500') {
|
||||
UriFactory::setQuery('/prefix', (empty(UriFactory::getQuery('/prefix')) ? '' : UriFactory::getQuery('/prefix') . '/') . $uri->getPathElement($subDirDepth + 1) . '/');
|
||||
UriFactory::setQuery(
|
||||
'/prefix',
|
||||
empty(UriFactory::getQuery('/prefix')
|
||||
? ''
|
||||
: UriFactory::getQuery('/prefix') . '/') . $uri->getPathElement($subDirDepth + 1) . '/'
|
||||
);
|
||||
|
||||
return $appName;
|
||||
}
|
||||
|
|
@ -170,7 +175,12 @@ class WebApplication extends ApplicationAbstract
|
|||
$appName = $this->getApplicationNameFromString($appName);
|
||||
|
||||
if ($appName !== 'E500') {
|
||||
UriFactory::setQuery('/prefix', (empty(UriFactory::getQuery('/prefix')) ? '' : UriFactory::getQuery('/prefix') . '/') . $uri->getPathElement($subDirDepth + 1) . '/');
|
||||
UriFactory::setQuery(
|
||||
'/prefix',
|
||||
empty(UriFactory::getQuery('/prefix')
|
||||
? ''
|
||||
: UriFactory::getQuery('/prefix') . '/') . $uri->getPathElement($subDirDepth + 1) . '/'
|
||||
);
|
||||
|
||||
return $appName;
|
||||
}
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 26 KiB |
Loading…
Reference in New Issue
Block a user