/* * 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 #include #include #include #include #include #include #include #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" #include "compress.h" #include "htmlfilter.h" #include "getparser.h" #include "postparser.h" #include "cookieparser.h" #include "postmultiparser.h" #include "acceptencodingparser.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 // !! moze to do loggera dac? bool stdout_is_closed; /* controllers (note that the whole app object is actually a controller too) */ // functions (ls, cat, emacs, ...) Functions functions; /* view */ Templates templates; TemplatesNotify templates_notify; private: enum Header { h_200, h_404, h_403 }; GetParser get_parser; PostParser post_parser; PostMultiParser post_multi_parser; CookieParser cookie_parser; AcceptEncodingParser accept_encoding_parser; Compress compress; HTMLFilter html_filter; std::string clean_html, html_with_debug; bool CreateFCGISocket(); void ProcessRequestThrow(); void ProcessRequest(); bool BaseUrlRedirect(); void DeleteAllPluginsData(); void MakePage(); void Make(); void SaveSessionsIfNeeded(); // !! wywalic do managara sesji?? void LogAccess(); void ReadRequest(); void SendAnswer(); void SetEnv(const char * & env, const char * name); void ReadEnvVariables(); void ReadGetPostVars(); void CheckIE(); void CheckKonqueror(); void CheckRequestMethod(); void CheckFCGIRole(); void SetHtmlFilterConf(); void PrepareSessionCookie(); void AddDebugInfo(std::string & out); void FilterCompressSend(bool compressing, const std::string & source_ref); void SendHeaders(bool compressing, Header header); bool IsCompressionAllowed(const std::string & source); bool CanSendContent(Header header); // !! dodac do session managera? time_t last_sessions_save; }; #endif