Skip to content

Commit

Permalink
changes in version 0.5.0, also added new support for Gmail addressbook
Browse files Browse the repository at this point in the history
  • Loading branch information
Firman Wandayandi committed Nov 8, 2005
1 parent 0e752cb commit 1b559ee
Show file tree
Hide file tree
Showing 14 changed files with 529 additions and 76 deletions.
1 change: 1 addition & 0 deletions Contact/AddressBook.php
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ class Contact_AddressBook
'csv_yahoo',
'csv_palm',
'csv_kmail',
'csv_gmail',
'eudora'
);

Expand Down
6 changes: 4 additions & 2 deletions Contact/AddressBook/CSV.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@
'thunderbird' => 'Mozilla',
'yahoo' => 'Yahoo',
'palm' => 'Palm',
'kmail' => 'KMail'
'kmail' => 'KMail',
'gmail' => 'Gmail'
);

/**
Expand All @@ -84,7 +85,8 @@
'outlookexpress' => 'WAB',
'outlook' => 'Outlook',
'yahoo' => 'Yahoo',
'kmail' => 'KMail'
'kmail' => 'KMail',
'gmail' => 'Gmail'
);

// }}}
Expand Down
3 changes: 2 additions & 1 deletion Contact/AddressBook/Converter/CSV.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@
'thunderbird' => 'Mozilla',
'yahoo' => 'Yahoo',
'palm' => 'Palm',
'kmail' => 'KMail'
'kmail' => 'KMail',
'gmail' => 'Gmail'
);

// }}}
Expand Down
46 changes: 46 additions & 0 deletions data/CSV/Config/Gmail.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4 foldmethod=marker: */

// {{{ Header

/**
* File contains GMail CSV address book configuration.
*
* PHP versions 4 and 5
*
* @category File Formats
* @package Contact_AddressBook
* @subpackage CSV
* @author Firman Wandayandi <firman@php.net>
* @copyright Copyright (c) 2004-2005 Firman Wandayandi
* @license http://www.opensource.org/licenses/bsd-license.php
* BSD License
* @version CVS: $Id$
* @since File available since Release 0.5.0
*/

// }}}

/**
* Gmail CSV address book configuration.
*
* @global array $GLOBALS['_Contact_AddressBook_CSV_config']
* @name $_Contact_AddressBook_CSV_config
*/
$GLOBALS['_Contact_AddressBook_CSV_config'] = array(
'fields' => 13,
'quote' => '"',
'line_break' => "\n",
'header' => true,
'multilines' => true
);

/*
* Local variables:
* mode: php
* tab-width: 4
* c-basic-offset: 4
* c-hanging-comment-ender-p: nil
* End:
*/
?>
49 changes: 49 additions & 0 deletions data/CSV/Defs/Gmail.def
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
; +---------------------------------------------------------------------------------+
; | PEAR::Contact_AddressBook Definition File |
; | Copyright (c) 2004-2005 Firman Wandayandi |
; +---------------------------------------------------------------------------------+
; | This file contains Gmail CSV address book default fields definition. |
; +---------------------------------------------------------------------------------+
; CVS: $Id$

; Name
0 = displayname

; E-mail
1 = email

; Notes
2 = notes

; Section 1 - Description [Ignored]
; 3 =

; Section 1 - Email
4 = email2

; Section 1 - IM [Ignored]
; 5 =

; Section 1 - Phone
6 = home_phone

; Section 1 - Mobile
7 = mobile

; Section 1 - Pager
8 = pager

; Section 1 - Fax
9 = home_fax

; Section 1 - Company
10 = organization

; Section 1 - Title
11 = title

; Section 1 - Other [Ignored]
; 12 =

; Section 1 - Address
13 = home_address
55 changes: 55 additions & 0 deletions data/CSV/Header/Gmail/en.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4 foldmethod=marker: */

// {{{ Header

/**
* File contains Gmail CSV address book English header.
*
* PHP versions 4 and 5
*
* @category File Formats
* @package AddressBook
* @subpackage CSV
* @author Firman Wandayandi <firman@php.net>
* @copyright Copyright (c) 2005 Firman Wandayandi
* @license http://www.opensource.org/licenses/bsd-license.php
* BSD License
* @version CVS: $Id$
* @since File available since Release 0.5.0
*/

// }}}

/**
* Gmail (KDE) CSV address book English header.
*
* @global array $GLOBALS['_Contact_AddressBook_CSV_header']
* @name $_Contact_AddressBook_CSV_header
*/
$GLOBALS['_Contact_AddressBook_CSV_header'] = array(
'Name',
'E-mail',
'Notes',
'Section 1 - Description',
'Section 1 - Email',
'Section 1 - IM',
'Section 1 - Phone',
'Section 1 - Mobile',
'Section 1 - Pager',
'Section 1 - Fax',
'Section 1 - Company',
'Section 1 - Title',
'Section 1 - Other',
'Section 1 - Address'
);

/*
* Local variables:
* mode: php
* tab-width: 4
* c-basic-offset: 4
* c-hanging-comment-ender-p: nil
* End:
*/
?>
1 change: 1 addition & 0 deletions docs/examples/export.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
<option value="csv_wab">Microsoft Windows Address Book (WAB)/Outlook Express CSV</option>
<option value="csv_palm">Palm Pilot CSV</option>
<option value="csv_yahoo">Yahoo! Mail Address Book</option>
<option value="csv_gmail">Gmail Address Book</option>
</select><br />
<b>Output options:</b><br />
<input name="mode" type="radio" value="print" id="mode_print" checked><label for="mode_print">Print it</label>
Expand Down
3 changes: 3 additions & 0 deletions docs/examples/files/Gmail.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Name,E-mail,Notes,Section 1 - Description,Section 1 - Email,Section 1 - IM,Section 1 - Phone,Section 1 - Mobile,Section 1 - Pager,Section 1 - Fax,Section 1 - Company,Section 1 - Title,Section 1 - Other,Section 1 - Address
John Doe,john@example.com,,,john.doe@example.com,,9999999,9999999,9999999,9999999,"Example, Corp.",Mr,,Foo Street
Jeniffer Doe,jeniffer@example.com,,,jeniffer.doe@example.com,,9999999,9999999,9999999,9999999,"Example, Corp.",Mrs,,Foo Street
1 change: 1 addition & 0 deletions docs/examples/import.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ function showElement(id)
<option value="csv_wab">Microsoft Windows Address Book (WAB)/Outlook Express CSV</option>
<option value="csv_palm">Palm Pilot CSV</option>
<option value="csv_yahoo">Yahoo! Mail Address Book</option>
<option value="csv_gmail">Gmail Address Book</option>
</select><br />
</div>
<input name="submit" type="submit" id="submit" value="Import" />
Expand Down
5 changes: 5 additions & 0 deletions docs/examples/include/simulations.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@
'file' => 'Yahoo.csv',
'format' => 'csv_yahoo',
'desc' => 'Yahoo! Mail Address Book'
),
array(
'file' => 'Gmail.csv',
'format' => 'csv_gmail',
'desc' => 'Gmail Address Book'
)
);

Expand Down
1 change: 1 addition & 0 deletions docs/examples/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<dt>5. Microsoft Windows Address Book (WAB) CSV</dt>
<dt>6. Yahoo! Mail Address Book</dt>
<dt>7. Eudora</dt>
<dt>8. Gmail Address Book</dt>
</dl>
<dl>
<dt><b>Examples</b></dt>
Expand Down
37 changes: 2 additions & 35 deletions generate_package_xml.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,45 +19,12 @@
'package' => 'Contact_AddressBook',
'license' => 'BSD License',
'baseinstalldir' => '',
'version' => '0.4.0alpha1',
'version' => '0.5.0',
'packagedirectory' => $packagedir,
'pathtopackagefile' => $packagedir,
'state' => 'alpha',
'filelistgenerator' => 'file',
'notes' => "* Fixed bug in Contact_AddressBook_Builder_Eudora::build(), wrong way on \"notes\" tag\n" .
"* Fixed bug causes by File_CSV with force config (thanks to Andy Crain <crain@fuse.net>)\n" .
"* Fixed bug in Contact_AddressBook_Converter::prepare(), Contact_AddressBook_Converter::\$isPrepared never assigned (thanks to Andy Crain <crain@fuse.net>)\n" .
"* Reconstructed file and directory structure\n" .
"* Renamed Contact_AddressBook_Builder_eudora to Contact_AddressBook_Eudora\n" .
"* Renamed Contact_AddressBook_Builder_csv to Contact_AddressBook_CSV\n" .
"* Renamed Contact_AddressBook_Parser_eudora to Contact_AddressBook_Parser_Eudora\n" .
"* Renamed Contact_AddressBook_Parser_CSV to Contact_AddressBook_Parser_csv\n" .
"* Renamed several files to pretty names\n" .
"* Moved all CSV address book related files under PEAR data dir \"Contact_AddressBook/CSV\"\n" .
"* Renamed format call names, see added logs\n" .
"* Changed the examples\n" .
"* Changed the release state to alpha\n" .
"- Removed \"definitions\" dir, now all definition files are under \"Defs\" dir\n" .
"- Removed Contact_AddressBook::isExportable(), each supported formats are exportable\n" .
"- Removed Contact_AddressBook::isImportable(), each supported formats are importable\n" .
"- Removed Contact_AddressBook_Builder_csv_netscape\n" .
"- Removed Contact_AddressBook_Builder_csv_outlook_express\n" .
"+ Added new method Contact_AddressBook::isSupported(), find out the whether the format is supported or not\n" .
"+ Added new class Contact_AddressBook_CSV for working with CSV\n" .
"+ Added new class Contact_AddressBook_Converter_CSV, for CSV converting\n" .
"+ Added several CSV related files in PEAR data dir \"Contact_AddressBook/CSV\"\n" .
"+ Added new support for KMail (KDE Mailer), Ms Outlook, Palm Pilot and Yahoo!\n" .
"+ Added several call names (case-insensitive),
csv_wab => Ms Windows Address Book CSV
csv_outlookexpress => Ms Windows Outlook Express CSV (equal with csv_wab)
csv_outlook => Ms Outlook CSV
csv_mozilla => Mozilla Mailer CSV
csv_thunderbird => Mozilla Thunderbird CSV (equal with csv_mozilla and csv_netscape)
csv_netscape => Netscape Mailer CSV (equal with csv_mozilla and csv_thunderbird)
csv_yahoo => Yahoo! CSV
csv_palm => Palm CSV.
eudora => Eudora address book\n" .
"+ Upgraded File package dependency to version >= 1.2.1",
'notes' => "* Added new support for Gmail address book",
'summary' => 'Address book export-import class',
'description' => $desc,
'dir_roles' => array(
Expand Down
65 changes: 27 additions & 38 deletions package.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="ISO-8859-1" ?>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE package SYSTEM "http://pear.php.net/dtd/package-1.0">
<package version="1.0" packagerversion="1.4.0a12">
<package version="1.0" packagerversion="1.4.2">
<name>Contact_AddressBook</name>
<summary>Address book export-import class</summary>
<description>Package provide export-import address book mechanism. Contact_AddressBook refers to needed structure, convert the various address book structure format into it, then you can easily to store it into file, database or another storage media.
Expand All @@ -14,44 +14,11 @@
</maintainer>
</maintainers>
<release>
<version>0.4.0alpha1</version>
<date>2005-08-17</date>
<version>0.5.0</version>
<date>2005-11-07</date>
<license>BSD License</license>
<state>alpha</state>
<notes>* Fixed bug in Contact_AddressBook_Builder_Eudora::build(), wrong way on &quot;notes&quot; tag
* Fixed bug causes by File_CSV with force config (thanks to Andy Crain &lt;crain@fuse.net&gt;)
* Fixed bug in Contact_AddressBook_Converter::prepare(), Contact_AddressBook_Converter::$isPrepared never assigned (thanks to Andy Crain &lt;crain@fuse.net&gt;)
* Reconstructed file and directory structure
* Renamed Contact_AddressBook_Builder_eudora to Contact_AddressBook_Eudora
* Renamed Contact_AddressBook_Builder_csv to Contact_AddressBook_CSV
* Renamed Contact_AddressBook_Parser_eudora to Contact_AddressBook_Parser_Eudora
* Renamed Contact_AddressBook_Parser_CSV to Contact_AddressBook_Parser_csv
* Renamed several files to pretty names
* Moved all CSV address book related files under PEAR data dir &quot;Contact_AddressBook/CSV&quot;
* Renamed format call names, see added logs
* Changed the examples
* Changed the release state to alpha
- Removed &quot;definitions&quot; dir, now all definition files are under &quot;Defs&quot; dir
- Removed Contact_AddressBook::isExportable(), each supported formats are exportable
- Removed Contact_AddressBook::isImportable(), each supported formats are importable
- Removed Contact_AddressBook_Builder_csv_netscape
- Removed Contact_AddressBook_Builder_csv_outlook_express
+ Added new method Contact_AddressBook::isSupported(), find out the whether the format is supported or not
+ Added new class Contact_AddressBook_CSV for working with CSV
+ Added new class Contact_AddressBook_Converter_CSV, for CSV converting
+ Added several CSV related files in PEAR data dir &quot;Contact_AddressBook/CSV&quot;
+ Added new support for KMail (KDE Mailer), Ms Outlook, Palm Pilot and Yahoo!
+ Added several call names (case-insensitive),
csv_wab =&gt; Ms Windows Address Book CSV
csv_outlookexpress =&gt; Ms Windows Outlook Express CSV (equal with csv_wab)
csv_outlook =&gt; Ms Outlook CSV
csv_mozilla =&gt; Mozilla Mailer CSV
csv_thunderbird =&gt; Mozilla Thunderbird CSV (equal with csv_mozilla and csv_netscape)
csv_netscape =&gt; Netscape Mailer CSV (equal with csv_mozilla and csv_thunderbird)
csv_yahoo =&gt; Yahoo! CSV
csv_palm =&gt; Palm CSV.
eudora =&gt; Eudora address book
+ Upgraded File package dependency to version &gt;= 1.2.1
<notes>* Added new support for Gmail address book
</notes>
<deps>
<dep type="pkg" rel="ge" version="1.2.1" optional="no">PEAR</dep>
Expand Down Expand Up @@ -103,6 +70,9 @@ eudora =&gt; Eudora address book
<dir name="data">
<dir name="CSV">
<dir name="Config">
<file role="data" name="Gmail.php">
<replace type="package-info" from="@package_version@" to="version"/>
</file>
<file role="data" name="KMail.php">
<replace type="package-info" from="@package_version@" to="version"/>
</file>
Expand All @@ -123,6 +93,9 @@ eudora =&gt; Eudora address book
</file>
</dir> <!-- /data/CSV/Config -->
<dir name="Defs">
<file role="data" name="Gmail.def">
<replace type="package-info" from="@package_version@" to="version"/>
</file>
<file role="data" name="KMail.def">
<replace type="package-info" from="@package_version@" to="version"/>
</file>
Expand All @@ -143,6 +116,11 @@ eudora =&gt; Eudora address book
</file>
</dir> <!-- /data/CSV/Defs -->
<dir name="Header">
<dir name="Gmail">
<file role="data" name="en.php">
<replace type="package-info" from="@package_version@" to="version"/>
</file>
</dir> <!-- /data/CSV/Header/Gmail -->
<dir name="KMail">
<file role="data" name="en.php">
<replace type="package-info" from="@package_version@" to="version"/>
Expand Down Expand Up @@ -180,6 +158,9 @@ eudora =&gt; Eudora address book
<file role="doc" name="Eudora.txt">
<replace type="package-info" from="@package_version@" to="version"/>
</file>
<file role="doc" name="Gmail.csv">
<replace type="package-info" from="@package_version@" to="version"/>
</file>
<file role="doc" name="KMail.csv">
<replace type="package-info" from="@package_version@" to="version"/>
</file>
Expand Down Expand Up @@ -289,5 +270,13 @@ eudora =&gt; Eudora address book
+ Upgraded File package dependency to version &gt;= 1.2.1
</notes>
</release>
<release>
<version>0.5.0</version>
<date>2005-11-07</date>
<license>BSD License</license>
<state>alpha</state>
<notes>* Added new support for Gmail address book
</notes>
</release>
</changelog>
</package>
Loading

0 comments on commit 1b559ee

Please sign in to comment.