[dev] chora: subversion support, MIME handling...
Roman Neuhauser
neuhauser at bellavista.cz
Mon Oct 13 06:53:30 PDT 2003
# chuck at horde.org / 2003-10-13 00:30:58 -0400:
> Quoting Roman Neuhauser <neuhauser at bellavista.cz>:
> > Checkout display 'prettification' ignores files without extensions
> > like Makefiles, because MIME_Magic() doesn't even consider such files,
> > and chora thus calls MIME_Magic::extToMIME() instead of potentially[1]
> > more useful MIME_Magic::filenameToMIME(). The fix belongs to MIME_Magic,
> > what do you want it to look like? BTW, this is a regression:
> > http://lists.horde.org/archives/chora/Week-of-Mon-20020722/003314.html
>
> I'll commit some fixes to Chora to use filenameToMIME(), but we need the
> MIME_Magic code to be able to support extension-less entries. Any nice way of
> doing that would be great.
I've been thinking about this, and my opinion is that the best
behavior is what I saw used by vim's filetype-guessing code:
1. /full/path/basename.extension
2. basename.extension
2. extension
each method should have it's own mapping table.
what you use to match the filename (preg_match(), glob(), whatever)
is not that important (of course, PCRE provides the most flexibility)
1. might look strange, but is actually quite useful, Imagine a
cvs/svn repository with
/module-with-asm-code/foo.inc <- assembler code
/module-with-php-code/foo.inc <- PHP code
this assumes an application can install its own entries in the
mapping tables; I see no reason it shouldn't be possible.
what do you think? I can come up with a patch tomorrow or the next
day if you ok this approach.
--
If you cc me or remove the list(s) completely I'll most likely ignore
your message. see http://www.eyrie.org./~eagle/faqs/questions.html
More information about the dev
mailing list