diff --git a/dmsctl.bat b/dmsctl.bat new file mode 100644 index 0000000..7771ace --- /dev/null +++ b/dmsctl.bat @@ -0,0 +1,67 @@ +@echo off + +rem KnowledgeTree Control Script + + +rem ============= SET ENVIRONMENT VARIABLES ============== +set ZEND_PATH=C:\PROGRA~1\Zend\ +set INSTALL_PATH=%ZEND_PATH%\KnowledgeTree +set JAVA_BIN=%INSTALL_PATH%\jre\bin\java.exe +set SOFFICE_PATH=%INSTALL_PATH%\openoffice +set SOFFICE_BIN=%SOFFICE_PATH%\program\soffice.exe +set SOFFICE_PORT=8100 + +set OpenofficeServiceName=KTOpenoffice +set SchedulerServiceName=KTScheduler +set LuceneServiceName=KTLucene + + +rem ============= MAIN ============== +if NOT ""%1"" == ""help"" IF NOT ""%1"" == ""start"" IF NOT ""%1"" == ""stop"" IF NOT ""%1"" == ""restart"" IF NOT ""%1"" == ""install"" IF NOT ""%1"" == ""uninstall"" goto help +goto %1 + +:help +echo USAGE: +echo. +echo dmsctl.bat ^ +echo. +echo help - this screen +echo. +echo start - start the services +echo stop - stop the services +echo restart - restart the services +echo. +echo install - install the services +echo uninstall - uninstall the services +echo. + +goto end + +:start +echo Starting services +sc start %OpenofficeServiceName% +sc start %LuceneServiceName% +ping -n 7 127.0.0.1 > null +sc start %SchedulerServiceName% +goto end + +:stop +echo Stopping services +sc stop %LuceneServiceName% +sc stop %SchedulerServiceName% +sc stop %OpenofficeServiceName% +ping -n 7 127.0.0.1 > null +IF ""%1"" == ""restart"" goto start +goto end + +:restart +goto stop + +:uninstall +echo Uninstalling services +sc delete %LuceneServiceName% +sc delete %SchedulerServiceName% +sc delete %OpenofficeServiceName% +goto end + +:end diff --git a/setup/wizard/steps/configuration.php b/setup/wizard/steps/configuration.php index 36ec78d..2f5a45a 100644 --- a/setup/wizard/steps/configuration.php +++ b/setup/wizard/steps/configuration.php @@ -378,7 +378,7 @@ class configuration extends Step */ private function getServerInfo() { - $iis = false; +// $iis = false; $script = $_SERVER['SCRIPT_NAME']; /* $file_system_root = $_SERVER['DOCUMENT_ROOT']; @@ -391,15 +391,16 @@ class configuration extends Step $host = $_SERVER['SERVER_NAME']; $port = $_SERVER['SERVER_PORT']; $ssl_enabled = isset($_SERVER['HTTPS']) ? (strtolower($_SERVER['HTTPS']) === 'on' ? 'yes' : 'no') : 'no'; - $pos = strpos($script, '/setup/wizard/'); $root_url = substr($script, 0, $pos); $root_url = (isset($_POST['root_url'])) ? $_POST['root_url'] : $root_url; - if($iis) { - $file_system_root = (isset($_POST['file_system_root'])) ? $_POST['file_system_root'] : $file_system_root; - } else { - $file_system_root = (isset($_POST['file_system_root'])) ? $_POST['file_system_root'] : $file_system_root.substr($root_url, 1, strlen($root_url)); - } +// echo $file_system_root; +// if($iis) { + $file_system_root = (isset($_POST['file_system_root'])) ? $_POST['file_system_root'] : $file_system_root; +// } else { +// substr($root_url, 1, strlen($root_url)) +// $file_system_root = (isset($_POST['file_system_root'])) ? $_POST['file_system_root'] : $file_system_root.$root_url; +// } $host = (isset($_POST['host'])) ? $_POST['host'] : $host; $port = (isset($_POST['port'])) ? $_POST['port'] : $port; $ssl_enabled = (isset($_POST['ssl_enabled'])) ? $_POST['ssl_enabled'] : $ssl_enabled; diff --git a/setup/wizard/steps/services.php b/setup/wizard/steps/services.php index 4d71b88..79344ce 100644 --- a/setup/wizard/steps/services.php +++ b/setup/wizard/steps/services.php @@ -222,8 +222,6 @@ class services extends Step $this->alreadyInstalled = true; $this->serviceCheck = 'tick'; } else { -// $cmd = SYSTEM_DIR."dmsctl.sh start > /dev/null 2>&1 & echo $!"; -// $this->util->pexec($cmd); // First Attempt to start all using bash script foreach ($this->getServices() as $bin=>$service) { $class = strtolower($service)."Validation"; $this->$class->preset(); // Sets defaults diff --git a/var/bin/schedulerTask.sh b/var/bin/schedulerTask.sh old mode 100644 new mode 100755 index e3919de..93ce1c8 --- a/var/bin/schedulerTask.sh +++ b/var/bin/schedulerTask.sh @@ -1 +1,12 @@ -// DO NOT DELETE +#!/bin/bash +PHP_CLI="/usr/local/zend/bin/php" + +BIN_DIR=$(dirname $0) +INSTALL_DIR="../../${BIN_DIR}" + +cd $INSTALL_DIR/bin + +while true; do + $PHP_CLI -Cq scheduler.php + sleep 30 +done \ No newline at end of file