From d11b107ce1923390f276901b574036dc9c0df553 Mon Sep 17 00:00:00 2001 From: Loic d'Anterroches Date: Wed, 17 Dec 2008 15:08:51 +0100 Subject: [PATCH] Added more text extensions and give the ability to add in the config. Using the 'idf_extra_text_ext' configuration variable you can add more text extensions. --- src/IDF/Views/Source.php | 3 ++- src/IDF/conf/idf.php-dist | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/IDF/Views/Source.php b/src/IDF/Views/Source.php index f613e32..85fb72f 100644 --- a/src/IDF/Views/Source.php +++ b/src/IDF/Views/Source.php @@ -401,7 +401,8 @@ class IDF_Views_Source if (0 === strpos($fileinfo[0], 'text/')) { return true; } - $ext = 'mdtext php js cpp php-dist'; + $ext = 'mdtext php js cpp php-dist h gitignore sh py pl rb ' + .Pluf::f('idf_extra_text_ext', ''); return (in_array($fileinfo[2], explode(' ', $ext))); } diff --git a/src/IDF/conf/idf.php-dist b/src/IDF/conf/idf.php-dist index f710123..3cf002f 100644 --- a/src/IDF/conf/idf.php-dist +++ b/src/IDF/conf/idf.php-dist @@ -190,5 +190,9 @@ $cfg['allowed_scm'] = array('git' => 'IDF_Scm_Git', 'mercurial' => 'IDF_Scm_Mercurial', ); -$cfg['idf_mimetypes_db'] = '/etc/mime.types'; +# If you want to use another memtypes database +# $cfg['idf_mimetypes_db'] = '/etc/mime.types'; + +# Extra text files when displaying source +# $cfg['idf_extra_text_ext'] = 'ext1 ext2 ext3'; return $cfg;