{"id":22640690,"url":"https://github.com/beastbytes/vcard","last_synced_at":"2025-03-29T05:25:37.963Z","repository":{"id":65694099,"uuid":"597537612","full_name":"beastbytes/vcard","owner":"beastbytes","description":"Create and import vCards","archived":false,"fork":false,"pushed_at":"2023-06-26T13:53:54.000Z","size":12,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-03T15:55:01.055Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/beastbytes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-02-04T21:07:48.000Z","updated_at":"2023-02-04T21:07:57.000Z","dependencies_parsed_at":"2025-02-03T15:51:10.758Z","dependency_job_id":"8c94f7c2-7fbf-4520-bcbd-80383137bbbc","html_url":"https://github.com/beastbytes/vcard","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beastbytes%2Fvcard","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beastbytes%2Fvcard/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beastbytes%2Fvcard/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beastbytes%2Fvcard/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/beastbytes","download_url":"https://codeload.github.com/beastbytes/vcard/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246143296,"owners_count":20730237,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-09T04:13:16.777Z","updated_at":"2025-03-29T05:25:37.923Z","avatar_url":"https://github.com/beastbytes.png","language":"PHP","readme":"# vCard\nThe vCard library provides the ability to create\n[vCard (RFC 6350)](https://datatracker.ietf.org/doc/html/rfc6350) strings.\n\n## Creating vCard files\nThe vCard library allows creation of vCards in an object-oriented way.\n\nThe library provides class constants to provide code completion and improve code readability.\n\nTo create a vCard, create a new Vcard object then add properties to it; multiple properties with the same name are supported.\n\nProperties that comprise multiple fields delimited by a SEMICOLON character (e.g., N and ADR) can be specified as array; empty fields **must** be given. If a property field is a list it may be specified as an array.\n\nThe following are equivalent:\n```php\n-\u003eaddProperty(\n    Vcard::PROPERTY_N,\n    'Perreault;Simon;;;ing. jr,M.Sc.'\n)\n```\n```php\n-\u003eaddProperty(\n    Vcard::PROPERTY_N,\n    [\n        'Perreault',\n        'Simon',\n        '',\n        '',\n        'ing. jr,M.Sc.'\n    ]\n)\n```\n\nProvide property parameters as an array where the key is the parameter name (hint: use class constants) and the value is the value; if the value is a list it may be specified as an array.  \n\nThe following are equivalent:\n```php\n[\n    Vcard::PARAMETER_VALUE =\u003e Vcard::VALUE_DATA_TYPE_URI,\n    Vcard::PARAMETER_TYPE =\u003e '\"' . Vcard::TYPE_WORK . ',' . Vcard::TYPE_VOICE . '\"',\n    Vcard::PARAMETER_PREF =\u003e 1\n]\n```\n```php\n[\n    Vcard::PARAMETER_VALUE =\u003e Vcard::VALUE_DATA_TYPE_URI,\n    Vcard::PARAMETER_TYPE =\u003e [\n        Vcard::TYPE_WORK,\n        Vcard::TYPE_VOICE\n    ],\n    Vcard::PARAMETER_PREF =\u003e 1\n]\n```\n\nFinally, call the Vcard's render() method.\n\n### Note\nThe library does **not** do any checking for validity; it is possible to create a string that is not a valid vCard. \n\n### Example\nThe following example creates the vCard at\n[section 8 of RFC6350](https://datatracker.ietf.org/doc/html/rfc6350#section-8).\n\n```php\n$vCard = (new Vcard())\n    -\u003eaddProperty(\n        Vcard::PROPERTY_FN,\n        'Simon Perreault'\n    )\n    -\u003eaddProperty(\n        Vcard::PROPERTY_N,\n        [\n            'Perreault',\n            'Simon',\n            '',\n            '',\n            'ing. jr,M.Sc.'\n        ]\n    )\n    -\u003eaddProperty(\n        Vcard::PROPERTY_BDAY,\n        '--0203'\n    )    \n    -\u003eaddProperty(\n        Vcard::PROPERTY_ANNIVERSARY,\n        '20090808T1430-0500'\n    )\n    -\u003eaddProperty(\n        Vcard::PROPERTY_GENDER,\n        Vcard::GENDER_MALE\n    )\n    -\u003eaddProperty(\n        Vcard::PROPERTY_LANG,\n        'fr',\n        [\n            Vcard::PARAMETER_PREF =\u003e 1\n        ]\n    )\n    -\u003eaddProperty(\n        Vcard::PROPERTY_LANG,\n        'en',\n        [\n            Vcard::PARAMETER_PREF =\u003e 2\n        ]\n    )\n    -\u003eaddProperty(\n        Vcard::PROPERTY_ORG,\n        'Viagenie',\n        [\n            Vcard::PARAMETER_TYPE =\u003e Vcard::TYPE_WORK\n        ]\n    )\n    -\u003eaddProperty(\n        Vcard::PROPERTY_ADR,\n        [\n            '',\n            'Suite D2-630',\n            '2875 Laurier',\n            'Quebec',\n            'QC',\n            'G1V 2M2',\n            'Canada'\n        ],\n        [\n            Vcard::PARAMETER_TYPE =\u003e Vcard::TYPE_WORK\n        ]\n    )\n    -\u003eaddProperty(\n        Vcard::PROPERTY_TEL,\n        'tel:+1-418-656-9254;ext=102',\n        [\n            Vcard::PARAMETER_VALUE =\u003e Vcard::VALUE_DATA_TYPE_URI,\n            Vcard::PARAMETER_TYPE =\u003e [\n                Vcard::TYPE_WORK,\n                Vcard::TYPE_VOICE\n            ],\n            Vcard::PARAMETER_PREF =\u003e 1\n        ]\n    )\n    -\u003eaddProperty(\n        Vcard::PROPERTY_TEL,\n        'tel:+1-418-262-6501',\n        [\n            Vcard::PARAMETER_VALUE =\u003e Vcard::VALUE_DATA_TYPE_URI,\n            Vcard::PARAMETER_TYPE =\u003e [\n                Vcard::TYPE_WORK,\n                Vcard::TYPE_CELL,\n                Vcard::TYPE_VOICE,\n                Vcard::TYPE_VIDEO,\n                Vcard::TYPE_TEXT\n            ],\n        ]\n    )\n    -\u003eaddProperty(\n        Vcard::PROPERTY_EMAIL,\n        'simon.perreault@viagenie.ca',\n        [Vcard::PARAMETER_TYPE =\u003e Vcard::TYPE_WORK]\n    )\n    -\u003eaddProperty(\n        Vcard::PROPERTY_GEO,\n        'geo:46.772673,-71.282945',\n        [\n            Vcard::PARAMETER_TYPE =\u003e Vcard::TYPE_WORK\n        ]\n    )\n    -\u003eaddProperty(\n        Vcard::PROPERTY_KEY,\n        'http://www.viagenie.ca/simon.perreault/simon.asc',\n        [\n            Vcard::PARAMETER_TYPE =\u003e Vcard::TYPE_WORK,\n            Vcard::PARAMETER_VALUE =\u003e Vcard::VALUE_DATA_TYPE_URI\n        ]\n    )\n    -\u003eaddProperty(Vcard::PROPERTY_TZ, '-0500')\n    -\u003eaddProperty(\n        Vcard::PROPERTY_URL,\n        'http://nomis80.org',\n        [\n            Vcard::PARAMETER_TYPE =\u003e Vcard::TYPE_HOME\n        ]\n    )\n    -\u003erender()\n;\n```\n\n## Import vCard\nImport an vCard file using Vcard's static import() method:\n\n```php\n$vcard = Vcard::import($string);\n```\n\n## Installation\nThe preferred way to install the library is with [composer](http://getcomposer.org/download/).\n\nEither run\n\n```\nphp composer.phar require --prefer-dist beastbytes/icalendar\n```\n\nor add\n\n```json\n\"beastbytes/vcard\": \"^1.0.0\"\n```\n\nto the 'require' section of your composer.json.\n\n## Testing\n### Unit testing\nThe package is tested with PHPUnit. To run the tests:\n\n```\n./vendor/bin/phpunit\n```\n\n### Static analysis\nThe code is statically analyzed with Psalm. To run static analysis:\n\n```\n./vendor/bin/psalm\n```\n\n## License\nThe vCard Library is free software. It is released under the terms of the BSD License. For license information see the [LICENSE](LICENSE.md) file.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbeastbytes%2Fvcard","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbeastbytes%2Fvcard","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbeastbytes%2Fvcard/lists"}