Introducción
The functions in this module try to guess the content type
and encoding of a file by looking for certain
magic byte sequences at specific
positions within the file_ While this is not a bullet proof
approach the heuristics used do a very good job_
This extension is derivated from Apache mod_mime_magic,
which is itself based on the file
command maintaind by Ian F_ Darwin_ See the source code for
further historic and copyright information_
Requerimientos
No se necesitan bibliotecas externas
para construir esta extensión
Instalación
You must compile PHP with the configure switch
__with_mime_magic to get support for
mime_type functions_ The extension needs a copy of the simplified
magic file that is distributed with the Apache httpd_
Nota:
The configure option has been changed from
__enable_mime_magic
to __with_mime_magic since PHP 4_3_2
Nota:
This extension is not capable of handling the fully decorated
magic file that generally comes with
standard Linux distro's and is supposed to be used with
recent versions of file command_
Note to Win32 Users:
In order to use this module on a Windows environment, you must set the path
to the bundeld magic_mime file in your php_ini_
Ejemplo 1_ Setting the path to magic_mime mime_magic_magicfile ="$PHP_INSTALL_DIR\magic_mime" |
|
Remember to substitute the $PHP_INSTALL_DIR for your actual
path to PHP in the above example_ e_g_
c:\php
Configuración en tiempo de
ejecución
El comportamiento de estas
funciones está afectado por los valores definidos en
php_ini_
Tabla 1_ Mimetype configuration options
| Name | Default | Changeable |
|---|
| mime_magic_magicfile | "/usr/share/misc/magic_mime" | PHP_INI_SYSTEM |
For further details and definition of the PHP_INI_* constants see
ini_set()_
Tipos de recursos
Esta extensión no tiene
ningún tipo de recurso definido_
Constantes predefinidas
Esta extensión no tiene ninguna
constante definida_