/** * Pretty-print the checked out copy, using the * Horde::Mime::Viewer package. * * @param string $mime_type File extension of the checked out file * @param resource fp File pointer to the head of the checked out copy * @return object The MIME_Viewer object which can be rendered or * false on failure */ function &pretty($mime_type, $fp) { $lns = ''; while ($ln = fread($fp, 8192)) { $lns .= $ln; } $mime =& new MIME_Part($mime_type, $lns); return MIME_Viewer::factory($mime); }