<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -55,9 +55,9 @@ final class Config
 
     // How to sort pages in tree view (comparison callback)
     const TREE_VIEW_SORT = 'strnatcmp';
-    
-    // alternate mime.cache path (optional)
-    //const MIME_CACHE_PATH = '/usr/local/share/mime/mime.cache';
+
+    // Path to mime.cache
+    const MIME_CACHE_PATH = '/usr/share/mime/mime.cache';
 }
 
 ?&gt;</diff>
      <filename>include/config.class.php</filename>
    </modified>
    <modified>
      <diff>@@ -21,24 +21,13 @@ class MIME
     protected function uint32_at($pos) { return Binary::uint32($this-&gt;cache, $pos); }
     protected function nuint32_at($pos, $n) { return Binary::nuint32($n, $this-&gt;cache, $pos); }
 
-    public function __construct($mime_cache=null)
+    public function __construct($mime_cache='/usr/share/mime/mime.cache')
     {
-        if ($mime_cache === null)
-        {
-            if (defined('Config::MIME_CACHE_PATH'))
-            {
-                $mime_cache = Config::MIME_CACHE_PATH;
-            }
-            else
-            {
-                $mime_cache = '/usr/share/mime/mime.cache';
-            }
-        }
         if (!is_readable($mime_cache))
         {
-            throw new Exception('unable to read mime.cache file');
+            throw new Exception('unable to read '.$mime_cache);
         }
-        
+
         $this-&gt;cache = file_get_contents($mime_cache);
         $this-&gt;version = sprintf('%d.%d', $this-&gt;uint16_at(0), $this-&gt;uint16_at(2));
 </diff>
      <filename>include/mime.class.php</filename>
    </modified>
    <modified>
      <diff>@@ -85,7 +85,7 @@ class WikiPage
             return NULL;
         if (!$this-&gt;mime_type)
         {
-            $mime = new MIME;
+            $mime = new MIME(Config::MIME_CACHE_PATH);
             $this-&gt;mime_type = $mime-&gt;bufferGetType($this-&gt;object-&gt;data, $this-&gt;getName());
         }
         return $this-&gt;mime_type;</diff>
      <filename>include/wikipage.class.php</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>0969cfe74824516770ec61e4c256e4a7ec68e95a</id>
    </parent>
  </parents>
  <author>
    <name>Patrik Fimml</name>
    <email>patrik@fimml.at</email>
  </author>
  <url>http://github.com/patrikf/ewiki/commit/7ee81089153a8f8c4050efd8b70c4e9846dc1018</url>
  <id>7ee81089153a8f8c4050efd8b70c4e9846dc1018</id>
  <committed-date>2009-07-03T15:04:28-07:00</committed-date>
  <authored-date>2009-07-03T14:58:11-07:00</authored-date>
  <message>Handle alternative mime.cache location outside MIME class

This way, the MIME class is easier to reuse.</message>
  <tree>91b4c7ce82bed188f3f1b2918a56acbfdd4ed4f1</tree>
  <committer>
    <name>Patrik Fimml</name>
    <email>patrik@fimml.at</email>
  </committer>
</commit>
