Skip to content
Snippets Groups Projects
Unverified Commit 18e7dd5e authored by Conrad Zelck's avatar Conrad Zelck
Browse files

feat: make pandoc.php's debug mode switchable


Switch debug mode on with a file called "DEBUG".

Signed-off-by: default avatarConrad Zelck <git@simpel.cc>
parent 1c284d35
No related branches found
No related tags found
No related merge requests found
...@@ -2,10 +2,18 @@ ...@@ -2,10 +2,18 @@
if ('post' === strtolower($_SERVER['REQUEST_METHOD'])) { if ('post' === strtolower($_SERVER['REQUEST_METHOD'])) {
include 'localConfig.php'; include 'localConfig.php';
// prepare for debug
$debug = false;
if (file_exists('DEBUG')) {
$debug = true;
}
// DEBUG: output all set variables from $_POST // DEBUG: output all set variables from $_POST
// var_dump($_POST); if ($debug) {
// echo '================================================== var_dump($_POST);
// '; echo '==================================================
';
}
// give input file a name that shouldn't collide with other users // give input file a name that shouldn't collide with other users
$file = 'input/input' . microtime(true) . '.txt'; $file = 'input/input' . microtime(true) . '.txt';
...@@ -73,14 +81,18 @@ ...@@ -73,14 +81,18 @@
$command .= ' ' . $file; $command .= ' ' . $file;
// DEBUG: output error messages from cmd line // DEBUG: output error messages from cmd line
// $command .= ' 2>&1'; if ($debug) {
$command .= ' 2>&1';
}
// DEBUG: output the whole command line // DEBUG: output the whole command line
// echo $command; if ($debug) {
// echo ' echo $command;
// '; echo '
// echo '================================================== ';
// '; echo '==================================================
';
}
// put the path to pandoc temporarily to the servers path // put the path to pandoc temporarily to the servers path
// configure the path in localConfig.php // configure the path in localConfig.php
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment