]> git.mjollnir.org Git - moodle.git/commitdiff
Using PHP_OS to detect OS (thanks, Greg Barnett!)
authormoodler <moodler>
Sat, 14 Feb 2004 03:00:56 +0000 (03:00 +0000)
committermoodler <moodler>
Sat, 14 Feb 2004 03:00:56 +0000 (03:00 +0000)
Included three binaries for mimetex ... Linux is tested but I haven't
tested the others yet

filter/tex/mimetex.darwin [new file with mode: 0755]
filter/tex/mimetex.exe [new file with mode: 0755]
filter/tex/mimetex.linux [moved from filter/tex/mimetex with 100% similarity]
filter/tex/pix.php

diff --git a/filter/tex/mimetex.darwin b/filter/tex/mimetex.darwin
new file mode 100755 (executable)
index 0000000..e0064f1
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 (executable)
index 0000000..6b818a5
Binary files /dev/null and b/filter/tex/mimetex.exe differ
similarity index 100%
rename from filter/tex/mimetex
rename to filter/tex/mimetex.linux
index 872b94d4d10cb138a60b9d1438bd645e75d74435..7613830bbdf6a54c26645dd9eb9f67b999e653d3 100644 (file)
             $texexp = str_replace('&gt;','>',$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;
+            }
         }
     }