Re: Package Proposal: Vcard_Parse

From: Date: Tue, 18 Mar 2003 16:19:42 +0000
Subject: Re: Package Proposal: Vcard_Parse
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-14400@lists.php.net to get a copy of this message
Hi, Bertrand,
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).
I agree that it would be nice. :-) However, I'm having trouble getting file() to even *read* the .vcf file generated by my mac OS X Address Book app (but it appears only Mac at work generates those extra chars -- beginning to wonder if it's a phenomenon specific to the work installation, not to Address Book in general).
2. Create a writer in complement to the parser.
Am working on that now, in conjunction with a vCard "contacts" sub-application for my Phorecast project. It'll probably be a separate class, as there are good vCard-writers out there now, and choice is good.
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 think File Formats is going to be the proper category. The only problem will be the super-prefix (Whatever_Vcard_Parse) for the class. In reference to the RFC2426, which defines the vCard format... The schema is based on the attributes for the person object defined in the X.520 and X.521 directory services recommendations. The schema has augmented the basic attributes defined in the X.500 series recommendation in order to provide for an electronic representation of the information commonly found on a paper business card. This schema was first defined in the [VCARD] document. Hence, this [MIME- DIR] profile is referred to as the vCard MIME Directory Profile. ...perhaps the super-prefix should be X500 so that other X500-derived classes can fit within the same naming convention? E.g., instead of Contact_Vcard_* or Address_Vcard_* it could be X500_Vcard_*. Unless that's too inelegant.
I haven't reviewed your code yet.
I look forward to your comments and criticism. BTW, I left a var_print() debugging line in fromText() yesterday; have uploaded a new version that removes this line. Sorry for any trouble this might have caused. -- pmj

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