diff options
author | randomdan <randomdan@localhost> | 2013-06-23 15:02:43 +0000 |
---|---|---|
committer | randomdan <randomdan@localhost> | 2013-06-23 15:02:43 +0000 |
commit | f0f5fad8a7c3241e5f7e425a360cfd38ac959d55 (patch) | |
tree | bb97d6dd596d9302baf838661885cfb24c915ef9 /project2/cgi | |
parent | Fix the gch usage quirk with a silly hack and a load of small changes (diff) | |
download | project2-f0f5fad8a7c3241e5f7e425a360cfd38ac959d55.tar.bz2 project2-f0f5fad8a7c3241e5f7e425a360cfd38ac959d55.tar.xz project2-f0f5fad8a7c3241e5f7e425a360cfd38ac959d55.zip |
Move logger initialisation and optionSource loading out of environment into their respective components
Diffstat (limited to 'project2/cgi')
-rw-r--r-- | project2/cgi/cgiCommon.cpp | 3 | ||||
-rw-r--r-- | project2/cgi/cgiEnvironment.cpp | 6 | ||||
-rw-r--r-- | project2/cgi/cgiEnvironment.h | 1 | ||||
-rw-r--r-- | project2/cgi/cgiSimpleRouter.cpp | 1 | ||||
-rw-r--r-- | project2/cgi/testCgi.cpp | 2 |
5 files changed, 4 insertions, 9 deletions
diff --git a/project2/cgi/cgiCommon.cpp b/project2/cgi/cgiCommon.cpp index 2edbdef..a4ed8c4 100644 --- a/project2/cgi/cgiCommon.cpp +++ b/project2/cgi/cgiCommon.cpp @@ -1,5 +1,6 @@ #include <pch.hpp> #include "cgiCommon.h" +#include "optionsSource.h" #include "logger.h" #include <glibmm/exception.h> #include <cgicc/CgiEnvironment.h> @@ -42,7 +43,7 @@ cgiServe(cgicc::CgiInput * i, CgiEnvironment * env, std::ostream & IO, const Cgi try { cgicc::Cgicc cgi(i); env->setCGICC(&cgi, e); - env->init(); + OptionsSource::loadSources(); CgiApplicationEngine app(env, IO); Plugable::onAllComponents(boost::bind(&ComponentLoader::onBefore, _1)); diff --git a/project2/cgi/cgiEnvironment.cpp b/project2/cgi/cgiEnvironment.cpp index 0276d57..d2ecf77 100644 --- a/project2/cgi/cgiEnvironment.cpp +++ b/project2/cgi/cgiEnvironment.cpp @@ -101,12 +101,6 @@ CgiEnvironment::getRedirectURL() const } std::string -CgiEnvironment::getScriptName() const -{ - return cgi->getEnvironment().getScriptName(); -} - -std::string CgiEnvironment::getServerName() const { return cgi->getEnvironment().getServerName(); diff --git a/project2/cgi/cgiEnvironment.h b/project2/cgi/cgiEnvironment.h index d1d51c0..e9de59d 100644 --- a/project2/cgi/cgiEnvironment.h +++ b/project2/cgi/cgiEnvironment.h @@ -40,7 +40,6 @@ class CgiEnvironment : public Environment { Glib::ustring getParamQuery(const std::string & idx) const; void applyAllParameters(const boost::function<void (const std::string &, const std::string &)> &) const; std::string getServerName() const; - std::string getScriptName() const; std::string getRedirectURL() const; std::string getRequestMethod() const; std::string getAccept() const; diff --git a/project2/cgi/cgiSimpleRouter.cpp b/project2/cgi/cgiSimpleRouter.cpp index 2359c4e..cd14c53 100644 --- a/project2/cgi/cgiSimpleRouter.cpp +++ b/project2/cgi/cgiSimpleRouter.cpp @@ -1,4 +1,5 @@ #include "cgiEnvironment.h" +#include <boost/filesystem/path.hpp> #include "scriptLoader.h" #include "presenter.h" diff --git a/project2/cgi/testCgi.cpp b/project2/cgi/testCgi.cpp index cd42873..9ef0079 100644 --- a/project2/cgi/testCgi.cpp +++ b/project2/cgi/testCgi.cpp @@ -24,7 +24,7 @@ class TestInput : public cgicc::CgiInput, public CgiEnvInput { typedef std::map<std::string, StrPtr> OptStore; TestInput(int argc, char ** argv) { - env.init(); + OptionsSource::loadSources(); FileOptions fo(".testCgi.settings"); fo.loadInto(TestConfigConsumer()); if (argc > 1) { |