Re: [PROPOSAL] File_IMC
| From: | Paul M Jones | Date: | Thu, 25 Sep 2003 23:35:06 +0000 |
| Subject: | Re: [PROPOSAL] File_IMC | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-22047@lists.php.net to get a copy of this message | ||
Hi, Jan,
It would be great to have such a package in PEAR if it's complete and well designed. I know from my own experience that it is no trivial task to properly parse these different formats, even if they look that similar, without too much redundant code.You are correct; although it looks like it should be easy, it is very difficult to parse the vCard and vCal formats. However, I believe we have the worst part of it behind us -- that is, the line parser that splits individual lines into their component parts: group, type-definition, parameters, and line-value (which may be structured, repeated, or both). That code is already in Contact_Vcard_Parse, which File_IMC will make use of to parse IMC files. (Incidentally, you will see the level of our commitment to commenting in the Contact_Vcard packages; the detailed comments make a difficult process more easy to understand.) Of course, now we need to parse the individual parts of the various IMC event types, but that becomes an issue of returning results in an appropriate structure. Contact_Vcard has an uses extensible structure that lends itself to this kind of work (basically a multiple-depth associative array).
I'd happily drop our imc code if yours prove to be more mature. Meanwhile you might want to take a look at it to steal some inspiration or code snippets.We are always open to building on the work of others, since we are basically lazy and want glory without effort. ;-) Can you point us to some sources? We'll count this as positive feedback. Thanks. :-) -- pmj