mirror of
https://github.com/Relintai/rcpp_framework.git
synced 2024-11-14 04:57:21 +01:00
Now RCPPFramework can also allocate the FileCache singleotn.
This commit is contained in:
parent
ffbdae1520
commit
b2503ba587
@ -8,6 +8,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if WEB_ENABLED
|
#if WEB_ENABLED
|
||||||
|
#include "web/file_cache.h"
|
||||||
#include "web/http/session_manager.h"
|
#include "web/http/session_manager.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -76,6 +77,7 @@ RCPPFramework::RCPPFramework() {
|
|||||||
|
|
||||||
#if WEB_ENABLED
|
#if WEB_ENABLED
|
||||||
allocate_session_manager_singleton = true;
|
allocate_session_manager_singleton = true;
|
||||||
|
allocate_file_cache_singleton = true;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -115,7 +117,17 @@ void RCPPFramework::_do_initialize() {
|
|||||||
#if WEB_ENABLED
|
#if WEB_ENABLED
|
||||||
if (allocate_session_manager_singleton) {
|
if (allocate_session_manager_singleton) {
|
||||||
::SessionManager *session_manager = new ::SessionManager();
|
::SessionManager *session_manager = new ::SessionManager();
|
||||||
RCPPFramework::get_singleton()->manage_object(session_manager);
|
manage_object(session_manager);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (allocate_file_cache_singleton) {
|
||||||
|
FileCache *file_cache = new FileCache(true);
|
||||||
|
manage_object(file_cache);
|
||||||
|
|
||||||
|
if (www_root != "") {
|
||||||
|
file_cache->wwwroot = www_root;
|
||||||
|
file_cache->wwwroot_refresh_cache();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -36,6 +36,11 @@ public:
|
|||||||
|
|
||||||
#if WEB_ENABLED
|
#if WEB_ENABLED
|
||||||
bool allocate_session_manager_singleton;
|
bool allocate_session_manager_singleton;
|
||||||
|
bool allocate_file_cache_singleton;
|
||||||
|
|
||||||
|
// By default it's set to "".
|
||||||
|
// It will be ignored if you leave it.
|
||||||
|
String www_root;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
Loading…
Reference in New Issue
Block a user