the first part of reimplementing has been done
now we have app object and singletons are only: log logn plugin and app git-svn-id: svn://ttmath.org/publicrep/winix/trunk@628 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
111
core/app.h
Executable file
111
core/app.h
Executable file
@@ -0,0 +1,111 @@
|
||||
/*
|
||||
* This file is a part of Winix
|
||||
* and is not publicly distributed
|
||||
*
|
||||
* Copyright (c) 2010, Tomasz Sowa
|
||||
* All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef headerfilecmslucoreapp
|
||||
#define headerfilecmslucoreapp
|
||||
|
||||
#include <iostream>
|
||||
#include <ctime>
|
||||
#include <unistd.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
#include <pwd.h>
|
||||
#include <grp.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include "config.h"
|
||||
#include "system.h"
|
||||
#include "mounts.h"
|
||||
#include "request.h"
|
||||
#include "sessionmanager.h"
|
||||
#include "notify.h"
|
||||
#include "db.h"
|
||||
#include "functions/functions.h"
|
||||
#include "templates/templates.h"
|
||||
#include "templatesnotify/templatesnotify.h"
|
||||
|
||||
|
||||
|
||||
|
||||
class App
|
||||
{
|
||||
public:
|
||||
|
||||
App();
|
||||
|
||||
bool Init();
|
||||
void Start();
|
||||
void Close();
|
||||
|
||||
|
||||
|
||||
// configuration read from a config file
|
||||
Config config;
|
||||
|
||||
// current request
|
||||
Request request;
|
||||
|
||||
// users sessions
|
||||
SessionManager session_manager;
|
||||
|
||||
// notifications (by emails)
|
||||
Notify notify;
|
||||
|
||||
// database
|
||||
Db db;
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
model
|
||||
*/
|
||||
|
||||
// file system
|
||||
System system;
|
||||
|
||||
// false at the beginning
|
||||
bool stdout_is_closed;
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
controller
|
||||
*/
|
||||
|
||||
// functions (ls, cat, emacs, ...)
|
||||
Functions functions;
|
||||
|
||||
|
||||
/*
|
||||
view
|
||||
*/
|
||||
|
||||
Templates templates;
|
||||
TemplatesNotify templates_notify;
|
||||
|
||||
|
||||
private:
|
||||
bool CreateFCGISocket();
|
||||
void ProcessRequest();
|
||||
bool BaseUrlRedirect();
|
||||
void DeleteAllPluginsData();
|
||||
void MakePage();
|
||||
void Make();
|
||||
void ReadAdditionalInfo();
|
||||
void SaveSessionsIfNeeded(); // !! wywalic do managara sesji??
|
||||
|
||||
// !! dodac do session managera?
|
||||
time_t last_sessions_save;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
Reference in New Issue
Block a user