vcard icon indicating copy to clipboard operation
vcard copied to clipboard

Support parsing additional elements

Open andig opened this issue 6 years ago • 4 comments

In https://github.com/andig/carddav2fb/blob/master/src/Vcard/Parser.php#L259 we need to parse additional elements generated by AVM Fritz!Boxes. Currently, since parse() is such a monster function it is not extensible without basically duplicating the entire code.

Would you be open for a PR to a) either support a simple callback function or something like parseRemainingElements() or b) move the entire parse() function into its own LineParser class?

Asking upfront as I can see there's a number of unanswered PRs.

andig avatar Jan 12 '19 15:01 andig

There is a new version of the code being made on the 2.0.0-dev branch, would this fit your needs?

to-be-the-best avatar Mar 03 '19 15:03 to-be-the-best

Not really sure where to look for extensibility. Could you point to a specific file in 2.0?

andig avatar Mar 03 '19 20:03 andig

Which kind of 'additional' elements are you looking for of vcard?

melroy89 avatar Mar 08 '19 20:03 melroy89

The use case is having carddav server store custom, non-standard attributes, e.g. for vanity and quick-dial phone numbers. Those are converted and transferred to Fritzbox/FritzFron devices. We're using X-QUICKDIAL and X-VANITY. The parser could allow to call a custom parser extension for unknown attributes (using a proper interface or be restructured to allow easier subclassing).

andig avatar Mar 09 '19 09:03 andig