PHPackages                             dilone/vcard - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. dilone/vcard

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

dilone/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.

089PHP

Since Sep 16Pushed 5y agoCompare

[ Source](https://github.com/dilone/vcard)[ Packagist](https://packagist.org/packages/dilone/vcard)[ RSS](/packages/dilone-vcard/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependenciesVersions (1)Used By (0)

\[WIP\] VCard library
=====================

[](#wip-vcard-library)

> This VCard PHP class can generate a vCard version 4.0. .vcf file with one or more vCards in it. Parsing is also possible. OOP is our goal-focus, so every property has its own class.

Documentation about vCard 4.0:

- [vCard 4.0 specification: RFC6350](https://tools.ietf.org/html/rfc6350)

Installation
------------

[](#installation)

```
composer require dilone/vcard
```

> This will install the 2.0 WIP development version of vcard with [Composer](https://getcomposer.org)

Examples
--------

[](#examples)

Since this is a WIP, we refer to the [test class](tests/VCardTest.php) to view multiple examples.

### Basic example

[](#basic-example)

```
use Dilone\VCard\VCard;
use Dilone\VCard\Property\Name;
use Dilone\VCard\Formatter\Formatter;
use Dilone\VCard\Formatter\VcfFormatter;

$lastname = "Doe";
$firstname = "Jhon";
$additional = "";
$prefix = "Mr.";
$suffix = "";

$vcard = new VCard();
$vcard->add(new Name($lastname, $firstname, $additional, $prefix, $suffix));

$formatter = new Formatter(new VcfFormatter(), 'vcard-export');
$formatter->addVCard($vcard);
$formatter->download();
```

Properties
----------

[](#properties)

### Identification Properties:

[](#identification-properties)

- [FN = Full name](./src/Property/FullName.php) - The full name of the object (as a single string). This is the only mandatory property.
- [N = Name](./src/Property/Name.php) - The name of the object represented in structured parts
- [NICKNAME](./src/Property/Nickname.php) - A nickname for the object
- [PHOTO](./src/Property/Photo.php)
- [BDAY](./src/Property/Birthdate.php) - Birth date of the object. Should only apply to Individual
- [ANNIVERSARY](./src/Property/Anniversary.php) - Should only apply to Individual
- [GENDER](./src/Property/Gender.php) - Should only apply to Individual

### Delivery Addressing Properties:

[](#delivery-addressing-properties)

- [ADDRESS](./src/Property/Address.php) - The address of the object represented in structured parts

### Communications Properties:

[](#communications-properties)

- [TEL](./src/Property/Telephone.php) - The telephone number(s) as a tel URI
- [EMAIL](./src/Property/Email.php) - The email address(es) as a mailto URI
- IMPP - The IMPP instant messaging contact information
- LANG - The language of the object

### Geographical Properties:

[](#geographical-properties)

- TZ - The timezone of the object
- GEO - The geographical coordinates of the object (geo URI)

### Organizational Properties:

[](#organizational-properties)

- [TITLE](./src/Property/Title.php) - The title of the object
- ROLE - The role of the object
- [LOGO](./src/Property/Logo.php) - The logo of the object (data URI)
- ORG - The organisation related to the object
- ORGUNIT - The organisational unit related to the object
- MEMBER - Can only be used for Group Kind objects. Must point to other Individual or Organization objects.
- RELATED - Link to related objects.

### Explanatory Properties:

[](#explanatory-properties)

- CATEGORIES - The categories of the object
- [NOTE](./src/Property/Note.php) - Notes about the object
- PRODID - The identifier of the product that created the vCard object
- [REV](./src/Property/Parameter/Revision.php) - The revision datetime of the vCard object
- SOUND - Audio related to the object (data URI)
- UID - A unique identifier for the object
- CLIENTPIDMAP - Not required
- URL - Any URL related to the object
- [VERSION](./src/Property/Parameter/Version.php) - Is mandatory for 4.0

### Security Properties:

[](#security-properties)

- KEY - The security key of the object

### Calendar Properties:

[](#calendar-properties)

- FBURL - Calendar Busy Time of the object
- CALADURI - Calendar Request of the object
- CALURI - Calendar Link of the object

Documentation
-------------

[](#documentation)

The class is well documented inline. If you use a decent IDE you'll see that each method is documented with PHPDoc.

Contributing
------------

[](#contributing)

Contributions are **welcome** and will be fully **credited**.

### Pull Requests

[](#pull-requests)

> To add or update code

- **Coding Syntax** - Please keep the code syntax consistent with the rest of the package.
- **Add unit tests!** - Your patch won't be accepted if it doesn't have tests.
- **Document any change in behavior** - Make sure the README and any other relevant documentation are kept up-to-date.
- **Consider our release cycle** - We try to follow [semver](http://semver.org/). Randomly breaking public APIs is not an option.
- **Create topic branches** - Don't ask us to pull from your master branch.
- **One pull request per feature** - If you want to do more than one thing, send multiple pull requests.
- **Send coherent history** - Make sure each individual commit in your pull request is meaningful. If you had to make multiple intermediate commits while developing, please squash them before submitting.

### Issues

[](#issues)

> For bug reporting or code discussions.

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

### Coding Syntax

[](#coding-syntax)

We use [squizlabs/php\_codesniffer](https://packagist.org/packages/squizlabs/php_codesniffer) to maintain the code standards. Type the following to execute them:

```
# To view the code errors
vendor/bin/phpcs --standard=psr2 --extensions=php --warning-severity=0 --report=full "src"

# OR to fix the code errors
vendor/bin/phpcbf --standard=psr2 --extensions=php --warning-severity=0 --report=full "src"
```

> [Read documentation about the code standards](https://github.com/squizlabs/PHP_CodeSniffer/wiki)

### Unit Tests

[](#unit-tests)

We have build in tests, type the following to execute them:

```
vendor/bin/phpunit tests
```

Credits
-------

[](#credits)

- [Jeroen Desloovere](https://github.com/JeroenDesloovere)
- [All Contributors](https://github.com/JeroenDesloovere/vcard/contributors)

License
-------

[](#license)

The module is licensed under [MIT](./LICENSE.md). In short, this license allows you to do everything as long as the copyright statement stays present.

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity32

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/3513759?v=4)[Luiyi Dilone](/maintainers/dilone)[@dilone](https://github.com/dilone)

---

Top Contributors

[![dilone](https://avatars.githubusercontent.com/u/3513759?v=4)](https://github.com/dilone "dilone (1 commits)")

### Embed Badge

![Health badge](/badges/dilone-vcard/health.svg)

```
[![Health](https://phpackages.com/badges/dilone-vcard/health.svg)](https://phpackages.com/packages/dilone-vcard)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
