Location: PHPKode > projects > mediaIndex > docs/ch04s03.html
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Media Type Binding</title><link rel="stylesheet" href="style.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.48"><link rel="home" href="index.html" title="MediaIndexer Document Management System"><link rel="up" href="ch04.html" title="Chapter 4. Under The Hood"><link rel="previous" href="ch04s02.html" title="File Handlers"><link rel="next" href="ch04s04.html" title="Includable Templates"></head><body text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Media Type Binding</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch04s02.html">Prev</a> </td><th width="60%" align="center">Chapter 4. Under The Hood</th><td width="20%" align="right"> <a accesskey="n" href="ch04s04.html">Next</a></td></tr></table><hr></div><div class="sect1"><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="id2770890"></a>Media Type Binding</h2></div></div><div class="figure"><p><b>Figure 4.3. Group / Handler Relationship Diagram</b></p><p><img src="../img/mdx-dia.png"></p></div><p>Here we associate the groups that individual file handlers
        belong to.  For example, if you have separate handlers for MP3 files
        and WAV files, they both would belong to the <span class="emphasis"><i>Music</i></span> 
        group.</p><div class="figure"><p><b>Figure 4.4. File Handler / Media Group Associations</b></p><pre class="programlisting">
        $_MAPPING[_HANDLER_DEFAULT]  = _GROUP_DEFAULT;
        $_MAPPING[_HANDLER_ARCHIVE]  = _GROUP_DOWNLOADS;
        $_MAPPING[_HANDLER_CODE]     = _GROUP_TEXTFILES;
        $_MAPPING[_HANDLER_TEXT]     = _GROUP_TEXTFILES;
      </pre></div><p>You may associate filenames with file handlers using filename pattern matching.
        For example, all files matching the pattern *.tar.gz with the <span class="emphasis"><i>Archive
        Handler</i></span> and files matching *.c are handled by the <span class="emphasis"><i>Code
        Handler</i></span>.</p><div class="figure"><p><b>Figure 4.5. File Pattern / File Handler Associations</b></p><pre class="programlisting">
        $_PATTERNS['*.txt']   = _HANDLER_TEXT;
        $_PATTERNS['*.gz']    = _HANDLER_GZFILE;
        $_PATTERNS['*.tgz']   = _HANDLER_ARCHIVE;
      </pre></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch04s02.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ch04.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ch04s04.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">File Handlers </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Includable Templates</td></tr></table></div></body></html>
Return current item: mediaIndex