[rkward-cvs] SF.net SVN: rkward:[3108] trunk/rkward
tfry at users.sourceforge.net
tfry at users.sourceforge.net
Tue Oct 5 17:57:52 UTC 2010
Revision: 3108
http://rkward.svn.sourceforge.net/rkward/?rev=3108&view=rev
Author: tfry
Date: 2010-10-05 17:57:52 +0000 (Tue, 05 Oct 2010)
Log Message:
-----------
Bye, bye, PHP backend
Modified Paths:
--------------
trunk/rkward/ChangeLog
trunk/rkward/rkward/plugin/rkstandardcomponent.cpp
trunk/rkward/rkward/scriptbackends/CMakeLists.txt
trunk/rkward/rkward/settings/CMakeLists.txt
trunk/rkward/rkward/settings/rksettings.cpp
trunk/rkward/rkward/settings/rksettings.h
Removed Paths:
-------------
trunk/rkward/rkward/scriptbackends/common.php
trunk/rkward/rkward/scriptbackends/php.ini
trunk/rkward/rkward/scriptbackends/phpbackend.cpp
trunk/rkward/rkward/scriptbackends/phpbackend.h
trunk/rkward/rkward/settings/rksettingsmodulephp.cpp
trunk/rkward/rkward/settings/rksettingsmodulephp.h
Modified: trunk/rkward/ChangeLog
===================================================================
--- trunk/rkward/ChangeLog 2010-10-05 17:56:47 UTC (rev 3107)
+++ trunk/rkward/ChangeLog 2010-10-05 17:57:52 UTC (rev 3108)
@@ -1,3 +1,4 @@
+- Removed the remainder of the PHP scripting backend
- Fixed: Would crash on tcl/tk events in some cases
--- Version 0.5.4 - Oct-04-2010
Modified: trunk/rkward/rkward/plugin/rkstandardcomponent.cpp
===================================================================
--- trunk/rkward/rkward/plugin/rkstandardcomponent.cpp 2010-10-05 17:56:47 UTC (rev 3107)
+++ trunk/rkward/rkward/plugin/rkstandardcomponent.cpp 2010-10-05 17:57:52 UTC (rev 3108)
@@ -31,7 +31,6 @@
#include <khbox.h>
#include "rkstandardcomponentgui.h"
-#include "../scriptbackends/phpbackend.h"
#include "../scriptbackends/qtscriptbackend.h"
#include "../scriptbackends/simplebackend.h"
#include "../scriptbackends/rkcomponentscripting.h"
@@ -90,16 +89,12 @@
return;
}
- // initialize the PHP-backend with the code-template
+ // initialize the script backend with the code-template
QDomElement element = xml->getChildElement (doc_element, "code", DL_WARNING);
if (element.hasAttribute ("file")) {
- QString dummy = QFileInfo (filename).path() + '/' + xml->getStringAttribute (element, "file", "code.php", DL_WARNING);
+ QString dummy = QFileInfo (filename).path() + '/' + xml->getStringAttribute (element, "file", "code.js", DL_WARNING);
- if (!dummy.endsWith (".php")) {
- backend = new QtScriptBackend (dummy);
- } else {
- backend = new PHPBackend (dummy);
- }
+ backend = new QtScriptBackend (dummy);
} else {
SimpleBackend *back = new SimpleBackend ();
back->setPreprocessTemplate (xml->getStringAttribute (element, "preprocess", QString::null, DL_INFO));
@@ -283,7 +278,7 @@
createTopLevel (doc_element, force_mode);
- // set old GUI settings. For this purpose, we'll temporarily disable updates in the phpbackend
+ // set old GUI settings. For this purpose, we'll temporarily disable updates in the script backend
created = false;
setPropertyValues (&value_save);
created = true;
Modified: trunk/rkward/rkward/scriptbackends/CMakeLists.txt
===================================================================
--- trunk/rkward/rkward/scriptbackends/CMakeLists.txt 2010-10-05 17:56:47 UTC (rev 3107)
+++ trunk/rkward/rkward/scriptbackends/CMakeLists.txt 2010-10-05 17:57:52 UTC (rev 3108)
@@ -4,7 +4,6 @@
########### next target ###############
SET(scriptbackends_STAT_SRCS
- phpbackend.cpp
scriptbackend.cpp
simplebackend.cpp
qtscriptbackend.cpp
@@ -18,7 +17,7 @@
########### install files ###############
-INSTALL(FILES common.php php.ini common.js rkcomponentscripting.js DESTINATION ${DATA_INSTALL_DIR}/rkward/phpfiles )
+INSTALL(FILES common.js rkcomponentscripting.js DESTINATION ${DATA_INSTALL_DIR}/rkward/phpfiles )
Deleted: trunk/rkward/rkward/scriptbackends/common.php
===================================================================
--- trunk/rkward/rkward/scriptbackends/common.php 2010-10-05 17:56:47 UTC (rev 3107)
+++ trunk/rkward/rkward/scriptbackends/common.php 2010-10-05 17:57:52 UTC (rev 3108)
@@ -1,66 +0,0 @@
-<?
-function printIndented ($indentation, $lines) {
- $out = ereg_replace ("\n(.)", "\n" . $indentation . "\\1", $lines);
- echo ($indentation . $out);
-}
-
-// rename to getRK
-function getRK_val ($id) {
- return (getInput ("requesting data:" . $id));
-}
-
-// rename to printRK
-function getRK ($id) {
- echo (getRK_val ($id));
-}
-
-function getPreview () {
- if (function_exists ("preview")) {
- preview ();
- }
-}
-
-function makeHeaderCode ($title, $parameters=array ()) {
- echo ("rk.header(" . quote ($title));
- if (!empty ($parameters)) {
- echo (", parameters=list(");
- $first = true;
- foreach ($parameters as $key => $value) {
- if ($first) $first = false;
- else echo (",\n\t");
- echo (quote($key) . ', ' . quote ($value));
- }
- echo (")");
- }
- echo (")\n");
-}
-
-function quote ($input) {
- return ('"' . str_replace ("\"", "\\\"", $input) . '"');
-}
-
-function getInput ($prompt) {
- fputs (STDOUT, "#RKEND#\n" . $prompt . "#RKQEND#\n");
- fflush (STDOUT);
- while (1) {
- if (feof (STDIN)) die ("STDIN is at eof"); // if the parent process exits unexpectedly, make sure the PHP-process gets killed
- $inp = fgets (STDIN, 4096);
- if ($inp != "") {
- $input .= $inp;
- $inp = "";
- if (substr ($input, -8, 8) == "#RKEND#\n") {
- return (substr ($input, 0, -8));
- }
- }
- }
-}
-
-ini_set ("display_errors", "1");
-ini_set ("error_prepend_string", "#RKEND#\nPHP-Error");
-ini_set ("error_append_string", "#RKQEND#\n");
-
-while (1) {
- eval (getInput ("requesting code"));
- fflush (STDOUT);
-}
-?>
\ No newline at end of file
Deleted: trunk/rkward/rkward/scriptbackends/php.ini
===================================================================
--- trunk/rkward/rkward/scriptbackends/php.ini 2010-10-05 17:56:47 UTC (rev 3107)
+++ trunk/rkward/rkward/scriptbackends/php.ini 2010-10-05 17:57:52 UTC (rev 3108)
@@ -1,11 +0,0 @@
-; This php.ini is meant for use with RKWard, only. It is unlikely to make too much sense in any other context
-; Some additional options are set in common.php
-
-; scripts should never terminate automatically
-max_execution_time = 0
-
-; show errors
-display_errors = 1
-
-; plugins may be installed anywhere
-open_basedir = NULL
Deleted: trunk/rkward/rkward/scriptbackends/phpbackend.cpp
===================================================================
--- trunk/rkward/rkward/scriptbackends/phpbackend.cpp 2010-10-05 17:56:47 UTC (rev 3107)
+++ trunk/rkward/rkward/scriptbackends/phpbackend.cpp 2010-10-05 17:57:52 UTC (rev 3108)
@@ -1,237 +0,0 @@
-/***************************************************************************
- phpbackend - description
- -------------------
- begin : Mon Jul 26 2004
- copyright : (C) 2004, 2007, 2009 by Thomas Friedrichsmeier
- email : tfry at users.sourceforge.net
- ***************************************************************************/
-
-/***************************************************************************
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- ***************************************************************************/
-#include "phpbackend.h"
-
-#include "stdio.h"
-
-#include <qfile.h>
-#include <qfileinfo.h>
-#include <qdir.h>
-#include <QTimer>
-
-#include <kmessagebox.h>
-#include <klocale.h>
-
-#include "../misc/rkcommonfunctions.h"
-#include "../settings/rksettingsmodulephp.h"
-#include "../plugin/rkcomponentproperties.h"
-#include "../debug.h"
-
-PHPBackend::PHPBackend (const QString &filename) : ScriptBackend () {
- RK_TRACE (PHP);
-
- php_process = 0;
- dead = false;
- eot_string="#RKEND#\n";
- eoq_string="#RKQEND#\n";
-
- PHPBackend::filename = filename;
-}
-
-
-PHPBackend::~PHPBackend () {
- RK_TRACE (PHP);
-
- if (php_process) {
- RK_DO (qDebug ("PHP process has not exited after being killed for ten seconds. We destroy it now, hoping for the best"), PHP, DL_ERROR);
- }
-}
-
-bool PHPBackend::initialize (RKComponentPropertyCode *code_property, bool add_headings) {
- RK_TRACE (PHP);
-
- if (php_process) {
- RK_DO (qDebug ("another template is already openend in this backend"), PHP, DL_ERROR);
- return false;
- }
-
- QDir files_path (RKCommonFunctions::getRKWardDataDir () + "phpfiles/");
- QString common_php = files_path.absoluteFilePath ("common.php");
- QString php_ini = files_path.absoluteFilePath ("php.ini"); // make sure to set good options
- if (!QFileInfo (common_php).isReadable ()) {
- KMessageBox::error (0, i18n ("The support file \"%1\" could not be found or is not readable. Please check your installation.", common_php), i18n ("PHP-Error"));
- emit (haveError ());
- return false;
- }
-
- php_process = new QProcess (this);
- connect (php_process, SIGNAL (readyRead()), this, SLOT (gotOutput()));
- connect (php_process, SIGNAL (error(QProcess::ProcessError)), this, SLOT (processError(QProcess::ProcessError)));
- connect (php_process, SIGNAL (finished(int,QProcess::ExitStatus)), this, SLOT (processDead(int,QProcess::ExitStatus)));
-
- php_process->start ("\"" + RKSettingsModulePHP::phpBin() + "\"" + " -c \"" + php_ini + "\" \"" + common_php + "\"");
-
- doing_command = startup_done = false;
- busy = true;
-
- // start the real template
- callFunction ("include (\"" + filename + "\");", 0, Ignore);
-
- PHPBackend::code_property = code_property;
- PHPBackend::add_headings = add_headings;
- return true;
-}
-
-void PHPBackend::destroy () {
- RK_TRACE (PHP);
- if (!dead) {
- dead = true;
- if (php_process) php_process->kill ();
- QTimer::singleShot (10000, this, SLOT (deleteLater())); // don't wait for ever for the process to die, even if it's somewhat dangerous
- code_property = 0;
- }
-
- busy = false;
-}
-
-void PHPBackend::tryNextFunction () {
- RK_TRACE (PHP);
-
- if (php_process && (!dead) && (!busy) && (!command_stack.isEmpty ())) {
- /// clean up previous command if applicable
- if (command_stack.first ()->complete) {
- delete command_stack.takeFirst ();
-
- if (!command_stack.count ()) return;
- }
-
- RK_DO (qDebug ("submitting PHP code: %s", command_stack.first ()->command.toLatin1 ().data ()), PHP, DL_DEBUG);
- php_process->write (QString (command_stack.first ()->command + eot_string).toLatin1 ());
- doing_command = busy = true;
- command_stack.first ()->complete = true;
- current_flags = command_stack.first ()->flags;
- current_type = command_stack.first ()->type;
- }
-}
-
-void PHPBackend::writeData (const QString &data) {
- RK_TRACE (PHP);
-
- RK_DO (qDebug ("submitting data: %s", data.toLatin1 ().data ()), PHP, DL_DEBUG);
- php_process->write (QString (data + eot_string).toLatin1 ());
- tryNextFunction ();
-}
-
-void PHPBackend::gotOutput () {
- RK_TRACE (PHP);
-
- qint64 len = php_process->bytesAvailable ();
- if (!len) return; // false alarm
-
- QByteArray buf = php_process->readAll ();
- RK_DO (qDebug ("PHP transmission:\n%s", buf.data ()), PHP, DL_DEBUG);
-
- output_raw_buffer.append (QString::fromLatin1 (buf));
- QString request;
- QString data;
- int i, j;
- bool have_data = true;
- bool have_request = false;
-
- // is there a request in the output stream?
- if ((i = output_raw_buffer.indexOf (eot_string)) >= 0) {
- if ((j = output_raw_buffer.indexOf (eoq_string, i)) >= 0) {
- have_request = true;
- // is there also pending data?
- if (i) {
- data = output_raw_buffer.left (i);
- } else {
- have_data = false;
- }
- int start = i + eot_string.length ();
- request = output_raw_buffer.mid (start, j - start);
- output_raw_buffer = QString::null;
- }
- } else {
- data = output_raw_buffer;
- }
-
- // pending data is always first in a stream, so process it first, too
- if (have_data) {
- if (!startup_done) {
- php_process->close ();
- KMessageBox::error (0, i18n ("There has been an error\n(\"%1\")\nwhile starting up the PHP backend. Most likely this is due to either a bug in RKWard or a problem with your PHP installation. Check the settings (Settings->Configure Settings->PHP backend) and try again.", output_raw_buffer.trimmed ()), i18n ("PHP-Error"));
- emit (haveError ());
- destroy ();
- return;
- }
- }
-
- if (!have_request) {
- // output is not finished, yet.
- // return and wait for more data to come in
- RK_DO (qDebug ("PHP transmission not complete, yet"), PHP, DL_DEBUG);
- return;
- } else {
- _output.append (data);
- RK_DO (qDebug ("request: %s\ndata: %s", request.toLatin1 ().data (), data.toLatin1 ().data ()), PHP, DL_DEBUG);
-
- if (request == "requesting code") {
- startup_done = true;
- RK_DO (qDebug ("got type: %d, stack %d", current_type, command_stack.count ()), PHP, DL_DEBUG);
-#ifdef Q_OS_WIN
- commandFinished (_output.replace ("\r\n", "\n"));
-#else
- commandFinished (_output);
-#endif
- _output = QString::null;
- } else if (request.startsWith ("requesting data:")) {
- QString requested_object = request.remove ("requesting data:");
- RK_DO (qDebug ("requested data: \"%s\"", requested_object.toLatin1 ().data ()), PHP, DL_DEBUG);
- emit (requestValue (requested_object));
- busy = true;
-// writeData (res + eot_string);
- } else if (request.startsWith ("PHP-Error")) {
- QString error = request.remove ("PHP-Error");
- php_process->close ();
- KMessageBox::error (0, i18n ("The PHP-backend has reported an error\n(\"%1\")\nand has been shut down. This is most likely due to a bug in the plugin. But of course you may want to try to close and restart the plugin to see whether it works with different settings.", error.trimmed ()), i18n ("PHP-Error"));
- emit (haveError ());
- destroy ();
- return;
- } else {
- RK_DO (qDebug ("unrecognized request from PHP backend: \"%s\"", request.toLatin1().data ()), PHP, DL_ERROR);
- }
- }
-}
-
-void PHPBackend::processError (QProcess::ProcessError error) {
- RK_TRACE (PHP);
-
- if (dead) return; // we are already dead, so we've shown an error before.
-
- php_process->close ();
-
- if (error == QProcess::FailedToStart) {
- KMessageBox::error (0, i18n ("The PHP backend could not be started. Check whether you have correctly configured the location of the PHP-binary (Settings->Configure Settings->PHP backend)"), i18n ("PHP-Error"));
- } else {
- KMessageBox::error (0, i18n ("The PHP-backend has died unexpectedly. The current output buffer is shown below:\n%1", output_raw_buffer), i18n ("PHP Process exited"));
- }
-
- emit (haveError ());
- destroy ();
-}
-
-void PHPBackend::processDead (int, QProcess::ExitStatus) {
- RK_TRACE (PHP);
-
- if (dead) {
- php_process = 0;
- deleteLater ();
- } else destroy ();
-}
-
-#include "phpbackend.moc"
Deleted: trunk/rkward/rkward/scriptbackends/phpbackend.h
===================================================================
--- trunk/rkward/rkward/scriptbackends/phpbackend.h 2010-10-05 17:56:47 UTC (rev 3107)
+++ trunk/rkward/rkward/scriptbackends/phpbackend.h 2010-10-05 17:57:52 UTC (rev 3108)
@@ -1,70 +0,0 @@
-/***************************************************************************
- phpbackend - description
- -------------------
- begin : Mon Jul 26 2004
- copyright : (C) 2004, 2007 by Thomas Friedrichsmeier
- email : tfry at users.sourceforge.net
- ***************************************************************************/
-
-/***************************************************************************
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- ***************************************************************************/
-#ifndef PHPBACKEND_H
-#define PHPBACKEND_H
-
-#include "scriptbackend.h"
-
-#include <qstring.h>
-#include <qobject.h>
-#include <QProcess>
-#include <qstringlist.h>
-
-class RKPlugin;
-
-/**
-This class takes care of interfacing with PHP
-
- at author Thomas Friedrichsmeier
-*/
-class PHPBackend : public ScriptBackend {
- Q_OBJECT
-public:
- PHPBackend (const QString &filename);
-
- ~PHPBackend ();
-
- bool initialize (RKComponentPropertyCode *code_property=0, bool add_headings=true);
- void destroy ();
-
- void preprocess (int flags) { callFunction ("preprocess ();", flags, Preprocess); };
- void calculate (int flags) { callFunction ("calculate ();", flags, Calculate); };
- void printout (int flags) { callFunction ("printout ();", flags, Printout); };
- void preview (int flags) { callFunction ("getPreview ();", flags, Preview); };
- void writeData (const QString &data);
-public slots:
- void gotOutput ();
- void processError (QProcess::ProcessError error);
- void processDead (int exitCode, QProcess::ExitStatus exitStatus);
-private:
- void tryNextFunction ();
- QProcess *php_process;
-/// The string singalling the end of transmission to/from PHP. TODO: make static
- QString eot_string;
-/// The string singalling the end of request from PHP. TODO: make static
- QString eoq_string;
-
- bool doing_command;
- bool startup_done;
- bool dead;
- QString output_raw_buffer;
-
- QString _output;
- QString filename;
-};
-
-#endif
Modified: trunk/rkward/rkward/settings/CMakeLists.txt
===================================================================
--- trunk/rkward/rkward/settings/CMakeLists.txt 2010-10-05 17:56:47 UTC (rev 3107)
+++ trunk/rkward/rkward/settings/CMakeLists.txt 2010-10-05 17:57:52 UTC (rev 3108)
@@ -9,7 +9,6 @@
rksettingsmodulegeneral.cpp
rksettingsmoduleoutput.cpp
rksettingsmodulegraphics.cpp
- rksettingsmodulephp.cpp
rksettingsmoduleplugins.cpp
rksettingsmoduler.cpp
rksettingsmodulewatch.cpp
Modified: trunk/rkward/rkward/settings/rksettings.cpp
===================================================================
--- trunk/rkward/rkward/settings/rksettings.cpp 2010-10-05 17:56:47 UTC (rev 3107)
+++ trunk/rkward/rkward/settings/rksettings.cpp 2010-10-05 17:57:52 UTC (rev 3108)
@@ -28,7 +28,6 @@
// modules
#include "rksettingsmoduleplugins.h"
#include "rksettingsmoduler.h"
-#include "rksettingsmodulephp.h"
#include "rksettingsmodulegeneral.h"
#include "rksettingsmoduleoutput.h"
#include "rksettingsmodulegraphics.h"
@@ -99,7 +98,6 @@
modules.insert (PagePlugins, new RKSettingsModulePlugins (this, 0));
modules.insert (PageR, new RKSettingsModuleR (this, 0));
modules.insert (PageRPackages, new RKSettingsModuleRPackages (this, 0));
- modules.insert (PagePHP, new RKSettingsModulePHP (this, 0));
modules.insert (PageGeneral, new RKSettingsModuleGeneral (this, 0));
modules.insert (PageOutput, new RKSettingsModuleOutput (this, 0));
modules.insert (PageX11, new RKSettingsModuleGraphics (this, 0));
@@ -187,7 +185,6 @@
RKSettingsModulePlugins::loadSettings(config);
RKSettingsModuleR::loadSettings(config);
RKSettingsModuleRPackages::loadSettings(config);
- RKSettingsModulePHP::loadSettings(config);
RKSettingsModuleOutput::loadSettings(config);
RKSettingsModuleGraphics::loadSettings(config);
RKSettingsModuleWatch::loadSettings(config);
@@ -203,7 +200,6 @@
RKSettingsModulePlugins::saveSettings(config);
RKSettingsModuleR::saveSettings(config);
RKSettingsModuleRPackages::saveSettings(config);
- RKSettingsModulePHP::saveSettings(config);
RKSettingsModuleOutput::saveSettings(config);
RKSettingsModuleGraphics::saveSettings(config);
RKSettingsModuleWatch::saveSettings(config);
Modified: trunk/rkward/rkward/settings/rksettings.h
===================================================================
--- trunk/rkward/rkward/settings/rksettings.h 2010-10-05 17:56:47 UTC (rev 3107)
+++ trunk/rkward/rkward/settings/rksettings.h 2010-10-05 17:57:52 UTC (rev 3108)
@@ -40,7 +40,6 @@
PagePlugins,
PageR,
PageRPackages,
- PagePHP,
PageGeneral,
PageOutput,
PageX11,
Deleted: trunk/rkward/rkward/settings/rksettingsmodulephp.cpp
===================================================================
--- trunk/rkward/rkward/settings/rksettingsmodulephp.cpp 2010-10-05 17:56:47 UTC (rev 3107)
+++ trunk/rkward/rkward/settings/rksettingsmodulephp.cpp 2010-10-05 17:57:52 UTC (rev 3108)
@@ -1,100 +0,0 @@
-/***************************************************************************
- rksettingsmodulephp - description
- -------------------
- begin : Wed Jul 28 2004
- copyright : (C) 2004, 2009 by Thomas Friedrichsmeier
- email : tfry at users.sourceforge.net
- ***************************************************************************/
-
-/***************************************************************************
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- ***************************************************************************/
-#include "rksettingsmodulephp.h"
-
-#include <klocale.h>
-#include <kconfig.h>
-#include <kconfiggroup.h>
-
-#include <qlayout.h>
-#include <qlabel.h>
-#include <QVBoxLayout>
-
-#include "../misc/getfilenamewidget.h"
-#include "../misc/rkcommonfunctions.h"
-#include "../rkglobals.h"
-#include "../debug.h"
-
-// static members
-QString RKSettingsModulePHP::php_bin;
-
-RKSettingsModulePHP::RKSettingsModulePHP (RKSettings *gui, QWidget *parent) : RKSettingsModule (gui, parent) {
- RK_TRACE (SETTINGS);
-
- QVBoxLayout *main_vbox = new QVBoxLayout (this);
- QLabel *label = new QLabel (i18n ("Changes in this section take effect the next time you start a plugin"), this);
- label->setWordWrap (true);
- main_vbox->addWidget (label);
-
- main_vbox->addSpacing (2*RKGlobals::spacingHint ());
-
- bin_choser = new GetFileNameWidget (this, GetFileNameWidget::ExistingFile, true, i18n ("File-location of the PHP binary"), QString (), php_bin);
- connect (bin_choser, SIGNAL (locationChanged ()), this, SLOT (pathChanged ()));
- main_vbox->addWidget (bin_choser);
-
- main_vbox->addStretch ();
-}
-
-RKSettingsModulePHP::~RKSettingsModulePHP () {
- RK_TRACE (SETTINGS);
-}
-
-void RKSettingsModulePHP::pathChanged () {
- RK_TRACE (SETTINGS);
- change ();
-}
-
-QString RKSettingsModulePHP::caption () {
- RK_TRACE (SETTINGS);
- return (i18n ("PHP backend"));
-}
-
-bool RKSettingsModulePHP::hasChanges () {
- RK_TRACE (SETTINGS);
- return changed;
-}
-
-void RKSettingsModulePHP::applyChanges () {
- RK_TRACE (SETTINGS);
- php_bin = bin_choser->getLocation ();
-}
-
-void RKSettingsModulePHP::save (KConfig *config) {
- RK_TRACE (SETTINGS);
- saveSettings (config);
-}
-
-void RKSettingsModulePHP::saveSettings (KConfig *config) {
- RK_TRACE (SETTINGS);
-
- KConfigGroup cg = config->group ("PHP Settings");
- cg.writeEntry ("PHP binary", php_bin);
-}
-
-void RKSettingsModulePHP::loadSettings (KConfig *config) {
- RK_TRACE (SETTINGS);
-
- KConfigGroup cg = config->group ("PHP Settings");
-#ifdef Q_WS_WIN
- // on windows, our best hope is that php is in the path
- php_bin = cg.readEntry ("PHP binary", "php");
-#else
- php_bin = cg.readEntry ("PHP binary", "/usr/bin/php");
-#endif
-}
-
-#include "rksettingsmodulephp.moc"
Deleted: trunk/rkward/rkward/settings/rksettingsmodulephp.h
===================================================================
--- trunk/rkward/rkward/settings/rksettingsmodulephp.h 2010-10-05 17:56:47 UTC (rev 3107)
+++ trunk/rkward/rkward/settings/rksettingsmodulephp.h 2010-10-05 17:57:52 UTC (rev 3108)
@@ -1,55 +0,0 @@
-/***************************************************************************
- rksettingsmodulephp - description
- -------------------
- begin : Wed Jul 28 2004
- copyright : (C) 2004 by Thomas Friedrichsmeier
- email : tfry at users.sourceforge.net
- ***************************************************************************/
-
-/***************************************************************************
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- ***************************************************************************/
-#ifndef RKSETTINGSMODULEPHP_H
-#define RKSETTINGSMODULEPHP_H
-
-#include "rksettingsmodule.h"
-
-class GetFileNameWidget;
-
-/**
-configuration for the PHP-backend
-
- at author Thomas Friedrichsmeier
-*/
-class RKSettingsModulePHP : public RKSettingsModule {
- Q_OBJECT
-public:
- RKSettingsModulePHP (RKSettings *gui, QWidget *parent);
-
- ~RKSettingsModulePHP ();
-
- bool hasChanges ();
- void applyChanges ();
- void save (KConfig *config);
-
- static void saveSettings (KConfig *config);
- static void loadSettings (KConfig *config);
-
- QString caption ();
-
-/// returns the filename of the php-binary
- static QString &phpBin () { return php_bin; };
-public slots:
- void pathChanged ();
-private:
- GetFileNameWidget *bin_choser;
-
- static QString php_bin;
-};
-
-#endif
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the rkward-tracker
mailing list