start working on 0.7.x branch

- added FileLog which stores content to the file log
- now Log is only a wrapper - it puts messages to the local buffer and when logsave is used then the buffer is put to FileLog
- new base classes:
  WinixBase (Log, Config*, Synchro*)
  WinixModel : public WinixBase (morm::ModelConnector*, Plugin*)
  WinixSystem : public WinixModel (System*)
  WinixRequest : public WinixSystem (SLog, Cur*)
- singletons: log, slog, plugin are depracated - now references to them are in base classses (WinixBase, WinixModel)
- DbBase,  DbConn and Db are depracated - now we are using Morm project (in WinixModel there is a model_connector pointer)
  each thread will have its own ModelConnector





git-svn-id: svn://ttmath.org/publicrep/winix/branches/0.7.x@1146 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
2018-11-21 11:03:53 +00:00
parent a7c47140ae
commit a2ffc1e81c
121 changed files with 7832 additions and 6662 deletions

View File

@@ -5,7 +5,7 @@
*/
/*
* Copyright (c) 2010-2014, Tomasz Sowa
* Copyright (c) 2010-2018, Tomasz Sowa
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -36,6 +36,7 @@
#include "core/request.h"
#include "core/config.h"
#include "db/db.h"
#include "core/cur.h"
#include "bot.h"
#include "stats.h"
@@ -151,11 +152,11 @@ StatsSession * stats_session = 0;
void SessionCreated(PluginInfo & info)
{
StatsSession * d = new StatsSession();
info.session->plugin_data.Assign(d);
info.session->plugin_data.Assign(info.plugin->current_plugin, d);
if( !info.cur->request->IsParam(nostat_param) )
{
log << log4 << "Stats: created stats plugin data"
info.log << log4 << "Stats: created stats plugin data"
<< ", plugin id: " << info.plugin_id
<< ", pointer: " << d << logend;
}
@@ -169,7 +170,7 @@ void RemoveSession(PluginInfo & info)
{
// temporarily for debug
// sometimes the pointer is null here
log << log1 << "Stats: why the info.plugin_data_base is zero? !!!!, ses_id: " << info.session->id << logend;
info.log << log1 << "Stats: why the info.plugin_data_base is zero? !!!!, ses_id: " << info.session->id << logend;
return;
}
@@ -179,7 +180,7 @@ void RemoveSession(PluginInfo & info)
if( !d->nostat )
{
log << log4 << "Stats: deleting stats plugin data"
info.log << log4 << "Stats: deleting stats plugin data"
<< ", plugin id: " << info.plugin_id
<< ", pointer: " << info.plugin_data_base << logend;
}
@@ -225,14 +226,15 @@ void Init(PluginInfo & info)
{
using namespace Stats;
plugin.Assign(WINIX_TEMPLATES_CREATEFUNCTIONS, CreateFunctions);
plugin.Assign(WINIX_CONTENT_MAKE, ContentMake);
plugin.Assign(WINIX_SESSION_CREATED, SessionCreated);
plugin.Assign(WINIX_PLUGIN_SESSION_DATA_REMOVE, RemoveSession);
plugin.Assign(WINIX_CLOSE, Close);
plugin.Assign(WINIX_FILE_REMOVED, RemoveFile);
plugin.Assign(WINIX_DIR_PREPARE_TO_REMOVE, RemoveDir);
info.plugin->Assign(WINIX_TEMPLATES_CREATEFUNCTIONS, CreateFunctions);
info.plugin->Assign(WINIX_CONTENT_MAKE, ContentMake);
info.plugin->Assign(WINIX_SESSION_CREATED, SessionCreated);
info.plugin->Assign(WINIX_PLUGIN_SESSION_DATA_REMOVE, RemoveSession);
info.plugin->Assign(WINIX_CLOSE, Close);
info.plugin->Assign(WINIX_FILE_REMOVED, RemoveFile);
info.plugin->Assign(WINIX_DIR_PREPARE_TO_REMOVE, RemoveDir);
stats.set_dependency(reinterpret_cast<WinixModel*>(info.winix_system));
stats.ReadConfig(info.config);
stats.ReadStats();