<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <HTML ><HEAD ><TITLE >Mimetype Functions</TITLE ><META NAME="GENERATOR" CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK REL="HOME" TITLE="Manual PHP" HREF="index.html"><LINK REL="UP" TITLE="Documentaþia funcþiilor" HREF="funcref.html"><LINK REL="PREVIOUS" TITLE="mhash" HREF="function.mhash.html"><LINK REL="NEXT" TITLE="mime_content_type" HREF="function.mime-content-type.html"><META HTTP-EQUIV="Content-type" CONTENT="text/html; charset=ISO-8859-2"></HEAD ><BODY CLASS="reference" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#840084" ALINK="#0000FF" ><DIV CLASS="NAVHEADER" ><TABLE SUMMARY="Header navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TH COLSPAN="3" ALIGN="center" >Manual PHP</TH ></TR ><TR ><TD WIDTH="10%" ALIGN="left" VALIGN="bottom" ><A HREF="function.mhash.html" ACCESSKEY="P" >Înapoi</A ></TD ><TD WIDTH="80%" ALIGN="center" VALIGN="bottom" ></TD ><TD WIDTH="10%" ALIGN="right" VALIGN="bottom" ><A HREF="function.mime-content-type.html" ACCESSKEY="N" >Înainte</A ></TD ></TR ></TABLE ><HR ALIGN="LEFT" WIDTH="100%"></DIV ><DIV CLASS="reference" ><A NAME="ref.mime-magic" ></A ><DIV CLASS="TITLEPAGE" ><H1 CLASS="title" >LXI. Mimetype Functions</H1 ><DIV CLASS="PARTINTRO" ><A NAME="AEN59611" ></A ><DIV CLASS="section" ><H1 CLASS="section" ><A NAME="mime-magic.intro" >Introducere</A ></H1 ><DIV CLASS="warning" ><P ></P ><TABLE CLASS="warning" BORDER="1" WIDTH="100%" ><TR ><TD ALIGN="CENTER" ><B >Avertisment</B ></TD ></TR ><TR ><TD ALIGN="LEFT" ><P > This extension has been deprecated as the PECL extension <A HREF="http://pecl.php.net/package/fileinfo" TARGET="_top" >fileinfo</A > provides the same functionality (and more) in a much cleaner way. </P ></TD ></TR ></TABLE ></DIV ><P > The functions in this module try to guess the content type and encoding of a file by looking for certain <SPAN CLASS="emphasis" ><I CLASS="emphasis" >magic</I ></SPAN > byte sequences at specific positions within the file. While this is not a bullet proof approach the heuristics used do a very good job. </P ><P > This extension is derived from Apache mod_mime_magic, which is itself based on the <TT CLASS="filename" >file</TT > command maintained by Ian F. Darwin. See the source code for further historic and copyright information. </P ></DIV ><DIV CLASS="section" ><H1 CLASS="section" ><A NAME="mime-magic.requirements" >Necesitãþi</A ></H1 ><P >Aceste funcþii sunt disponibile ca pãrþi ale modulului standard care este întotdeauna disponibil.</P ></DIV ><DIV CLASS="section" ><H1 CLASS="section" ><A NAME="mime-magic.installation" >Instalare</A ></H1 ><P > You must compile PHP with the configure switch <VAR CLASS="option" >--with-mime-magic</VAR > to get support for mime-type functions. The extension needs a copy of the simplified <TT CLASS="filename" >magic</TT > file that is distributed with the Apache httpd. </P ><DIV CLASS="note" ><BLOCKQUOTE CLASS="note" ><P ><B >Notã: </B > The configure option has been changed from <VAR CLASS="option" >--enable-mime-magic</VAR > to <VAR CLASS="option" >--with-mime-magic</VAR > since PHP 4.3.2 </P ></BLOCKQUOTE ></DIV ><DIV CLASS="note" ><BLOCKQUOTE CLASS="note" ><P ><B >Notã: </B > This extension is not capable of handling the fully decorated <TT CLASS="filename" >magic</TT > file that generally comes with standard Linux distro's and is supposed to be used with recent versions of <TT CLASS="filename" >file</TT > command. </P ></BLOCKQUOTE ></DIV ><DIV CLASS="note" ><BLOCKQUOTE CLASS="note" ><P ><B >Note to Win32 Users: </B > In order to use this module on a Windows environment, you must set the path to the bundled <TT CLASS="filename" >magic.mime</TT > file in your <TT CLASS="filename" >php.ini</TT >. </P ><P > <TABLE WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" CLASS="EXAMPLE" ><TR ><TD ><DIV CLASS="example" ><A NAME="AEN59643" ></A ><P ><B >Exemplu 1. Setting the path to <TT CLASS="filename" >magic.mime</TT ></B ></P ><TABLE BORDER="0" BGCOLOR="#E0E0E0" CELLPADDING="5" ><TR ><TD ><PRE CLASS="programlisting" >mime_magic.magicfile = "$PHP_INSTALL_DIR\magic.mime"</PRE ></TD ></TR ></TABLE ></DIV ></TD ></TR ></TABLE > </P ><P > Remember to substitute the <TT CLASS="filename" >$PHP_INSTALL_DIR</TT > for your actual path to <VAR CLASS="literal" >PHP</VAR > in the above example. e.g. <TT CLASS="filename" >c:\php</TT > </P ></BLOCKQUOTE ></DIV ></DIV ><DIV CLASS="section" ><H1 CLASS="section" ><A NAME="mime-magic.configuration" >Configurare la rulare</A ></H1 ><P > The behaviour of these functions is affected by settings in <TT CLASS="filename" >php.ini</TT >. </P ><P > <DIV CLASS="table" ><A NAME="AEN59656" ></A ><P ><B >Tabel 1. Mimetype configuration options</B ></P ><TABLE BORDER="1" CLASS="CALSTABLE" ><COL><COL><COL><THEAD ><TR ><TH >Name</TH ><TH >Default</TH ><TH >Changeable</TH ></TR ></THEAD ><TBODY ><TR ><TD >mime_magic.magicfile</TD ><TD >"/usr/share/misc/magic.mime"</TD ><TD >PHP_INI_SYSTEM</TD ></TR ></TBODY ></TABLE ></DIV > For further details and definition of the PHP_INI_* constants see <A HREF="function.ini-set.html" ><B CLASS="function" >ini_set()</B ></A >. </P ></DIV ><DIV CLASS="section" ><H1 CLASS="section" ><A NAME="mime-magic.resources" >Tipuri de resurse</A ></H1 ><P >Aceastã extensie nu defineºte tipuri de resurse.</P ></DIV ><DIV CLASS="section" ><H1 CLASS="section" ><A NAME="mime-magic.constants" >Constante predefinite</A ></H1 ><P >Aceastã extensie nu defineºte constante.</P ></DIV ></DIV ><DIV CLASS="TOC" ><DL ><DT ><B >Cuprins</B ></DT ><DT ><A HREF="function.mime-content-type.html" >mime_content_type</A > -- Detect MIME Content-type for a file</DT ></DL ></DIV ></DIV ></DIV ><DIV CLASS="NAVFOOTER" ><HR ALIGN="LEFT" WIDTH="100%"><TABLE SUMMARY="Footer navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" ><A HREF="function.mhash.html" ACCESSKEY="P" >Înapoi</A ></TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="index.html" ACCESSKEY="H" >Acasã</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" ><A HREF="function.mime-content-type.html" ACCESSKEY="N" >Înainte</A ></TD ></TR ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" >mhash</TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="funcref.html" ACCESSKEY="U" >Sus</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" >mime_content_type</TD ></TR ></TABLE ></DIV ></BODY ></HTML >