options['imc']; if (!$n) { $n = tempnam('/tmp','PintCompiler'); } $fh = fopen($n,'w'); fwrite($fh,$convert->code); fclose($fh); if (!$convert->options['parrot']) { $convert->options['parrot'] = $this->findParrot(); } $cmd = $convert->options['parrot'] . ' ' . $n; if ($convert->options['debug']) { $cmd = 'time ' . $cmd; } echo "running $cmd\n"; passthru($cmd); if (!$convert->options['imc']) { unlink($n); } if ($convert->options['debug']) { echo "THAT WAS PARROT\n\n RUNNING PHP VERSION:\n"; $cmd = 'time php '. $convert->options['input']; `$cmd`; } } function findParrot() { $locs = array('/usr/bin','/usr/local/bin','/usr/src/parrot'); foreach($locs as $loc) { if (!file_exists("{$loc}/parrot")) { continue; } if (!is_executable("{$loc}/parrot")) { continue; } return "{$loc}/parrot"; } echo "CAN NOT FIND PARROT!!\n use --parrot \n"; exit; } }