Re: package proposal: MIME_ContentType

From: Date: Sun, 15 Jun 2003 01:11:08 +0000
Subject: Re: package proposal: MIME_ContentType
References: 1 2  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-17474@lists.php.net to get a copy of this message
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Friday 13 June 2003 05:00 pm, Ondrej Jombik wrote: > On Wed, 11 Jun 2003, Ian Eure wrote: > > MIME_ContentType is a PEAR package for looking up a file's mimetype. > > Features: > > * Uses the system's mime database (/etc/mime.types) by default > > * Can find the mime-type for a file extension. (forward lookup) > > * Can find valid extensions for a mime-type (backward lookup) > > * MIME types may be added and removed. > > * New mime.types file may be written containing all the types > > MIME_ContentType knows about. > > Am I right that this class brings `file' UNIX command functionality > into PHP? > No. `file' (at least GNU file; I haven't used any other) examines a file's contents and returns a textual description of them, e.g.: ieure!heliodor:~$ file /bin/ls /bin/ls: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), stripped MIME_ContentType will tell you the mime-type for a given file extension, or show you valid file extensions for a given mime-type. Perhaps packages like this should go into a new section, Meta. There are a number of kinds of metadata associated with files other than mime-types. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE+68exHJcvLJR6wWoRAmgxAKDUPKtloDp9kGyubrrD/R3DIR8WEQCdEpRG uE04SNkOX8UOEqbo5Rtt1Dg= =nbVv -----END PGP SIGNATURE-----

« previous php.pear.dev (#17474) next »