mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2024-11-08 08:47:17 +01:00
4a6bfc086c
Switched to POCO library for unified platform/library interface. Deprecated the external module API. It was creating more problems than solving. Removed most built-in libraries in favor of system libraries for easier maintenance. Cleaned and secured code with help from static analyzers.
54 lines
853 B
C++
54 lines
853 B
C++
//
|
|
// ApacheApplication.cpp
|
|
//
|
|
// Copyright (c) 2006-2011, Applied Informatics Software Engineering GmbH.
|
|
// and Contributors.
|
|
//
|
|
// SPDX-License-Identifier: BSL-1.0
|
|
//
|
|
|
|
|
|
#include "ApacheApplication.h"
|
|
#include "ApacheChannel.h"
|
|
#include "Poco/Logger.h"
|
|
#include "Poco/SingletonHolder.h"
|
|
#include <vector>
|
|
|
|
|
|
using Poco::Logger;
|
|
using Poco::FastMutex;
|
|
|
|
|
|
ApacheApplication::ApacheApplication():
|
|
_ready(false)
|
|
{
|
|
Logger::root().setChannel(new ApacheChannel);
|
|
}
|
|
|
|
|
|
ApacheApplication::~ApacheApplication()
|
|
{
|
|
Logger::shutdown();
|
|
}
|
|
|
|
|
|
void ApacheApplication::setup()
|
|
{
|
|
FastMutex::ScopedLock lock(_mutex);
|
|
|
|
if (!_ready)
|
|
{
|
|
std::vector<std::string> cmdLine;
|
|
cmdLine.push_back("mod_poco");
|
|
init(cmdLine);
|
|
_ready = true;
|
|
}
|
|
}
|
|
|
|
|
|
ApacheApplication& ApacheApplication::instance()
|
|
{
|
|
static Poco::SingletonHolder<ApacheApplication> sh;
|
|
return *sh.get();
|
|
}
|