seec/vcard

This VCard PHP class can generate a vCard with some data. When using an iOS device it will export as a .ics file because iOS devices don't support the default .vcf files.

8.3.1 2024-01-08 23:05 UTC

This package is auto-updated.

Last update: 2024-04-08 23:45:16 UTC


README

Latest Stable Version License Test Pipeline

This VCard PHP library can generate a vCard with some data. When using an iOS device < iOS 8 it will export as a .ics file because iOS devices don't support the default .vcf files.

Usage

Installation

composer require seec/vcard

This will install the latest version of vcard with Composer

Example

View all examples or check the VCard class.

Parsing examples

The parser can either get passed a VCard string, like so:

// load VCardParser classes
use SEEC\VCard\VCardParser;

$parser = new VCardParser($vcardString);
echo $parser->getCardAtIndex(0)->fullname; // Prints the full name.

Or by using a factory method with a file name:

$parser = VCardParser::parseFromFile('path/to/file.vcf');
echo $parser->getCardAtIndex(0)->getName(); // Prints the full name.

View the parsing example or check the the VCardParser class class.

Documentation

The goal is to use no comments at all in the code. Since this is a fork, some things might not be as straight forward as one could wish for. Feel free to refactor old stuff and add it via a new PR!

More info on how to work with GitHub on help.github.com.

Development

In order to run the development instance of this repository, you can very easily utilize the shipped docker-compose package.

docker compose up --build

Afterwards you will have an instance with PHP8.2q running that you can use to develop your changes. Xdebug is enabled by default, so you can use your IDE to debug the code.

Credits

License

The module is licensed under MIT. In short, this license allows you to do everything as long as the copyright statement stays present.