Re: Package Proposal: Vcard_Parse
| From: | Bertrand Mansion | Date: | Tue, 18 Mar 2003 08:26:20 +0000 |
| Subject: | Re: Package Proposal: Vcard_Parse | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-14387@lists.php.net to get a copy of this message | ||
<pjones@ciaweb.net> wrote :
> Hi, all,
>
> I propose a new PEAR package to parse vCards into a structured array.
> Developers can then do what they like with the data (e.g., insert into
> a table). Not sure where this class would go in the PEAR hierarchy
> (Structures? Tools & Utilities? perhaps Mail?).
>
> You can download the class file and view instructions here:
>
> http://ciaweb.net/free/vcard_parse/
>
> Example usage:
>
> require_once 'Vcard_Parse.class.php';
> $parse = new Vcard_Parse();
>
> // parse from a file
> $cards = $parse->fromFile('address.vcf');
> print_r($cards);
>
> // parse from a block of text
> $cards = $parse->fromText($text);
> print_r($cards);
>
> Thanks in advance for your comments and criticism.
>
> Cheers,
>
> Paul M. Jones
Hi Paul,
It would be nice if you add two things:
1. Remove the invisible chars in the MacOSX address book vcards
automatically (you can use str_replace() with chr() and ord() to do that).
2. Create a writer in complement to the parser.
Other names for your class could be :
Contact_vCard_Parser
Contact_vCard_Writer
or simply Contact_vCard if you implement both in the same class (recommended
way)
Or Address_vCard
As we already have a Genealogy_Gedcom.
Then, it might fit in the file formats category on pear website.
I haven't reviewed your code yet.
Bertrand Mansion
Mamasam