From: moodler Date: Sat, 14 Feb 2004 03:00:56 +0000 (+0000) Subject: Using PHP_OS to detect OS (thanks, Greg Barnett!) X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=aaad4891499c37c250b03a16e67fffc44274b42f;p=moodle.git Using PHP_OS to detect OS (thanks, Greg Barnett!) Included three binaries for mimetex ... Linux is tested but I haven't tested the others yet --- diff --git a/filter/tex/mimetex.darwin b/filter/tex/mimetex.darwin new file mode 100755 index 0000000000..e0064f182a Binary files /dev/null and b/filter/tex/mimetex.darwin differ diff --git a/filter/tex/mimetex.exe b/filter/tex/mimetex.exe new file mode 100755 index 0000000000..6b818a5aad Binary files /dev/null and b/filter/tex/mimetex.exe differ diff --git a/filter/tex/mimetex b/filter/tex/mimetex.linux similarity index 100% rename from filter/tex/mimetex rename to filter/tex/mimetex.linux diff --git a/filter/tex/pix.php b/filter/tex/pix.php index 872b94d4d1..7613830bbd 100644 --- a/filter/tex/pix.php +++ b/filter/tex/pix.php @@ -46,7 +46,17 @@ $texexp = str_replace('>','>',$texexp); $texexp = preg_replace('!\r\n?!',' ',$texexp); $texexp = '\Large ' . $texexp; - system("QUERY_STRING=;export QUERY_STRING;$CFG->dirroot/$CFG->texfilterdir/mimetex -d ". escapeshellarg($texexp) . " >$pathname"); + switch (PHP_OS) { + case "Linux": + system("QUERY_STRING=;export QUERY_STRING;$CFG->dirroot/$CFG->texfilterdir/mimetex.linux -d ". escapeshellarg($texexp) . " >$pathname"); + break; + case "Windows": + system("$CFG->dirroot/$CFG->texfilterdir/mimetex.exe -d ". escapeshellarg($texexp) . " >$pathname"); + break; + case "Darwin": + system("QUERY_STRING=;export QUERY_STRING;$CFG->dirroot/$CFG->texfilterdir/mimetex.darwin -d ". escapeshellarg($texexp) . " >$pathname"); + break; + } } }