20 #include "qgsconfig.h"
27 #include <fcgi_stdio.h>
30 #include <QFontDatabase>
39 return FCGX_Accept( &FCGI_stdin->fcgx_stream, &FCGI_stdout->fcgx_stream, &FCGI_stderr->fcgx_stream, &environ );
45 int main(
int argc,
char *argv[] )
49 if ( argv[1] == QLatin1String(
"--version" ) || argv[1] == QLatin1String(
"-v" ) )
65 const char *display = getenv(
"DISPLAY" );
66 bool withDisplay =
true;
70 qputenv(
"QT_QPA_PLATFORM",
"offscreen" );
71 QgsMessageLog::logMessage(
"DISPLAY not set, running in offscreen mode, all printing capabilities will not be available.",
"Server", Qgis::MessageLevel::Info );
74 const QgsApplication app( argc, argv, withDisplay, QString(), QStringLiteral(
"server" ) );
76 #ifdef HAVE_SERVER_PYTHON_PLUGINS
Extends QApplication to provide access to QGIS specific resources such as theme paths,...
static void exitQgis()
deletes provider registry and map layer registry
static QString allVersions()
Display all versions in the standard output stream.
Class defining fcgi request.
bool hasError() const
Returns true if an error occurred during initialization.
Class defining fcgi response.
void sendError(int code, const QString &message) override
Send error This method delegates error handling at the server level.
static void logMessage(const QString &message, const QString &tag=QString(), Qgis::MessageLevel level=Qgis::MessageLevel::Warning, bool notifyUser=true)
Adds a message to the log instance (and creates it if necessary).
QgsServerRequest::Method method() const
The QgsServer class provides OGC web services.
void handleRequest(QgsServerRequest &request, QgsServerResponse &response, const QgsProject *project=nullptr)
Handles the request.
int main(int argc, char *argv[])