[chora] Adding new language types for enscript
Jan Schneider
jan@horde.org
Wed, 13 Feb 2002 11:52:46 +0100
Zitat von Ahmed Shihab <ashihab@alcahest.com>:
> 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).
Dump the results of ->getType() in co.php (lines 87/88) to see if the
correct mime type is passed to the mime viewer.
Did you also update Horde? The extension for temp files was just added.
Jan.
--
http://www.horde.org - The Horde Project
http://www.ammma.de - discover your knowledge
http://www.tip4all.de - Deine private Tippgemeinschaft