File_IMC
[ class tree: File_IMC ] [ index: File_IMC ] [ all elements ]

Class: File_IMC_Parse_Vcard

Source Location: /File_IMC-0.5.0/File/IMC/Parse/Vcard.php

Class Overview

File_IMC_Parse
   |
   --File_IMC_Parse_Vcard

This class is a parser for vCards.


Author(s):

Version:

  • Release: 0.5.0

Methods


Inherited Variables

Inherited Methods

Class: File_IMC_Parse

File_IMC_Parse::fromFile()
Reads a file for parsing, then sends it to $this->fromText() and returns the results.
File_IMC_Parse::fromText()
Prepares a block of text for parsing, then sends it through and returns the results from $this->_fromArray().
File_IMC_Parse::getVersion()
File_IMC_Parse::_charset_conv()
Convert text to the specified charaster set
File_IMC_Parse::_convertLineEndings()
Converts line endings in text.
File_IMC_Parse::_decode()
Looks at a line's parameters; if ENCODING parameter is set and is QUOTED-PRINTABLE then decode the text in-place.
File_IMC_Parse::_fromArray()
Parses an array of source lines and returns an array of vCards.
File_IMC_Parse::_getGroup()
Takes a line and extracts the Group for the line (a group is identified as a prefix-with-dot to the Type-Definition; e.g., Group.ADR or Group.ORG).
File_IMC_Parse::_getParamName()
Returns the parameter name for parameters given without names.
File_IMC_Parse::_getParams()
Finds the Type-Definition parameters for a line.
File_IMC_Parse::_getTypeDef()
Takes a line and extracts the Type-Definition for the line (not including the Group portion; e.g., in Group.ADR, only ADR is returned).
File_IMC_Parse::_parseBlock()
Goes through the IMC file, recursively processing BEGIN-END blocks
File_IMC_Parse::_splitByColon()
Splits the line into types/parameters and values.
File_IMC_Parse::_splitByComma()
Splits a string into an array at commas.
File_IMC_Parse::_splitByDelim()
Splits a string into an array. Honors backslash-escaped delimiters, (i.e., splits at ';' not '\;') and double-quotes (will not break inside double-quotes ("")).
File_IMC_Parse::_splitBySemi()
Splits a string into an array at semicolons.
File_IMC_Parse::_unescape()
Used to make string human-readable after being a vCard value.

Class Details

[line 74]
This class is a parser for vCards.

Parses vCard 2.1 and 3.0 sources from file or text into a structured array.

Usage:

  1.      // include this class file
  2.      require_once 'File/IMC.php';
  3.  
  4.      // instantiate a parser object
  5.      $parse = new File_IMC::parse('vCard');
  6.  
  7.      // parse a vCard file and store the data
  8.      // in $cardinfo
  9.      $cardinfo $parse->fromFile('sample.vcf');
  10.  
  11.      // view the card info array
  12.      echo '<pre>';
  13.      print_r($cardinfo);
  14.      echo '</pre>';



[ Top ]


Method Detail

getVersion   [line 81]

void getVersion( )

Return version.

Overrides File_IMC_Parse::getVersion() (parent method not documented)
[ Top ]

_decode   [line 98]

array _decode( array $params, string $text, [string $prop = null])

Looks at a line's parameters; if ENCODING parameter is set -> decode the text in-place.

Overrides File_IMC_Parse::_decode() (Looks at a line's parameters; if ENCODING parameter is set and is QUOTED-PRINTABLE then decode the text in-place.)

Parameters:

array   $params   —  A parameter array from a vCard line.
string   $text   —  A right-part (after-the-colon part) from a line.
string   $prop   —  The property name.. passed so may have special-cases

[ Top ]

_parseADR   [line 172]

array _parseADR( string $text)

Parses a vCard line value identified as being of the "ADR" (structured address) type-defintion.
  • Return: An array of key-value pairs where the key is the portion-name and the value is the portion-value. The value itself may be an array as well if multiple comma-separated values were indicated in the vCard source.
  • Access: protected

Parameters:

string   $text   —  The right-part (after-the-colon part) of a vCard line.

[ Top ]

_parseCATEGORIES   [line 234]

mixed _parseCATEGORIES( string $text)

Parses a vCard line value identified as being of the "CATEGORIES" (card-category) type-defintion.
  • Return: An array of categories.
  • Access: protected

Parameters:

string   $text   —  The right-part (after-the-colon part) of a vCard line.

[ Top ]

_parseGEO   [line 248]

mixed _parseGEO( string $text)

Parses a vCard line value identified as being of the "GEO" (geographic coordinate) type-defintion.
  • Return: An array of lat-lon geocoords.
  • Access: protected

Parameters:

string   $text   —  The right-part (after-the-colon part) of a vCard line.

[ Top ]

_parseN   [line 146]

array _parseN( string $text)

Parses a vCard line value identified as being of the "N" (structured name) type-defintion.
  • Return: An array of key-value pairs where the key is the portion-name and the value is the portion-value. The value itself may be an array as well if multiple comma-separated values were indicated in the vCard source.
  • See: File_IMC_Parse::_splitBySemi()
  • See: File_IMC_Parse::_splitByComma()
  • Access: protected

Parameters:

string   $text   —  The right-part (after-the-colon part) of a vCard line.

[ Top ]

_parseNICKNAME   [line 197]

array _parseNICKNAME( string $text)

Parses a vCard line value identified as being of the "NICKNAME" (informal or descriptive name) type-defintion.
  • Return: An array of nicknames.
  • Access: protected

Parameters:

string   $text   —  The right-part (after-the-colon part) of a vCard line.

[ Top ]

_parseORG   [line 214]

array _parseORG( string $text)

Parses a vCard line value identified as being of the "ORG" (organizational info) type-defintion.
  • Return: An array of organizations; each element of the array is itself an array, which indicates primary organization and sub-organizations.
  • Access: protected

Parameters:

string   $text   —  The right-part (after-the-colon part) of a vCard line.

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:49:38 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.