/* Copyright (C) 2012 - 2013 EngSaS - Engineering Solutions and Services Langenbach. All rights reserved. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include "webserverrunner.h" #include "moc_webserverrunner.cpp" #include "sitestingconfig.h" #include "webserverprocess.h" #include #include WebserverRunner::WebserverRunner() : QObject() { } WebserverRunner::~WebserverRunner() { } void WebserverRunner::start() { QStringList arguments; arguments << QString("-S %1:%2").arg(QString(WEBSERVICE_SERVER_HOST)).arg(QString(WEBSERVICE_SERVER_PORT)); arguments << QString("-t %1").arg(WebserverProcess::appendSlashToUrl(QString(WEBSERVICE_SERVER_DOCROOT))); qDebug() << QString("%1: Executing %2 %3").arg(metaObject()->className()).arg(QString(PHP_EXECUTABLE)).arg(arguments.join(" ")); // _webserverProcess->setStandardInputFile("/tmp/test-input"); // _webserverProcess->setStandardErrorFile("/tmp/test-error.log"); // _webserverProcess->setStandardOutputFile("/tmp/test-output.log"); // must be executed in own thread, QProcess::start isn't working QProcess::execute(QString(PHP_EXECUTABLE) +" "+ arguments.join(" ")); }