summaryrefslogtreecommitdiff
path: root/ext/mime_magic/DEPRECATED
diff options
context:
space:
mode:
authorSVN Migration <svn@php.net>2006-10-15 21:09:28 +0000
committerSVN Migration <svn@php.net>2006-10-15 21:09:28 +0000
commit88ec761548b66f58acc1a86cdd0fc164ca925476 (patch)
treed0af978fa00d83bb1d82c613f66477fbd6bb18aa /ext/mime_magic/DEPRECATED
parent268984b4787e797db6054313fc9ba3b9e845306e (diff)
downloadphp-git-PECL_OPENSSL.tar.gz
This commit was manufactured by cvs2svn to create branch 'PECL_OPENSSL'.PECL_OPENSSL
Diffstat (limited to 'ext/mime_magic/DEPRECATED')
-rw-r--r--ext/mime_magic/DEPRECATED36
1 files changed, 0 insertions, 36 deletions
diff --git a/ext/mime_magic/DEPRECATED b/ext/mime_magic/DEPRECATED
deleted file mode 100644
index d4d42e6f92..0000000000
--- a/ext/mime_magic/DEPRECATED
+++ /dev/null
@@ -1,36 +0,0 @@
-This extension is deprecated, please use the fileinfo extension
-from PECL instead.
-
-Back when i implemented mime_magic there was no library interface
-to the file utilities functionality. The only way to get the
-functionality in place was to get the file sources and replace
-the input and output routines within with code interfacing to
-your own stuff. This work was originally done by the developers
-of apache mod_magic, the mime_magic extension just replaced the
-apache specific parts with their PHP counterparts.
-
-Now that the codebase of the file utilities is cleanly devided
-into the libmagic library and the file utility built upon it
-the original hack is no longer needed. Using libmagic and the
-fileinfo extension does not only provide a cleaner interface
-to files functionality but also additional functionality so
-that theres no reason to keep around mime_magic anymore.
-
-To keep existing code originaly coded for mime_magic without
-changes you may add the following compatibility wrapper function
-to your codebase:
-
-function mime_content_type($file) {
- static $finfo = false;
-
- if ($finfo === false) {
- $finfo = finfo_open(MAGIC_MIME);
- }
-
- if (is_resource($file)) {
- $buf = fread($fp, 65536);
- return finfo_buffer($buf);
- } else {
- return finfo_file($file);
- }
-} \ No newline at end of file