AW: [PEAR-DEV] Reading PDF meta

From: Date: Wed, 28 Dec 2005 00:06:03 +0000
Subject: AW: [PEAR-DEV] Reading PDF meta
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-40841@lists.php.net to get a copy of this message
Hi, > Possibly several drivers could be available for one given format > depending on the system the package is installed on. This could somehow > make things more complicated since you would now have a matrix of > driver/format. .. and some file formats may have multiple mime types. Imho a matrix must be something that's hard coded in the main class and I would like to avoid doing that (sounds like really bad English, sorry... ;-) My idea was, to create a dummy class (and file) if necessary that extends the real driver (if one driver handles different MIME types). It would be possible to split the "Driver" folder in something like this: Driver/Common/Image/Png.php and Driver/[OS]/Image/Png.php. Now we would have to check if there's a driver in os specific folder, if not use driver from "Common" folder. This wouldn't be good for performance but normally meta data will be extracted one time and stored in another place after this, so it should be no problem if it's a bit slower. The other question is, if it's really the best to base the drivers on mime types. The idea was because... - mime types are the most common standard to specify file format - there's a class in PEAR to detect the mime type, so it should be easy to select the matching driver. > Furthermore, this would need more flexibility, as Driver would refer to > the tool used, and "Format" would refer to the type of data itself. Ok, "Format" is better than "Driver", what about "Type" (the file/class specifies the MIME type)? Thanks for your feedback! Chris -----Ursprüngliche Nachricht----- Von: Philippe Jausions [mailto:Philippe.Jausions@11abacus.com] Gesendet: Mittwoch, 28. Dezember 2005 00:27 An: Markus Tacker Cc: Christoph Lütjen - webEdition Software GmbH; pear-dev@lists.php.net Betreff: Re: [PEAR-DEV] Reading PDF meta Markus Tacker wrote: > Hoi Chris, > > On 12/27/05, Christoph Lütjen - webEdition Software GmbH > <christoph.luetjen@webedition.de> wrote: > >>/File/Meta/Drivers/image/jpeg.php (folder "Drivers" has one file per >>file/class per file format, file name = name of mime type) > > > Please use ucfirst(strtolower($str)) for all your file / directory names. > Given he wants to base drivers on MIME-type names, all-lowercase is better here, since this is the convention for them. The PEAR manual states "Class names **should** always begin with an uppercase" and not **must**. However the path to the drivers would be File/Meta/Driver/image/jpeg (not Drivers.) Furthermore, this would need more flexibility, as Driver would refer to the tool used, and "Format" would refer to the type of data itself. Possibly several drivers could be available for one given format depending on the system the package is installed on. This could somehow make things more complicated since you would now have a matrix of driver/format. -Philippe

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