cvs: pear /File_IMC/docs sample.vcf sample.vcs vcalendar_parse_example.php vcard_build_example.php vcard_parse_example.php
| From: | Paul Jones | Date: | Thu, 13 Nov 2003 14:32:12 +0000 |
| Subject: | cvs: pear /File_IMC/docs sample.vcf sample.vcs vcalendar_parse_example.php vcard_build_example.php vcard_parse_example.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-14243@lists.php.net to get a copy of this message | ||
pmjones Thu Nov 13 09:32:12 2003 EDT
Added files:
/pear/File_IMC/docs sample.vcf sample.vcs
vcalendar_parse_example.php
vcard_build_example.php vcard_parse_example.php
Log:
created docs/ and tests/ directories
moved example files into docs/
Index: pear/File_IMC/docs/sample.vcf
+++ pear/File_IMC/docs/sample.vcf
BEGIN:VCARD
VERSION:3.0
N:Shagnasty;Bolivar;Odysseus;Mr.;III,B.S.
FN:Bolivar Shagnasty
ADR;TYPE=HOME,WORK:;;123 Main,Apartment 101;Beverly Hills;CA;90210
EMAIL;TYPE=HOME;TYPE=WORK:boshag@example.com
EMAIL;TYPE=PREF:boshag@ciaweb.net
BDAY:19950415
END:VCARD
BEGIN:VCARD
VERSION:3.0
N:Shagnasty;Bolivar;Odysseus;Mr.;III,B.S.
FN:Bolivar Shagnasty
ADR;TYPE=HOME,WORK:;;123 Main,Apartment 101;Beverly Hills;CA;90210
EMAIL;TYPE=HOME;TYPE=WORK:boshag@example.com
EMAIL;TYPE=PREF:boshag@ciaweb.net
BDAY:1995-04-15
END:VCARD
BEGIN:VCARD
VERSION:3.0
N:Shagnasty;Bolivar;Odysseus;Mr.;III,B.S.
FN:Bolivar Shagnasty
ADR;TYPE=HOME,WORK:;;123 Main,Apartment 101;Beverly Hills;CA;90210
EMAIL;TYPE=HOME;TYPE=WORK:boshag@example.com
EMAIL;TYPE=PREF:boshag@ciaweb.net
END:VCARD
Index: pear/File_IMC/docs/sample.vcs
+++ pear/File_IMC/docs/sample.vcs
BEGIN:VCALENDAR
VERSION:1.0
BEGIN:VEVENT
SUMMARY:New Volunteer Orientation
DESCRIPTION;ENCODING=QUOTED-PRINTABLE:Interested in becoming a volunteer for the Sacramento SPCA?
We'd love to have you join our team! Please download a volunteer application from this website,
and when you mail it in, indicate that you'd like to attend this
orientation.=0D=0A=0D=0AContact Dee Dee Drake for more information.
DTSTART:20020925T010000Z
DTEND:20020925T020000Z
END:VEVENT
BEGIN:VEVENT
SUMMARY:Test Event 2
DESCRIPTION:Blah blah blah! This one doesn't have any linebreaks, so it's not
quoted-printable
DTSTART:20020925T010000Z
DTEND:20020925T020000Z
END:VEVENT
BEGIN:VEVENT
SUMMARY:Test Event 3
DESCRIPTION;ENCODING=QUOTED-PRINTABLE:Lorem ipsum dolor sit amet!
DTSTART:20020925T010000Z
DTEND:20020925T020000Z
END:VEVENT
END:VCALENDAR
Index: pear/File_IMC/docs/vcalendar_parse_example.php
+++ pear/File_IMC/docs/vcalendar_parse_example.php
<?php
require_once 'File/IMC.php';
$parse = File_IMC::parse('vCalendar');
// parse a vCard file and store the data
// in $cardinfo
$calinfo = $parse->fromFile('sample.vcs');
// view the card info array
echo '<pre>';
print_r($calinfo);
echo '</pre>';
?>
Index: pear/File_IMC/docs/vcard_build_example.php
+++ pear/File_IMC/docs/vcard_build_example.php
<?php
/* vim: set expandtab tabstop=4 softtabstop=4 shiftwidth=4: */
// +----------------------------------------------------------------------+
// | PHP version 4 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2002 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.0 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/2_02.txt.
|
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Authors: Paul M. Jones <pmjones@ciaweb.net> |
// | Marshall Roch <mroch@php.net> |
// +----------------------------------------------------------------------+
//
// $Id: vcard_build_example.php,v 1.1 2003/11/13 14:32:12 pmjones Exp $
// include the class file
require_once 'File/IMC.php';
// instantiate a builder object
// (defaults to version 3.0)
$vcard = File_IMC::build('vCard');
// set a formatted name
$vcard->setFormattedName('Bolivar Shagnasty');
// set the structured name parts
$vcard->setName('Shagnasty', 'Bolivar', 'Odysseus',
'Mr.', 'III');
// add a work email. note that we add the value
// first and the param after -- Contact_Vcard_Build
// is smart enough to add the param in the correct
// place.
$vcard->addEmail('boshag@example.com');
$vcard->addParam('TYPE', 'WORK');
// add a home/preferred email
$vcard->addEmail('bolivar@example.net');
$vcard->addParam('TYPE', 'HOME');
$vcard->addParam('TYPE', 'PREF');
// add a work address
$vcard->addAddress('POB 101', 'Suite 202', '123 Main',
'Beverly Hills', 'CA', '90210', 'US');
$vcard->addParam('TYPE', 'WORK');
// get back the vCard and print it
$text = $vcard->fetch();
echo '<pre>';
print_r($text);
echo '</pre>';
?>
Index: pear/File_IMC/docs/vcard_parse_example.php
+++ pear/File_IMC/docs/vcard_parse_example.php
<?php
/* vim: set expandtab tabstop=4 softtabstop=4 shiftwidth=4: */
// +----------------------------------------------------------------------+
// | PHP version 4 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2002 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.0 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/2_02.txt.
|
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Authors: Paul M. Jones <pmjones@ciaweb.net> |
// | Marshall Roch <mroch@php.net> |
// +----------------------------------------------------------------------+
//
// $Id: vcard_parse_example.php,v 1.1 2003/11/13 14:32:12 pmjones Exp $
require_once 'File/IMC.php';
// create vCard parser
$parse = File_IMC::parse('vCard');
// parse a vCard file and store the data in $cardinfo
$cardinfo = $parse->fromFile('sample.vcf');
// view the card info array
echo '<pre>';
print_r($cardinfo);
echo '</pre>';
?>