[chora] Adding new language types for enscript

Ahmed Shihab ashihab@alcahest.com
Wed, 13 Feb 2002 10:05:18 +0000


Quoting Anil Madhavapeddy <anil@recoil.org>:

> 
> Ah, thats actually the -current branch.  It should work there
> already.
> 
> > Does the new getTempFile() pass the file extension to the temp
> file?
> 
> Yup, in -current

Anil,

I've tried that and enscript.php still generates files without an 
extension. here is what I've done to check this:

1. modified mime_mappings.php and added the following lines:  
'vhd'       => 'x-extension/vhd',
'vhdl'      => 'x-extension/vhd'

I also modified mime_drivers.php to add:

$mime_drivers['horde']['enscript']['location'] 
= '/usr/local/bin/enscript';
$mime_drivers['horde']['enscript']['inline'] = true;
$mime_drivers['horde']['enscript']['handles'] = array(
    'text/html',
    'x-extension/pl',
    'x-extension/c',
    'text/xml',
    'application/x-sh',
    'application/x-javascript',
    'x-extension/java',
    'x-extension/h',
    'x-extension/cpp',          
    'x-extension/vhd');   <==============

2. modified enscript.php:

   $tmpin  = Horde::getTempFile('EnscriptIn', false, false, 
MIME_Magic::MIMEToExt($this->mime_part->getType()));
   $tmpout = Horde::getTempFile('EnscriptOut', false, false);

this leaves the temp files in the /tmp/ dir. Here is a pair generated 
when attempting to view a .vhd file

        EnscriptInXcJmLL
        EnscriptOutcJ7Om8  

clearly no extension, on the input file which should be '.vhd'

the horde/chora CVS was checked out at 0900 GMT today (13.2.2002).

What am I doing wrong?
Ahmed...