AW: [PEAR-DEV] Reading PDF meta
| From: | Christoph Lütjen - webEdition Software GmbH | Date: | Wed, 28 Dec 2005 02:08:19 +0000 |
| Subject: | AW: [PEAR-DEV] Reading PDF meta | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-40842@lists.php.net to get a copy of this message | ||
Hi,
Problems:
- there may be different drivers fort the same mime type
- a driver could be responsible for different mime types
So I suggest, that I'll do the following:
- Folder "Driver" stores drivers like Id3.php, Exiff.php, Pdf.php
- Folder "Type" stores one file per mime type as formally suggested in the
"Driver" folder. This class should extend an existing driver.
This way the following things are possible:
- there's an easy auto detection, that should work in most cases and bases
on the mime type of the file.
- users can specify the driver that should be used manually.
- there could be something like "Xmlcommon.php" as driver, that will be
extended for different xml formats.
Thanks for feedback!
Chris
-----Ursprüngliche Nachricht-----
Von: Christoph Lütjen - webEdition Software GmbH
[mailto:christoph.luetjen@webedition.de]
Gesendet: Mittwoch, 28. Dezember 2005 01:06
An: 'Philippe Jausions'; 'Markus Tacker'
Cc: pear-dev@lists.php.net
Betreff: AW: [PEAR-DEV] Reading PDF meta
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
--
PEAR Development Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php