diff --git a/bootstrap.php b/bootstrap.php index 0b12d7f57294ad7d8ede658c32917012616bbb62..5876a6eedba4bb0d1db3065e47c55147853f37f5 100644 --- a/bootstrap.php +++ b/bootstrap.php @@ -1,6 +1,6 @@ <?php -require_once './constants.php'; +require_once __DIR__.'/constants.php'; if ($_SERVER['REQUEST_METHOD'] !== 'POST') { @@ -37,7 +37,7 @@ if (isset($config['useConfigFromDb']) === FALSE || (isset($config['useConfigFrom //get the config from the db -include_once './sqlHelper.php'; +include_once __DIR__.'/sqlHelper.php'; $conn = connectToDb($config['dbConfigServer'], $config['dbConfigName'], $config['dbConfigUser'], $config['dbConfigPw']); diff --git a/constants.php b/constants.php index f84beaba30a75e6589a4d7889e78bdeb05e0d2d4..8fa2af315d42f506466270343e0b5776c597f958 100644 --- a/constants.php +++ b/constants.php @@ -3,7 +3,7 @@ # variables //use this to know which version we published -$versionString = '1.1.1'; +$versionString = '1.1.2'; $rootDirNameToUseString = 'work'; $isDebug = false; //logs debug to STDOUT diff --git a/helpers.php b/helpers.php index c468ce9a95e77eadf7a0da74268bd5be910d57b7..ab48153fdc0e4f1f6ed2a3257d883217986e05a7 100644 --- a/helpers.php +++ b/helpers.php @@ -1,7 +1,7 @@ <?php -include_once './constants.php'; -include_once './transactionHelper.php'; +include_once __DIR__.'/constants.php'; +include_once __DIR__.'/transactionHelper.php'; /** diff --git a/sqlHelper.php b/sqlHelper.php index f6ea80364fc445583c080bc1b7a3715e0dfd2b21..16bd40846f21012a1bcc671254015cc06e42abdd 100644 --- a/sqlHelper.php +++ b/sqlHelper.php @@ -1,6 +1,6 @@ <?php -require_once './constants.php'; +require_once __DIR__.'/constants.php'; // //from http://stackoverflow.com/questions/834303/startswith-and-endswith-functions-in-php diff --git a/stats/private.php b/stats/private.php new file mode 100644 index 0000000000000000000000000000000000000000..6597bbe6328945e1486217f1cefed88185aaea05 --- /dev/null +++ b/stats/private.php @@ -0,0 +1,40 @@ +<?php + +//return the test server stats + + +//NOTE: only post is allowed!! + +#requires some helper function to e.g. create / delete dirs, handle output... + +$config = require __DIR__.'/../bootstrap.php'; + +require_once __DIR__.'/../constants.php'; + +$response = array( + "workingDirFullPath" => $config["workingDirFullPath"], + "hardGlobalTimeoutInMs" => $config["hardGlobalTimeoutInMs"], + "maxParallelTests" => $config["maxParallelTests"], + "maxNumberOfTestsWithOneRequest" => $config["maxNumberOfTestsWithOneRequest"], + //"runner" => $config["runner"], //maybe not needed + "maxLinesToRead" => $config["maxLinesToRead"], + "maxErrLinesToRead" => $config["maxErrLinesToRead"], + "maxLinesToWrite" => $config["maxLinesToWrite"], + "showTestRunnerDebugOutput" => $config["showTestRunnerDebugOutput"], + + "dbServer" => $config["dbServer"], + "dbName" => $config["dbName"], + + "useConfigFromDb" => $config["useConfigFromDb"], + "dbConfigServer" => $config["dbConfigServer"], + "dbConfigName" => $config["dbConfigName"], + + "environmentVars" => $config["environmentVars"], +); + + +if ($isDebug) { + debug(json_encode($respone)); +} + +output($status_code_Ok, "", $response); diff --git a/stats/public.php b/stats/public.php new file mode 100644 index 0000000000000000000000000000000000000000..d7e60b659deebd9b568cfb3ae34d35f656684774 --- /dev/null +++ b/stats/public.php @@ -0,0 +1,29 @@ +<?php + +//return the test server stats + + +//NOTE: only post is allowed!! + +$config = require '../bootstrap.php'; + +require_once __DIR__.'/../constants.php'; + +#requires some helper function to e.g. create / delete dirs, handle output... + + +$response = array( + "hardGlobalTimeoutInMs" => $config["hardGlobalTimeoutInMs"], + "maxNumberOfTestsWithOneRequest" => $config["maxNumberOfTestsWithOneRequest"], + "maxLinesToRead" => $config["maxLinesToRead"], + "maxErrLinesToRead" => $config["maxErrLinesToRead"], + "maxLinesToWrite" => $config["maxLinesToWrite"], + "showTestRunnerDebugOutput" => $config["showTestRunnerDebugOutput"], +); + + +if ($isDebug) { + debug(json_encode($respone)); +} + +output($status_code_Ok, "", $response); diff --git a/transactionHelper.php b/transactionHelper.php index cdb116381aab1c3fe9d700bafa232392d5ee543f..0fc6f2c59857b47633142209d12d870a028d7c76 100644 --- a/transactionHelper.php +++ b/transactionHelper.php @@ -1,7 +1,7 @@ <?php -include_once './constants.php'; -include_once './sqlHelper.php'; +include_once __DIR__.'/constants.php'; +include_once __DIR__.'/sqlHelper.php'; /** * registers/starts a test run (a transaction)