When I look over the headers from sitepoint, it looks like php-4.3.11 is use, so we should be able to use the proc_open function. Can anyone confirm if
a) this whole ruby syntax thing is viable
b) if the sitepoint host would have enscript available
c) some code similar to this (the core of what could highlight ruby easily) would be acceptable?
PHP Code:
$argv = "enscript -q -p - --highlight=$lang --language=html --color";
$desc = array(
0 => array("pipe", "r"),
1 => array("pipe", "w"),
2 => array("pipe", "w")
);
$proc = proc_open($argv, $desc, $pipe);
if (is_resource($proc)) {
fwrite($pipe[0], $code);
fclose($pipe[0]);
$code = '';
while (!feof($pipe[1])) {
$code .= fgets($pipe[1], 4096);
}
fclose($pipe[1]);
fclose($pipe[2]);
proc_close($proc);
}
Bookmarks