import the first version of cmslu

git-svn-id: svn://ttmath.org/publicrep/cmslu/trunk@460 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
2008-12-10 04:42:49 +00:00
parent d4a5f1f963
commit c53e985a92
37 changed files with 4944 additions and 0 deletions

73
core/main.cpp Executable file
View File

@@ -0,0 +1,73 @@
/*
* This file is a part of CMSLU -- Content Management System like Unix
* and is not publicly distributed
*
* Copyright (c) 2008, Tomasz Sowa
* All rights reserved.
*
*/
#include <cstdlib>
#include <ctime>
#include <signal.h>
#include <iostream>
#include "requestcontroller.h"
#include "data.h"
#include "log.h"
#include "request.h"
#include "db.h"
// singletons
// first 'data' then 'log' then 'request'
Data data;
Log log;
Request request;
Db db;
void signal_term(int)
{
log << log1 << "system aborted" << logend;
exit(0);
}
int main()
{
std::srand(std::time(0));
log.Init(data.log_level, data.log_file, data.log_stdout);
RequestController req_controller;
//data.read_from_file();
db.Init(data.db_database, data.db_user, data.db_pass);
if( !req_controller.Init() )
return 1;
log << log1 << "system started" << logend;
signal(SIGTERM, signal_term);
log << log1 << "checking for table consistency...";
db.CheckAllUrlSubject();
log << log1 << "done" << logend;
req_controller.Loop();
log << log1 << "system stopped" << logend;
return 0;
}