Svetlozar.NET Contacts Importer (PHP)

Example Code Documentation

<head> <meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type"> <title>Svetlozar.NET Contacts Importer</title> </head> <body> Example Code Documentation

./index.php:
All logic moved to ContactsHandler class (./example/contacts.main.php)

include_once 'example/contacts.main.php';
$handler = new ContactsHandler();
$handler->handle_request($_POST);

./example/contacts.main.php (this is where most of the code is, the rest of the files are templates for forms and pages)
Please see comments within the file, I've tried tried to explain almost every single step
The main method is handle_request

Forms:
A note for all forms: the instance of ContactsHandler is made available in the forms (so $this->[property] points to propery of ContactsHandler), forms are loaded within handle_request scope

./example/contacts.import.php
Based on the type of contacts importer class display:
- username and password (+ captcha if captcha response is returned)
- or just a button to open the external authentication window

./example/contacts.invite.php
Display a list of imported contacts for user selection (if your implementation requires to do so)

./example/contacts.done.php
Any feedback to the user after submitting selected contacts

./contacts.page.php
Javascript documentation:
Important parts
form_ready global (available to the whole page) is set to True if the form is simple import form (username/password), or for external authentication forms, it is True only after the user clicks the button for external authentication (used in the onclick event of the button so that form submission is not triggered during opening the external authentication window)
External authentication does trigger form submission but only when the user goes through the process of authorizing the request (at that point the popup window calls back its parent window and as a result the form is submitted with any additional data that the popup window may provide)

More Javascript (second block)
(function(){...}) is used to create local scope (not creating any globals, not necessary otherwise)
external_auth

  • url to the page that will handle external authentication redirection (url used in opening the popup window)
    submit_form
  • replaces (wraps) the onsubmit event of the form (it is a decorator), makes sure the form is only submitted when form_ready is true and opens up the external authentication window otherwise
    toggle_checked, cancel_propagation, set_checked - provided for user friendliness (allow for checking all checkboxes at once, clicking on table row toggles on/off the checkbox on that row), you may use any javascript library to provide the same

    The last part of the javascript code is where the form submit event is wrapped in a call to submit_form

    var import_form = document.getElementById("import_form");
    if (import_form)
    {
    import_form.onsubmit = submit_form(import_form);
    }

    ./external.php
    Contains definition of ExternalAuthHandler which overrides handle_request from ContactsHandler (again, it will be most useful if you follow the comments in the code for handle_request)

    ./example/external.page.php
    A template page for the external authentication page
    QueryParms = the query string parsed into dictionary (or associative array in PHP terms), we need to extract oauth_verifier from it when the user authorizes the request
    ReturnToParent()
  • sets form_ready in the parent window to true, and passes oauth_verifier to ImportContacts function in the parent window (which will trigger submission of the form with oauth_verifier as part of the "state" of the form)

    Settings
    Svetlozar.NET/settings.php     (comments include urls for getting private keys/secret for your application. I could not find one for Plaxo)
     Sign up for your own keys and enter them here (this file may remotely look like a file of global definitions but it is actually included within the scope of SPUserSettings::init())
     </body>
FOR INTERNAL USE ONLY. NOT FOR DISTRIBUTION.


AOL Class Reference

Inheritance diagram for AOL:
[legend]
Collaboration diagram for AOL:
[legend]

Public Member Functions

GetContacts ()
Reset ()
GetState ()
RestoreState ($state)
GetContactsArrays ()

Static Public Member Functions

static | parse_emails ($str)
static | parse_names ($str)

Data Fields

$CaptchaUrl
$RawSource
All public fields will be populated as return.
$ReturnUnparsed
if set to true only raw source will be set, no contacts data will be parsed, default is false
$Error
if error has been returned this will be set to a non-zero constant defined above
$ContactsCount = 0

Protected Member Functions

GetContactsData ()
ParseContactsData ()
SetOptions ($options)

Protected Attributes

$username
$password
$captcha
$return_arrays = false
$client
expected SPHTTPClient or subclass of it

Detailed Description

----------------------------------------------------------------------------- Copyright 2006-2010, Svetlozar Petrov. All rights reserved. http://svetlozar.net

Confidential and Proprietary, Not For Public Release.

No redistribution allowed without prior permission (see licence for details) The above notice must remain unmodified in every source code file -----------------------------------------------------------------------------

Member Function Documentation

GetContacts ( ) [inherited]

Common implementation for GetContacts, subclasses should not have to reimplement this Params are all optional, if provided only the first 4 will be considered in the following order:

Parameters:
$username
$password
$captcha | - only if required
$state | - required together with captcha, must be the string returned by GetState() when ERROR_CAPTCHA_REQUIRED is returned
Returns:
bool - true if contacts were retrieved successfully, false otherwise

Reimplemented from SPContactsBase.

References ContactsResponses::ERROR_NO_USERPASSWORD, and SPContacts::SetOptions().

Here is the call graph for this function:

GetContactsArrays ( ) [inherited]

Common implementation for GetContacts, subclasses should not have to reimplement this Params are all optional, if provided only the first 4 will be considered in the following order:

Parameters:
$username
$password
$captcha | - only if required
$state | - required together with captcha, must be the string returned by GetState() when ERROR_CAPTCHA_REQUIRED is returned
Returns:
bool - true if contacts were retrieved successfully, false otherwise

References SPContactsBase::GetContacts(), and SPContactsBase::SetOptions().

Here is the call graph for this function:

GetContactsData ( ) [protected]

Called internally, needs to be populated in subclasses Needs to set RawSource for ParseContacsData to work on

Returns:
bool - true if contacts data source has been retrieved successfully

Reimplemented from SPContactsBase.

References SPUtils::array_map_assoc(), ContactsResponses::ERROR_INVALID_LOGIN, ContactsResponses::ERROR_NO_USERPASSWORD, ContactsResponses::ERROR_UNKNOWN, and SPUtils::join_key_values_assoc().

Here is the call graph for this function:

GetState ( ) [inherited]

Returns string that can be later used to restore object state

Returns:
string

Implements IObjectState.

Reimplemented in Gmail.

static parse_emails ( $ str ) [static]
static parse_names ( $ str ) [static]
ParseContactsData ( ) [protected]

Called internally, needs to be implemented in subclasses - parse the raw source into

Returns:
bool - true if more than 0 contacts were parsed from the source

Reimplemented from SPContactsBase.

References ContactsResponses::ERROR_NO_CONTACTS.

Reset ( ) [inherited]

Reset options, contacts data etc

Reimplemented from SPContactsBase.

Referenced by SPContacts::SetOptions().

Here is the caller graph for this function:

RestoreState ( $ state ) [inherited]

Restore state from previous state string

Parameters:
$state - string returned by GetState()

Implements IObjectState.

Reimplemented in Gmail.

Referenced by SPContacts::SetOptions().

Here is the caller graph for this function:

SetOptions ( $ options ) [protected, inherited]

Called internally with parameters from constructor or GetContacts()

Parameters:
$options

Reimplemented from SPContactsBase.

References SPContacts::Reset(), and SPContacts::RestoreState().

Referenced by SPContacts::GetContacts().

Here is the call graph for this function:

Here is the caller graph for this function:

Field Documentation

$captcha [protected, inherited]
$CaptchaUrl [inherited]
$client [protected, inherited]
$ContactsCount = 0 [inherited]
$Error [inherited]
$password [protected, inherited]
$RawSource [inherited]

will be populated with unparsed contents used for generating the contacts collection

$return_arrays = false [protected, inherited]
$ReturnUnparsed [inherited]
$username [protected, inherited]
The documentation for this class was generated from the following file:
  • Svetlozar.NET/Contacts/AOL.php


ContactsClass Class Reference

Data Fields

$ClassName = ""
$ExternalAuth = false
$FileName = ""

Detailed Description

----------------------------------------------------------------------------- Copyright 2006-2010, Svetlozar Petrov. All rights reserved. http://svetlozar.net

Confidential and Proprietary, Not For Public Release.

No redistribution allowed without prior permission (see licence for details) The above notice must remain unmodified in every source code file -----------------------------------------------------------------------------

Field Documentation

$ClassName = ""
$ExternalAuth = false
$FileName = ""
The documentation for this class was generated from the following file:
  • Svetlozar.NET/ContactsHelper.php


ContactsHandler Class Reference

Inheritance diagram for ContactsHandler:
[legend]
Collaboration diagram for ContactsHandler:
[legend]

Public Member Functions

handle_request ($post=null)

Data Fields

$expect_redirect = false
$redirect_url = ""

Static Public Attributes

static | $default_class = "Yahoo"
will be loaded by default if no specific contacts_option is provided with the query
static | $contacts_option = "contacts_option"
name of the query parm that will contain the contacts_option
static | $contacts_page = "contacts.page.php"
the page that will be diplayed when handle_request is called
static | $import_form = "contacts.import.php"
the import form (username/pass or external authentication form)
static | $invite_form = "contacts.invite.php"
the form with contacts listing for the user to choose and submit for further processing
static | $invite_done = "contacts.done.php"
"form" to display after contacts have been selected and submitted
static | $session_init = "contacts.session.php"
file that will be included when initializing session (you may customize this file to your needs)

Protected Member Functions

session_start ()
session_commit ()
add_to_session ($key, $value)
remove_from_session ($key)
get_from_session ($key)
get_form ()

Member Function Documentation

add_to_session | ( | $ | key,
 |  | $ | value |
 | ) |  |  | [protected]

Add object/value to session store, this implementation assumes built-in PHP session handling You may subclass and override this function if you need to handle session differently

Parameters:
string | $key
mixed | $value

Referenced by handle_request().

Here is the caller graph for this function:

get_form ( ) [protected]

Get the form contents as string

Returns:
string the form contents

Referenced by handle_request().

Here is the caller graph for this function:

get_from_session ( $ key ) [protected]

Get object/value from session store, this implementation assumes built-in PHP session handling You may subclass and override this function if you need to handle session differently

Parameters:
string | $key
mixed | $value

Referenced by ExternalAuthHandler::handle_request(), and handle_request().

Here is the caller graph for this function:

handle_request ( $ post = null )

Either output the contacts page (and return true/false) or return the form (import/invite) as a string (without writing it to the output stream)

Parameters:
array $post assoc array (usually $_POST) with form parameters entered by user
Returns:
mixed bool|string bool if output_page is set to true and page has been included successfully, string with the form contents only if output_page is false

References add_to_session(), ContactsResponses::ERROR_CAPTCHA_REQUIRED, ContactsResponses::ERROR_EXTERNAL_AUTH, ContactsResponses::ERROR_INVALID_LOGIN, ContactsResponses::ERROR_NO_CONTACTS, ContactsResponses::ERROR_NO_USERPASSWORD, get_form(), get_from_session(), SPUtils::get_values(), ContactsHelper::IncludeClassFile(), remove_from_session(), and session_commit().

Here is the call graph for this function:

remove_from_session ( $ key ) [protected]

Remove key from the session store, this implementation assumes built-in PHP session handling You may subclass and override this function if you need to handle session differently

Parameters:
string $key

Referenced by ExternalAuthHandler::handle_request(), and handle_request().

Here is the caller graph for this function:

session_commit ( ) [protected]

Commit session (no more writes to session will be done after this point), this implementation assumes built-in PHP session handling Also assumption is made that the application will not need to write to session any more so if you have more to write to session from a calling code subclass and override with empty function body You may subclass and override this function if you need to handle session differently

Referenced by handle_request().

Here is the caller graph for this function:

session_start ( ) [protected]

Start session, this implementation assumes built-in PHP session handling You may subclass and override this function if you need to handle session differently

Referenced by ExternalAuthHandler::handle_request().

Here is the caller graph for this function:

Field Documentation

$contacts_option = "contacts_option" [static]

Referenced by ExternalAuthHandler::handle_request().

$contacts_page = "contacts.page.php" [static]
$default_class = "Yahoo" [static]
$expect_redirect = false
$import_form = "contacts.import.php" [static]
$invite_done = "contacts.done.php" [static]
$invite_form = "contacts.invite.php" [static]
$redirect_url = ""
$session_init = "contacts.session.php" [static]
The documentation for this class was generated from the following file:
  • example/contacts.main.php


ContactsHelper Class Reference

Collaboration diagram for ContactsHelper:
[legend]

Static Public Member Functions

static | init ()
static | StripExt ($file_name)
static | GetInstance ($file_name)
static | IncludeClassFile ($file_name)
static | IsContactsFile ($file_name)

Static Public Attributes

static | $ContactsClasses = null

Static Protected Member Functions

static | GetClasses ()

Member Function Documentation

static GetClasses ( ) [static, protected]

Referenced by init().

Here is the caller graph for this function:

static GetInstance ( $ file_name ) [static]

If the class name is found

Parameters:
string | $class_name (must be the key portion of ContactsClasses, including the .ext part if given)
mixed | $options (any number of options needed to instantiate the class)
Returns:
SPContactsBase (subclass of)
static IncludeClassFile ( $ file_name ) [static]

Include a contacts class file so that the class definition is available

Parameters:
$class_name
Returns:
bool true if class name exists and file has been included

Referenced by ContactsHandler::handle_request().

Here is the caller graph for this function:

static init ( ) [static]

References GetClasses().

Here is the call graph for this function:

static IsContactsFile ( $ file_name ) [static]
static StripExt ( $ file_name ) [static]

Field Documentation

$ContactsClasses = null [static]
The documentation for this class was generated from the following file:
  • Svetlozar.NET/ContactsHelper.php


ContactsResponses Class Reference

Collaboration diagram for ContactsResponses:
[legend]

Data Fields

const | ERROR_INVALID_LOGIN = 1
const | ERROR_NO_USERPASSWORD = 2
const | ERROR_NO_CONTACTS = 3
const | ERROR_UNKNOWN = 4
const | ERROR_CAPTCHA_REQUIRED = 5
const | ERROR_EXTERNAL_AUTH = 6
delegated authentication

Field Documentation

const ERROR_CAPTCHA_REQUIRED = 5

Referenced by Gmail::GetContactsData(), and ContactsHandler::handle_request().

const ERROR_EXTERNAL_AUTH = 6

Referenced by SPContactsExtAuth::GetContacts(), and ContactsHandler::handle_request().

const ERROR_INVALID_LOGIN = 1

Referenced by Yahoo::GetContactsData(), Plaxo::GetContactsData(), Hotmail::GetContactsData(), Gmail::GetContactsData(), AOL::GetContactsData(), and ContactsHandler::handle_request().

const ERROR_NO_CONTACTS = 3

Referenced by ContactsHandler::handle_request(), Yahoo::ParseContactsData(), YahooExtAuth::ParseContactsData(), Plaxo::ParseContactsData(), PlaxoExtAuth::ParseContactsData(), Hotmail::ParseContactsData(), Gmail::ParseContactsData(), GmailExtAuth::ParseContactsData(), and AOL::ParseContactsData().

const ERROR_NO_USERPASSWORD = 2

Referenced by SPContacts::GetContacts(), Yahoo::GetContactsData(), Hotmail::GetContactsData(), AOL::GetContactsData(), and ContactsHandler::handle_request().

const ERROR_UNKNOWN = 4

Referenced by SPContactsExtAuth::GetContacts(), Yahoo::GetContactsData(), Plaxo::GetContactsData(), Hotmail::GetContactsData(), Gmail::GetContactsData(), and AOL::GetContactsData().

The documentation for this class was generated from the following file:
  • Svetlozar.NET/Contacts/SPContacts.base.php


ExternalAuthHandler Class Reference

Inheritance diagram for ExternalAuthHandler:
[legend]
Collaboration diagram for ExternalAuthHandler:
[legend]

Public Member Functions

handle_request ($not_used=null, $not_used_ignore=null)
handle_request ($post=null)

Data Fields

$response_parm = "oauth_verifier"
$expect_redirect = false
$redirect_url = ""

Static Public Attributes

static | $default_class = "Yahoo"
will be loaded by default if no specific contacts_option is provided with the query
static | $contacts_option = "contacts_option"
name of the query parm that will contain the contacts_option
static | $contacts_page = "contacts.page.php"
the page that will be diplayed when handle_request is called
static | $import_form = "contacts.import.php"
the import form (username/pass or external authentication form)
static | $invite_form = "contacts.invite.php"
the form with contacts listing for the user to choose and submit for further processing
static | $invite_done = "contacts.done.php"
"form" to display after contacts have been selected and submitted
static | $session_init = "contacts.session.php"
file that will be included when initializing session (you may customize this file to your needs)

Protected Member Functions

session_start ()
session_commit ()
add_to_session ($key, $value)
remove_from_session ($key)
get_from_session ($key)
get_form ()

Member Function Documentation

add_to_session | ( | $ | key,
 |  | $ | value |
 | ) |  |  | [protected, inherited]

Add object/value to session store, this implementation assumes built-in PHP session handling You may subclass and override this function if you need to handle session differently

Parameters:
string | $key
mixed | $value

Referenced by ContactsHandler::handle_request().

Here is the caller graph for this function:

get_form ( ) [protected, inherited]

Get the form contents as string

Returns:
string the form contents

Referenced by ContactsHandler::handle_request().

Here is the caller graph for this function:

get_from_session ( $ key ) [protected, inherited]

Get object/value from session store, this implementation assumes built-in PHP session handling You may subclass and override this function if you need to handle session differently

Parameters:
string | $key
mixed | $value

Referenced by handle_request(), and ContactsHandler::handle_request().

Here is the caller graph for this function:

handle_request ( $ post = null ) [inherited]

Either output the contacts page (and return true/false) or return the form (import/invite) as a string (without writing it to the output stream)

Parameters:
array $post assoc array (usually $_POST) with form parameters entered by user
Returns:
mixed bool|string bool if output_page is set to true and page has been included successfully, string with the form contents only if output_page is false

References ContactsHandler::add_to_session(), ContactsResponses::ERROR_CAPTCHA_REQUIRED, ContactsResponses::ERROR_EXTERNAL_AUTH, ContactsResponses::ERROR_INVALID_LOGIN, ContactsResponses::ERROR_NO_CONTACTS, ContactsResponses::ERROR_NO_USERPASSWORD, ContactsHandler::get_form(), ContactsHandler::get_from_session(), SPUtils::get_values(), ContactsHelper::IncludeClassFile(), ContactsHandler::remove_from_session(), and ContactsHandler::session_commit().

Here is the call graph for this function:

handle_request | ( | $ | not_used = null,
 |  | $ | not_used_ignore = null
 | ) |  |

References ContactsHandler::$contacts_option, ContactsHandler::get_from_session(), SPUtils::parse_query(), ContactsHandler::remove_from_session(), and ContactsHandler::session_start().

Here is the call graph for this function:

remove_from_session ( $ key ) [protected, inherited]

Remove key from the session store, this implementation assumes built-in PHP session handling You may subclass and override this function if you need to handle session differently

Parameters:
string $key

Referenced by handle_request(), and ContactsHandler::handle_request().

Here is the caller graph for this function:

session_commit ( ) [protected, inherited]

Commit session (no more writes to session will be done after this point), this implementation assumes built-in PHP session handling Also assumption is made that the application will not need to write to session any more so if you have more to write to session from a calling code subclass and override with empty function body You may subclass and override this function if you need to handle session differently

Referenced by ContactsHandler::handle_request().

Here is the caller graph for this function:

session_start ( ) [protected, inherited]

Start session, this implementation assumes built-in PHP session handling You may subclass and override this function if you need to handle session differently

Referenced by handle_request().

Here is the caller graph for this function:

Field Documentation

$contacts_option = "contacts_option" [static, inherited]

Referenced by handle_request().

$contacts_page = "contacts.page.php" [static, inherited]
$default_class = "Yahoo" [static, inherited]
$expect_redirect = false [inherited]
$import_form = "contacts.import.php" [static, inherited]
$invite_done = "contacts.done.php" [static, inherited]
$invite_form = "contacts.invite.php" [static, inherited]
$redirect_url = "" [inherited]
$response_parm = "oauth_verifier"
$session_init = "contacts.session.php" [static, inherited]
The documentation for this class was generated from the following file:
  • external.php


Gmail Class Reference

Inheritance diagram for Gmail:
[legend]
Collaboration diagram for Gmail:
[legend]

Public Member Functions

GetState ()
RestoreState ($state)
GetContacts ()
Reset ()
GetContactsArrays ()

Data Fields

$CaptchaUrl
$RawSource
All public fields will be populated as return.
$ReturnUnparsed
if set to true only raw source will be set, no contacts data will be parsed, default is false
$Error
if error has been returned this will be set to a non-zero constant defined above
$ContactsCount = 0

Static Public Attributes

static $contacts_url = "http://www.google.com/m8/feeds/contacts/default/property-email?max-results=9999"

Protected Member Functions

GetContactsData ()
ParseContactsData ()
SetOptions ($options)

Protected Attributes

$username
$password
$captcha
$return_arrays = false
$client
expected SPHTTPClient or subclass of it

Detailed Description

----------------------------------------------------------------------------- Copyright 2006-2010, Svetlozar Petrov. All rights reserved. http://svetlozar.net

Confidential and Proprietary, Not For Public Release.

No redistribution allowed without prior permission (see licence for details) The above notice must remain unmodified in every source code file -----------------------------------------------------------------------------

Member Function Documentation

GetContacts ( ) [inherited]

Common implementation for GetContacts, subclasses should not have to reimplement this Params are all optional, if provided only the first 4 will be considered in the following order:

Parameters:
$username
$password
$captcha | - only if required
$state | - required together with captcha, must be the string returned by GetState() when ERROR_CAPTCHA_REQUIRED is returned
Returns:
bool - true if contacts were retrieved successfully, false otherwise

Reimplemented from SPContactsBase.

References ContactsResponses::ERROR_NO_USERPASSWORD, and SPContacts::SetOptions().

Here is the call graph for this function:

GetContactsArrays ( ) [inherited]

Common implementation for GetContacts, subclasses should not have to reimplement this Params are all optional, if provided only the first 4 will be considered in the following order:

Parameters:
$username
$password
$captcha | - only if required
$state | - required together with captcha, must be the string returned by GetState() when ERROR_CAPTCHA_REQUIRED is returned
Returns:
bool - true if contacts were retrieved successfully, false otherwise

References SPContactsBase::GetContacts(), and SPContactsBase::SetOptions().

Here is the call graph for this function:

GetContactsData ( ) [protected]

Called internally, needs to be populated in subclasses Needs to set RawSource for ParseContacsData to work on

Returns:
bool - true if contacts data source has been retrieved successfully

Reimplemented from SPContactsBase.

References GoogleAuthResponses::BadAuthentication, GoogleAuthResponses::CaptchaRequired, ContactsResponses::ERROR_CAPTCHA_REQUIRED, ContactsResponses::ERROR_INVALID_LOGIN, and ContactsResponses::ERROR_UNKNOWN.

GetState ( )

Returns string that can be later used to restore object state

Returns:
string

Reimplemented from SPContacts.

ParseContactsData ( ) [protected]

Called internally, needs to be implemented in subclasses - parse the raw source into

Returns:
bool - true if more than 0 contacts were parsed from the source

Reimplemented from SPContactsBase.

References ContactsResponses::ERROR_NO_CONTACTS.

Reset ( ) [inherited]

Reset options, contacts data etc

Reimplemented from SPContactsBase.

Referenced by SPContacts::SetOptions().

Here is the caller graph for this function:

RestoreState ( $ state )

Restore state from previous state string

Parameters:
$state - string returned by GetState()

Reimplemented from SPContacts.

SetOptions ( $ options ) [protected, inherited]

Called internally with parameters from constructor or GetContacts()

Parameters:
$options

Reimplemented from SPContactsBase.

References SPContacts::Reset(), and SPContacts::RestoreState().

Referenced by SPContacts::GetContacts().

Here is the call graph for this function:

Here is the caller graph for this function:

Field Documentation

$captcha [protected, inherited]
$CaptchaUrl [inherited]
$client [protected, inherited]
$contacts_url = "http://www.google.com/m8/feeds/contacts/default/property-email?max-results=9999" [static]
$ContactsCount = 0 [inherited]
$Error [inherited]
$password [protected, inherited]
$RawSource [inherited]

will be populated with unparsed contents used for generating the contacts collection

$return_arrays = false [protected, inherited]
$ReturnUnparsed [inherited]
$username [protected, inherited]
The documentation for this class was generated from the following file:
  • Svetlozar.NET/Contacts/Gmail.php


GmailExtAuth Class Reference

Inheritance diagram for GmailExtAuth:
[legend]
Collaboration diagram for GmailExtAuth:
[legend]

Public Member Functions

ParseContactsData ()
Reset ()
GetContacts ()
GetState ()
RestoreState ($state)
GetContactsData ()
GetContactsArrays ()

Data Fields

$contacts_url = "http://www-opensocial.googleusercontent.com/api/people/@me/@all?format=xml&count=9999&fields=displayName,emails"
must be defined in subclasses
$UserAuthorizationUrl = ""
will be set to authorization url that the user needs to be redirected to
$UserAuthorizationNeeded = false
will be set to true if the user needs to authorize a token
$RawSource
All public fields will be populated as return.
$ReturnUnparsed
if set to true only raw source will be set, no contacts data will be parsed, default is false
$Error
if error has been returned this will be set to a non-zero constant defined above
$ContactsCount = 0

Protected Member Functions

SetOptions ($options)

Protected Attributes

$url_key = "google/urls"
must be defined in subclasses (correspond to keys in settings.php)
$auth_key = "google/oauth"
$return_arrays = false
$client
expected SPHTTPClient or subclass of it

Detailed Description

----------------------------------------------------------------------------- Copyright 2006-2010, Svetlozar Petrov. All rights reserved. http://svetlozar.net

Confidential and Proprietary, Not For Public Release.

No redistribution allowed without prior permission (see licence for details) The above notice must remain unmodified in every source code file ----------------------------------------------------------------------------- Most magic moved to SPContactsExtAuth

Author:
Svetlozar Petrov

Member Function Documentation

GetContacts ( ) [inherited]

Common implementation for GetContacts, subclasses should not have to reimplement this Params are all optional, if provided only the first 4 will be considered in the following order:

Parameters:
$username
$password
$captcha | - only if required
$state | - required together with captcha, must be the string returned by GetState() when ERROR_CAPTCHA_REQUIRED is returned
Returns:
bool - true if contacts were retrieved successfully, false otherwise

Reimplemented from SPContactsBase.

Reimplemented in YahooExtAuth.

References ContactsResponses::ERROR_EXTERNAL_AUTH, ContactsResponses::ERROR_UNKNOWN, SPOAuthClient::OAUTH_ACCESS_ERROR, SPOAuthClient::OAUTH_HTTP_ERROR, SPOAuthClient::OAUTH_RESPONSE_UNKNOWN, and SPOAuthClient::OAUTH_USER_AUTH.

GetContactsArrays ( ) [inherited]

Common implementation for GetContacts, subclasses should not have to reimplement this Params are all optional, if provided only the first 4 will be considered in the following order:

Parameters:
$username
$password
$captcha | - only if required
$state | - required together with captcha, must be the string returned by GetState() when ERROR_CAPTCHA_REQUIRED is returned
Returns:
bool - true if contacts were retrieved successfully, false otherwise

References SPContactsBase::GetContacts(), and SPContactsBase::SetOptions().

Here is the call graph for this function:

GetContactsData ( ) [inherited]

Base implementation, expected $contacts_url to be overriden in subclasses

Reimplemented from SPContactsBase.

Reimplemented in YahooExtAuth.

References SPOAuthClient::OAUTH_USER_AUTH.

GetState ( ) [inherited]

Returns string that can be later used to restore object state

Returns:
string

Implements IObjectState.

ParseContactsData ( )

Called internally, needs to be implemented in subclasses - parse the raw source into

Returns:
bool - true if more than 0 contacts were parsed from the source

Reimplemented from SPContactsBase.

References ContactsResponses::ERROR_NO_CONTACTS.

Reset ( ) [inherited]

Reset options, contacts data etc

Reimplemented from SPContactsBase.

Referenced by SPContactsExtAuth::SetOptions().

Here is the caller graph for this function:

RestoreState ( $ state ) [inherited]

Restore state from previous state string

Parameters:
$state - string returned by GetState()

Implements IObjectState.

SetOptions ( $ options ) [protected, inherited]

Called internally with parameters from constructor or GetContacts()

Parameters:
$options

Reimplemented from SPContactsBase.

References SPContactsExtAuth::Reset().

Here is the call graph for this function:

Field Documentation

$auth_key = "google/oauth" [protected]

Reimplemented from SPContactsExtAuth.

$client [protected, inherited]
$contacts_url = "http://www-opensocial.googleusercontent.com/api/people/@me/@all?format=xml&count=9999&fields=displayName,emails"

Reimplemented from SPContactsExtAuth.

$ContactsCount = 0 [inherited]
$Error [inherited]
$RawSource [inherited]

will be populated with unparsed contents used for generating the contacts collection

$return_arrays = false [protected, inherited]
$ReturnUnparsed [inherited]
$url_key = "google/urls" [protected]

Reimplemented from SPContactsExtAuth.

$UserAuthorizationNeeded = false [inherited]
$UserAuthorizationUrl = "" [inherited]

Any responses are the same as SPOAuthClient responses only errors will be returned

The documentation for this class was generated from the following file:
  • Svetlozar.NET/Contacts/Gmail.Ext.php


GoogleAccountTypes Class Reference

Collaboration diagram for GoogleAccountTypes:
[legend]

Data Fields

const | GOOGLE = "GOOGLE"
const | HOSTED = "HOSTED"
const | HOSTED_OR_GOOGLE = "HOSTED_OR_GOOGLE"

Field Documentation

const GOOGLE = "GOOGLE"
const HOSTED = "HOSTED"
const HOSTED_OR_GOOGLE = "HOSTED_OR_GOOGLE"

Referenced by GoogleLoginClient::Reset().

The documentation for this class was generated from the following file:
  • Svetlozar.NET/WebClients/GoogleLoginClient.php


GoogleAuthResponses Class Reference

Collaboration diagram for GoogleAuthResponses:
[legend]

Data Fields

const | Authenticated = 'Authenticated'
Authentication Responses.
const | BadAuthentication = 'BadAuthentication'
const | NotVerified = 'NotVerified'
const | TermsNotAgreed = 'TermsNotAgreed'
const | Unknown = 'Unknown'
const | CaptchaRequired = 'CaptchaRequired'
const | AccountDeleted = 'AccountDeleted'
const | AccountDisabled = 'AccountDisabled'
const | ServiceDisabled = 'ServiceDisabled'
const | ServiceUnavailable = 'ServiceUnavailable'
const | EmailPasswordMissing = 'EmailPasswordMissing'
const | HTTPError = 'HTTPError'

Detailed Description

----------------------------------------------------------------------------- Copyright 2006-2010, Svetlozar Petrov. All rights reserved. http://svetlozar.net

Confidential and Proprietary, Not For Public Release.

No redistribution allowed without prior permission (see licence for details) The above notice must remain unmodified in every source code file -----------------------------------------------------------------------------

Field Documentation

const AccountDeleted = 'AccountDeleted'
const AccountDisabled = 'AccountDisabled'
const Authenticated = 'Authenticated'
const BadAuthentication = 'BadAuthentication'

Referenced by Gmail::GetContactsData().

const CaptchaRequired = 'CaptchaRequired'

Referenced by Gmail::GetContactsData().

const EmailPasswordMissing = 'EmailPasswordMissing'

Referenced by GoogleLoginClient::Authenticate().

const HTTPError = 'HTTPError'

Referenced by GoogleLoginClient::Authenticate().

const NotVerified = 'NotVerified'
const ServiceDisabled = 'ServiceDisabled'
const ServiceUnavailable = 'ServiceUnavailable'
const TermsNotAgreed = 'TermsNotAgreed'
const Unknown = 'Unknown'

Referenced by GoogleLoginClient::Authenticate().

The documentation for this class was generated from the following file:
  • Svetlozar.NET/WebClients/GoogleLoginClient.php


GoogleLoginClient Class Reference

Inheritance diagram for GoogleLoginClient:
[legend]
Collaboration diagram for GoogleLoginClient:
[legend]

Public Member Functions

Reset ()
SetSource ($source)
GetState ()
RestoreState ($state)
Authenticate ()
Authenticated ()
get_curl_state ()
get_curl_opts ()
execute_request ($http_request_method, $url, $data=null, $number_redirects=0)
get ($url, $data=null, $number_redirects=0)
post ($url, $data=null, $number_redirects=0)
header_function ($ch, $header)

Data Fields

$CaptchaUrl
will be provided if captcha input is needed for next login attempt
$LoginResponse
will be set to one of the GoogleAuthResponses on login attempt
$AccountType
must be one of the defined in GoogleAccountTypes
$Service = "cp"
defaults to "cp" for contacts
$auto_redirect = true
auto redirect when location header is received
$auto_redirect_curl = true
if set to true the auto redirect will be done within curl, this is much faster, set to false if CUROPT_FOLLOWLOCATION is disabled
$auto_redirect_max = 15
maximum redirects to follow
$curl_error_code = 0
in case curl returns an error this is where to look for it
$curl_error_text = ""
if error returned from curl this will be populated, so check here fist if there is nothing in the response body
$return_response_headers = true
set to true to populate $http_response_headers
$return_response_body = false
when false execute_request will return boolean http_response_code == 200
$http_response_code
code returned from the response
$http_response_text
the text returned with the http response code
$http_response_location = ""
last url of the request
$http_response_headers
will be populated with 2 parallel arrays, [0] => keys, [1] => values, this is becase header may be sent multiple times
$response_content_type
if given in the response header this will be populated
$response_charset
if given in the response header this will be populated
$http_response_body
$timeout = 40
number of seconds before curl times out
$request_headers
any headers to send - must be given as assoc array
$http_proxy = null
you may specify proxy per instance or provide global one in SPHTTPClient::global_http_proxy
$curl_user_agent
$curl_set_referrer = true

Static Public Attributes

static | $global_http_proxy = null

Protected Member Functions

reset_curl_state ($curlopts=null)
initopts ()
handles_set_property ($property)
handles_get_property ($property)
set_request_options ()
handle_response_headers ($ch)

Static Protected Attributes

static | $login_url = "https://www.google.com/accounts/ClientLogin"
static | $captcha_base_url = "http://www.google.com/accounts/"
static | $base_application_name = "Svetlozar.NET.GoogleLoginClient.PHP-2010.02"

Member Function Documentation

Authenticate ( )

This method assumes authentication has not happened previously Parameters expected: email, password, captcha, extra (where extra is retrieved via GetState() after previous unsucessful attempt, optional or null otherwise)

Parameters:
string | $email
string | $password
string | $captcha
string | $extra

Implements IAuthState.

References GoogleAuthResponses::EmailPasswordMissing, GoogleAuthResponses::HTTPError, SPUtils::join_key_values_encode(), SPUtils::parse_query(), SPHTTPClient::post(), RestoreState(), SPUtils::search_array(), and GoogleAuthResponses::Unknown.

Here is the call graph for this function:

Authenticated ( )

Do not 100% rely on the response of this function, make a web request to a protected resource and only when successful consider authenticated to be true

Returns:
bool true if initialized parameters indicate authorization has been given

Implements IAuthState.

References SPUtils::search_array().

Here is the call graph for this function:

execute_request | ( | $ | http_request_method,
 |  | $ | url,
 |  | $ | data = null,
 |  | $ | number_redirects = 0 |
 | ) |  |  | [inherited]

Execute a GET/POST request with the provided so far CURL options

Parameters:
$http_request_type | GET/POST
$url
$data | - for GET this should be assoc array, for POST a string or assoc array
$number_redirects
Returns:
bool or response body

Reimplemented in SPOAuthClient.

References SPConstants::HTTP_METHOD_GET, SPConstants::HTTP_METHOD_POST, SPConstants::HTTP_OK, SPUtils::parse_query(), SPHTTPClient::post(), and SPHTTPClient::set_request_options().

Referenced by SPHTTPClient::get(), and SPHTTPClient::post().

Here is the call graph for this function:

Here is the caller graph for this function:

get | ( | $ | url,
 |  | $ | data = null,
 |  | $ | number_redirects = 0 |
 | ) |  |  | [inherited]

Alias for execute_request (called with "GET" as the request method)

Parameters:
$url
$data
$number_redirects
Returns:
execute_request result

References SPHTTPClient::execute_request(), and SPConstants::HTTP_METHOD_GET.

Here is the call graph for this function:

get_curl_opts ( ) [inherited]

Returns all curl options that have been set (no serialization)

Returns:
array
get_curl_state ( ) [inherited]

Returns serialized curl opts (can be used for restoring an SPHTTPClient object to a previous state by calling reset_state with the string produced from get_state)

Returns:
string
GetState ( )

Return a string that can be later used to restore state

Returns:
string

Implements IObjectState.

References SPUtils::join_key_values_encode(), and SPUtils::search_array().

Here is the call graph for this function:

handle_response_headers ( $ ch ) [protected, inherited]

Handle any headers of interest Curl handle is provided if options need to be set directly on it

Reimplemented in SPHTTPSession.

Referenced by SPHTTPClient::header_function().

Here is the caller graph for this function:

handles_get_property ( $ property ) [protected, inherited]

CURLINFO_* properties are automatically resolved, allowing access to $this->CURLINFO_* that are not explicitly defined

Parameters:
$property - property name
Returns:
bool - true if property starts with CURLINFO_
handles_set_property ( $ property ) [protected, inherited]

SPHTTPClient automatically handles CURLOPT_* properties for any other false will be returned

Parameters:
string $property - property name
Returns:
boolean - true if current class can handle a property with the property name provided
header_function | ( | $ | ch,
 |  | $ | header |
 | ) |  |  | [inherited]

Callback from CURL - handle headers

Parameters:
$ch | - curl handle
$header | - header returned
Parameters:
header parse any useful headers and cookies

References SPHTTPClient::handle_response_headers().

Here is the call graph for this function:

initopts ( ) [protected, inherited]

Initialize common curl options, these are stored internally, will be passed to curl later This function is called from the constructor, you can override any CURLOPT_ properties later

References SPHTTPClient::$global_http_proxy.

Referenced by SPHTTPClient::reset_curl_state().

Here is the caller graph for this function:

post | ( | $ | url,
 |  | $ | data = null,
 |  | $ | number_redirects = 0 |
 | ) |  |  | [inherited]

Alias for execute_request (called with "POST" as the request method, and url encoded data)

Parameters:
$url
$data
$number_redirects
Returns:
execute_request result

References SPHTTPClient::execute_request(), SPConstants::HTTP_METHOD_POST, and SPUtils::join_key_values_encode().

Referenced by Authenticate(), and SPHTTPClient::execute_request().

Here is the call graph for this function:

Here is the caller graph for this function:

Reset ( )

References GoogleAccountTypes::HOSTED_OR_GOOGLE.

reset_curl_state ( $ curlopts = null ) [protected, inherited]

Reset curl options to previous or empty state (should be only used from constructor)

References SPHTTPClient::initopts().

Here is the call graph for this function:

RestoreState ( $ state_str )

Handle state restoring

Parameters:
$state_str

Implements IObjectState.

References SPUtils::parse_query(), and SPUtils::search_array().

Referenced by Authenticate().

Here is the call graph for this function:

Here is the caller graph for this function:

set_request_options ( ) [protected, inherited]

Add any options, overwrite options etc (a hook for subclasses to modify the request before execution) __request_query_parms is avalable here before the url has been set for post data check the stored post fields

Reimplemented in SPHTTPSession, and SPOAuthClient.

References SPUtils::array_map_assoc(), SPUtils::join_key_values_assoc(), and SPUtils::url_from_parts().

Referenced by SPHTTPClient::execute_request().

Here is the call graph for this function:

Here is the caller graph for this function:

SetSource ( $ source )

Set google application source, do note that source will be combined with the base application name, subclasses should respect this and leave it alone

Parameters:
string $source

References SPUtils::search_array().

Here is the call graph for this function:

Field Documentation

$AccountType
$auto_redirect = true [inherited]
$auto_redirect_curl = true [inherited]
$auto_redirect_max = 15 [inherited]
$base_application_name = "Svetlozar.NET.GoogleLoginClient.PHP-2010.02" [static, protected]
$captcha_base_url = "http://www.google.com/accounts/" [static, protected]
$CaptchaUrl
$curl_error_code = 0 [inherited]
$curl_error_text = "" [inherited]
$curl_set_referrer = true [inherited]
$curl_user_agent [inherited]
$global_http_proxy = null [static, inherited]

if you need to have all connections of SPHTTPClient and its subclasses go through proxy specify it here (otherwise you can specify it per instance in $http_proxy) expected format is 'http://proxy.address:port'

Referenced by SPHTTPClient::initopts().

$http_proxy = null [inherited]
$http_response_body [inherited]
$http_response_code [inherited]
$http_response_headers [inherited]
$http_response_location = "" [inherited]
$http_response_text [inherited]
$login_url = "https://www.google.com/accounts/ClientLogin" [static, protected]
$LoginResponse
$request_headers [inherited]
$response_charset [inherited]
$response_content_type [inherited]
$return_response_body = false [inherited]
$return_response_headers = true [inherited]
$Service = "cp"
$timeout = 40 [inherited]
The documentation for this class was generated from the following file:
  • Svetlozar.NET/WebClients/GoogleLoginClient.php


Hotmail Class Reference

Inheritance diagram for Hotmail:
[legend]
Collaboration diagram for Hotmail:
[legend]

Public Member Functions

GetContacts ()
Reset ()
GetState ()
RestoreState ($state)
GetContactsArrays ()

Data Fields

$default_domain = "hotmail.com"
if complete email is not provided as the username, the default domain will be added to it
$CaptchaUrl
$RawSource
All public fields will be populated as return.
$ReturnUnparsed
if set to true only raw source will be set, no contacts data will be parsed, default is false
$Error
if error has been returned this will be set to a non-zero constant defined above
$ContactsCount = 0

Protected Member Functions

GetContactsData ()
ParseContactsData ()
SetOptions ($options)

Protected Attributes

$username
$password
$captcha
$return_arrays = false
$client
expected SPHTTPClient or subclass of it

Detailed Description

----------------------------------------------------------------------------- Copyright 2006-2010, Svetlozar Petrov. All rights reserved. http://svetlozar.net

Confidential and Proprietary, Not For Public Release.

No redistribution allowed without prior permission (see licence for details) The above notice must remain unmodified in every source code file -----------------------------------------------------------------------------

Member Function Documentation

GetContacts ( ) [inherited]

Common implementation for GetContacts, subclasses should not have to reimplement this Params are all optional, if provided only the first 4 will be considered in the following order:

Parameters:
$username
$password
$captcha | - only if required
$state | - required together with captcha, must be the string returned by GetState() when ERROR_CAPTCHA_REQUIRED is returned
Returns:
bool - true if contacts were retrieved successfully, false otherwise

Reimplemented from SPContactsBase.

References ContactsResponses::ERROR_NO_USERPASSWORD, and SPContacts::SetOptions().

Here is the call graph for this function:

GetContactsArrays ( ) [inherited]

Common implementation for GetContacts, subclasses should not have to reimplement this Params are all optional, if provided only the first 4 will be considered in the following order:

Parameters:
$username
$password
$captcha | - only if required
$state | - required together with captcha, must be the string returned by GetState() when ERROR_CAPTCHA_REQUIRED is returned
Returns:
bool - true if contacts were retrieved successfully, false otherwise

References SPContactsBase::GetContacts(), and SPContactsBase::SetOptions().

Here is the call graph for this function:

GetContactsData ( ) [protected]

Called internally, needs to be populated in subclasses Needs to set RawSource for ParseContacsData to work on

Returns:
bool - true if contacts data source has been retrieved successfully

Reimplemented from SPContactsBase.

References ContactsResponses::ERROR_INVALID_LOGIN, ContactsResponses::ERROR_NO_USERPASSWORD, and ContactsResponses::ERROR_UNKNOWN.

GetState ( ) [inherited]

Returns string that can be later used to restore object state

Returns:
string

Implements IObjectState.

Reimplemented in Gmail.

ParseContactsData ( ) [protected]

Called internally, needs to be implemented in subclasses - parse the raw source into

Returns:
bool - true if more than 0 contacts were parsed from the source

Reimplemented from SPContactsBase.

References SPUtils::array_multimap(), and ContactsResponses::ERROR_NO_CONTACTS.

Here is the call graph for this function:

Reset ( ) [inherited]

Reset options, contacts data etc

Reimplemented from SPContactsBase.

Referenced by SPContacts::SetOptions().

Here is the caller graph for this function:

RestoreState ( $ state ) [inherited]

Restore state from previous state string

Parameters:
$state - string returned by GetState()

Implements IObjectState.

Reimplemented in Gmail.

Referenced by SPContacts::SetOptions().

Here is the caller graph for this function:

SetOptions ( $ options ) [protected, inherited]

Called internally with parameters from constructor or GetContacts()

Parameters:
$options

Reimplemented from SPContactsBase.

References SPContacts::Reset(), and SPContacts::RestoreState().

Referenced by SPContacts::GetContacts().

Here is the call graph for this function:

Here is the caller graph for this function:

Field Documentation

$captcha [protected, inherited]
$CaptchaUrl [inherited]
$client [protected, inherited]
$ContactsCount = 0 [inherited]
$default_domain = "hotmail.com"
$Error [inherited]
$password [protected, inherited]
$RawSource [inherited]

will be populated with unparsed contents used for generating the contacts collection

$return_arrays = false [protected, inherited]
$ReturnUnparsed [inherited]
$username [protected, inherited]
The documentation for this class was generated from the following file:
  • Svetlozar.NET/Contacts/Hotmail.php


IAuthState Interface Reference

Inheritance diagram for IAuthState:
[legend]
Collaboration diagram for IAuthState:
[legend]

Public Member Functions

Authenticated ()
Authenticate ()
GetState ()
RestoreState ($state_str)

Member Function Documentation

Authenticate ( )

Accept number of (login) parameters and attempt authentication

Returns:
bool true if authentication has succeeded

Implemented in GoogleLoginClient.

Authenticated ( )

Do not 100% rely on the response of this function, make a web request to a protected resource and only when successful consider authenticated to be true

Returns:
bool true if initialized parameters indicate authorization has been given

Implemented in GoogleLoginClient.

GetState ( ) [inherited]

Return a string that can be later used to restore state

Returns:
string

Implemented in Gmail, SPContacts, SPContactsExtAuth, GoogleLoginClient, and SPOAuthClient.

RestoreState ( $ state_str ) [inherited]

Handle state restoring

Parameters:
$state_str

Implemented in Gmail, SPContacts, SPContactsExtAuth, GoogleLoginClient, and SPOAuthClient.

The documentation for this interface was generated from the following file:
  • Svetlozar.NET/Interfaces.php


IObjectState Interface Reference

Inheritance diagram for IObjectState:
[legend]

Public Member Functions

GetState ()
RestoreState ($state_str)

Detailed Description

----------------------------------------------------------------------------- Copyright 2006-2010, Svetlozar Petrov. All rights reserved. http://svetlozar.net

Confidential and Proprietary, Not For Public Release.

No redistribution allowed without prior permission (see licence for details) The above notice must remain unmodified in every source code file -----------------------------------------------------------------------------

Member Function Documentation

GetState ( )

Return a string that can be later used to restore state

Returns:
string

Implemented in Gmail, SPContacts, SPContactsExtAuth, GoogleLoginClient, and SPOAuthClient.

RestoreState ( $ state_str )

Handle state restoring

Parameters:
$state_str

Implemented in Gmail, SPContacts, SPContactsExtAuth, GoogleLoginClient, and SPOAuthClient.

The documentation for this interface was generated from the following file:
  • Svetlozar.NET/Interfaces.php


Plaxo Class Reference

Inheritance diagram for Plaxo:
[legend]
Collaboration diagram for Plaxo:
[legend]

Public Member Functions

GetContacts ()
Reset ()
GetState ()
RestoreState ($state)
GetContactsArrays ()

Data Fields

$contacts_url = "http://www.plaxo.com/pdata/contacts/@me/@all"
$CaptchaUrl
$RawSource
All public fields will be populated as return.
$ReturnUnparsed
if set to true only raw source will be set, no contacts data will be parsed, default is false
$Error
if error has been returned this will be set to a non-zero constant defined above
$ContactsCount = 0

Protected Member Functions

GetContactsData ()
ParseContactsData ()
SetOptions ($options)

Protected Attributes

$username
$password
$captcha
$return_arrays = false
$client
expected SPHTTPClient or subclass of it

Detailed Description

----------------------------------------------------------------------------- Copyright 2006-2010, Svetlozar Petrov. All rights reserved. http://svetlozar.net

Confidential and Proprietary, Not For Public Release.

No redistribution allowed without prior permission (see licence for details) The above notice must remain unmodified in every source code file -----------------------------------------------------------------------------

Member Function Documentation

GetContacts ( ) [inherited]

Common implementation for GetContacts, subclasses should not have to reimplement this Params are all optional, if provided only the first 4 will be considered in the following order:

Parameters:
$username
$password
$captcha | - only if required
$state | - required together with captcha, must be the string returned by GetState() when ERROR_CAPTCHA_REQUIRED is returned
Returns:
bool - true if contacts were retrieved successfully, false otherwise

Reimplemented from SPContactsBase.

References ContactsResponses::ERROR_NO_USERPASSWORD, and SPContacts::SetOptions().

Here is the call graph for this function:

GetContactsArrays ( ) [inherited]

Common implementation for GetContacts, subclasses should not have to reimplement this Params are all optional, if provided only the first 4 will be considered in the following order:

Parameters:
$username
$password
$captcha | - only if required
$state | - required together with captcha, must be the string returned by GetState() when ERROR_CAPTCHA_REQUIRED is returned
Returns:
bool - true if contacts were retrieved successfully, false otherwise

References SPContactsBase::GetContacts(), and SPContactsBase::SetOptions().

Here is the call graph for this function:

GetContactsData ( ) [protected]

Called internally, needs to be populated in subclasses Needs to set RawSource for ParseContacsData to work on

Returns:
bool - true if contacts data source has been retrieved successfully

Reimplemented from SPContactsBase.

References ContactsResponses::ERROR_INVALID_LOGIN, and ContactsResponses::ERROR_UNKNOWN.

GetState ( ) [inherited]

Returns string that can be later used to restore object state

Returns:
string

Implements IObjectState.

Reimplemented in Gmail.

ParseContactsData ( ) [protected]

Called internally, needs to be implemented in subclasses - parse the raw source into

Returns:
bool - true if more than 0 contacts were parsed from the source

Reimplemented from SPContactsBase.

References SPUtils::decode_html_escaped(), and ContactsResponses::ERROR_NO_CONTACTS.

Here is the call graph for this function:

Reset ( ) [inherited]

Reset options, contacts data etc

Reimplemented from SPContactsBase.

Referenced by SPContacts::SetOptions().

Here is the caller graph for this function:

RestoreState ( $ state ) [inherited]

Restore state from previous state string

Parameters:
$state - string returned by GetState()

Implements IObjectState.

Reimplemented in Gmail.

Referenced by SPContacts::SetOptions().

Here is the caller graph for this function:

SetOptions ( $ options ) [protected, inherited]

Called internally with parameters from constructor or GetContacts()

Parameters:
$options

Reimplemented from SPContactsBase.

References SPContacts::Reset(), and SPContacts::RestoreState().

Referenced by SPContacts::GetContacts().

Here is the call graph for this function:

Here is the caller graph for this function:

Field Documentation

$captcha [protected, inherited]
$CaptchaUrl [inherited]
$client [protected, inherited]
$contacts_url = "http://www.plaxo.com/pdata/contacts/@me/@all"
$ContactsCount = 0 [inherited]
$Error [inherited]
$password [protected, inherited]
$RawSource [inherited]

will be populated with unparsed contents used for generating the contacts collection

$return_arrays = false [protected, inherited]
$ReturnUnparsed [inherited]
$username [protected, inherited]
The documentation for this class was generated from the following file:
  • Svetlozar.NET/Contacts/Plaxo.php


PlaxoExtAuth Class Reference

Inheritance diagram for PlaxoExtAuth:
[legend]
Collaboration diagram for PlaxoExtAuth:
[legend]

Public Member Functions

ParseContactsData ()
Reset ()
GetContacts ()
GetState ()
RestoreState ($state)
GetContactsData ()
GetContactsArrays ()

Data Fields

$contacts_url = "http://www.plaxo.com/pdata/contacts/@me/@all"
must be defined in subclasses
$UserAuthorizationUrl = ""
will be set to authorization url that the user needs to be redirected to
$UserAuthorizationNeeded = false
will be set to true if the user needs to authorize a token
$RawSource
All public fields will be populated as return.
$ReturnUnparsed
if set to true only raw source will be set, no contacts data will be parsed, default is false
$Error
if error has been returned this will be set to a non-zero constant defined above
$ContactsCount = 0

Protected Member Functions

SetOptions ($options)

Protected Attributes

$url_key = "plaxo/urls"
must be defined in subclasses (correspond to keys in settings.php)
$auth_key = "plaxo/oauth"
$return_arrays = false
$client
expected SPHTTPClient or subclass of it

Detailed Description

----------------------------------------------------------------------------- Copyright 2006-2010, Svetlozar Petrov. All rights reserved. http://svetlozar.net

Confidential and Proprietary, Not For Public Release.

No redistribution allowed without prior permission (see licence for details) The above notice must remain unmodified in every source code file ----------------------------------------------------------------------------- Most magic moved to SPContactsExtAuth

Author:
Svetlozar Petrov

Member Function Documentation

GetContacts ( ) [inherited]

Common implementation for GetContacts, subclasses should not have to reimplement this Params are all optional, if provided only the first 4 will be considered in the following order:

Parameters:
$username
$password
$captcha | - only if required
$state | - required together with captcha, must be the string returned by GetState() when ERROR_CAPTCHA_REQUIRED is returned
Returns:
bool - true if contacts were retrieved successfully, false otherwise

Reimplemented from SPContactsBase.

Reimplemented in YahooExtAuth.

References ContactsResponses::ERROR_EXTERNAL_AUTH, ContactsResponses::ERROR_UNKNOWN, SPOAuthClient::OAUTH_ACCESS_ERROR, SPOAuthClient::OAUTH_HTTP_ERROR, SPOAuthClient::OAUTH_RESPONSE_UNKNOWN, and SPOAuthClient::OAUTH_USER_AUTH.

GetContactsArrays ( ) [inherited]

Common implementation for GetContacts, subclasses should not have to reimplement this Params are all optional, if provided only the first 4 will be considered in the following order:

Parameters:
$username
$password
$captcha | - only if required
$state | - required together with captcha, must be the string returned by GetState() when ERROR_CAPTCHA_REQUIRED is returned
Returns:
bool - true if contacts were retrieved successfully, false otherwise

References SPContactsBase::GetContacts(), and SPContactsBase::SetOptions().

Here is the call graph for this function:

GetContactsData ( ) [inherited]

Base implementation, expected $contacts_url to be overriden in subclasses

Reimplemented from SPContactsBase.

Reimplemented in YahooExtAuth.

References SPOAuthClient::OAUTH_USER_AUTH.

GetState ( ) [inherited]

Returns string that can be later used to restore object state

Returns:
string

Implements IObjectState.

ParseContactsData ( )

Called internally, needs to be implemented in subclasses - parse the raw source into

Returns:
bool - true if more than 0 contacts were parsed from the source

Reimplemented from SPContactsBase.

References SPUtils::decode_html_escaped(), and ContactsResponses::ERROR_NO_CONTACTS.

Here is the call graph for this function:

Reset ( ) [inherited]

Reset options, contacts data etc

Reimplemented from SPContactsBase.

Referenced by SPContactsExtAuth::SetOptions().

Here is the caller graph for this function:

RestoreState ( $ state ) [inherited]

Restore state from previous state string

Parameters:
$state - string returned by GetState()

Implements IObjectState.

SetOptions ( $ options ) [protected, inherited]

Called internally with parameters from constructor or GetContacts()

Parameters:
$options

Reimplemented from SPContactsBase.

References SPContactsExtAuth::Reset().

Here is the call graph for this function:

Field Documentation

$auth_key = "plaxo/oauth" [protected]

Reimplemented from SPContactsExtAuth.

$client [protected, inherited]
$contacts_url = "http://www.plaxo.com/pdata/contacts/@me/@all"

Reimplemented from SPContactsExtAuth.

$ContactsCount = 0 [inherited]
$Error [inherited]
$RawSource [inherited]

will be populated with unparsed contents used for generating the contacts collection

$return_arrays = false [protected, inherited]
$ReturnUnparsed [inherited]
$url_key = "plaxo/urls" [protected]

Reimplemented from SPContactsExtAuth.

$UserAuthorizationNeeded = false [inherited]
$UserAuthorizationUrl = "" [inherited]

Any responses are the same as SPOAuthClient responses only errors will be returned

The documentation for this class was generated from the following file:
  • Svetlozar.NET/Contacts/Plaxo.Ext.php


SPConstants Class Reference

Collaboration diagram for SPConstants:
[legend]

Data Fields

const | HTTP_OK = 200
const | HTTP_MOVED_PERMANENTLY = 301
const | HTTP_FOUND = 302
const | HTTP_BAD_REQUEST = 400
const | HTTP_UNAUTHORIZED = 401
const | HTTP_FORBIDDEN = 403
const | HTTP_NOT_FOUND = 404
const | HTTP_METHOD_NOT_ALLOWED = 405
const | HTTP_METHOD_GET = "GET"
const | HTTP_METHOD_POST = "POST"

Detailed Description

----------------------------------------------------------------------------- Copyright 2006-2010, Svetlozar Petrov. All rights reserved. http://svetlozar.net

Confidential and Proprietary, Not For Public Release.

No redistribution allowed without prior permission (see licence for details) The above notice must remain unmodified in every source code file -----------------------------------------------------------------------------

Field Documentation

const HTTP_BAD_REQUEST = 400
const HTTP_FORBIDDEN = 403
const HTTP_FOUND = 302
const HTTP_METHOD_GET = "GET"

Request methods

Referenced by SPOAuthClient::execute_request(), SPHTTPClient::execute_request(), SPHTTPClient::get(), YahooExtAuth::GetContactsData(), and SPOAuthClient::set_request_options().

const HTTP_METHOD_NOT_ALLOWED = 405
const HTTP_METHOD_POST = "POST"

Referenced by SPOAuthClient::execute_request(), SPHTTPClient::execute_request(), SPHTTPClient::post(), and SPOAuthClient::set_request_options().

const HTTP_MOVED_PERMANENTLY = 301
const HTTP_NOT_FOUND = 404
const HTTP_OK = 200

RESPONSE CODES CONSTANTS (only most commonly used subset)

Referenced by SPHTTPClient::execute_request(), SPOAuthClient::get_access_token(), and SPOAuthClient::get_token().

const HTTP_UNAUTHORIZED = 401
The documentation for this class was generated from the following file:
  • Svetlozar.NET/SPCommon.php


SPContacts Class Reference

Inheritance diagram for SPContacts:
[legend]
Collaboration diagram for SPContacts:
[legend]

Public Member Functions

GetContacts ()
Reset ()
GetState ()
RestoreState ($state)
GetContactsArrays ()

Data Fields

$CaptchaUrl
$RawSource
All public fields will be populated as return.
$ReturnUnparsed
if set to true only raw source will be set, no contacts data will be parsed, default is false
$Error
if error has been returned this will be set to a non-zero constant defined above
$ContactsCount = 0

Protected Member Functions

SetOptions ($options)
GetContactsData ()
ParseContactsData ()

Protected Attributes

$username
$password
$captcha
$return_arrays = false
$client
expected SPHTTPClient or subclass of it

Detailed Description

Author:
Svetlozar Petrov http://svetlozar.net Base class for any specific client login based contact importer classes

Member Function Documentation

GetContacts ( )

Common implementation for GetContacts, subclasses should not have to reimplement this Params are all optional, if provided only the first 4 will be considered in the following order:

Parameters:
$username
$password
$captcha | - only if required
$state | - required together with captcha, must be the string returned by GetState() when ERROR_CAPTCHA_REQUIRED is returned
Returns:
bool - true if contacts were retrieved successfully, false otherwise

Reimplemented from SPContactsBase.

References ContactsResponses::ERROR_NO_USERPASSWORD, and SetOptions().

Here is the call graph for this function:

GetContactsArrays ( ) [inherited]

Common implementation for GetContacts, subclasses should not have to reimplement this Params are all optional, if provided only the first 4 will be considered in the following order:

Parameters:
$username
$password
$captcha | - only if required
$state | - required together with captcha, must be the string returned by GetState() when ERROR_CAPTCHA_REQUIRED is returned
Returns:
bool - true if contacts were retrieved successfully, false otherwise

References SPContactsBase::GetContacts(), and SPContactsBase::SetOptions().

Here is the call graph for this function:

GetContactsData ( ) [abstract, protected, inherited]

Called internally, needs to be populated in subclasses Needs to set RawSource for ParseContacsData to work on

Returns:
bool - true if contacts data source has been retrieved successfully

Reimplemented in AOL, Gmail, Hotmail, Plaxo, SPContactsExtAuth, YahooExtAuth, and Yahoo.

Referenced by SPContactsBase::GetContacts().

Here is the caller graph for this function:

GetState ( )

Returns string that can be later used to restore object state

Returns:
string

Implements IObjectState.

Reimplemented in Gmail.

ParseContactsData ( ) [abstract, protected, inherited]

Called internally, needs to be implemented in subclasses - parse the raw source into

Returns:
bool - true if more than 0 contacts were parsed from the source

Reimplemented in AOL, GmailExtAuth, Gmail, Hotmail, PlaxoExtAuth, Plaxo, YahooExtAuth, and Yahoo.

Referenced by SPContactsBase::GetContacts().

Here is the caller graph for this function:

Reset ( )

Reset options, contacts data etc

Reimplemented from SPContactsBase.

Referenced by SetOptions().

Here is the caller graph for this function:

RestoreState ( $ state )

Restore state from previous state string

Parameters:
$state - string returned by GetState()

Implements IObjectState.

Reimplemented in Gmail.

Referenced by SetOptions().

Here is the caller graph for this function:

SetOptions ( $ options ) [protected]

Called internally with parameters from constructor or GetContacts()

Parameters:
$options

Reimplemented from SPContactsBase.

References Reset(), and RestoreState().

Referenced by GetContacts().

Here is the call graph for this function:

Here is the caller graph for this function:

Field Documentation

$captcha [protected]
$CaptchaUrl
$client [protected, inherited]
$ContactsCount = 0 [inherited]
$Error [inherited]
$password [protected]
$RawSource [inherited]

will be populated with unparsed contents used for generating the contacts collection

$return_arrays = false [protected, inherited]
$ReturnUnparsed [inherited]
$username [protected]
The documentation for this class was generated from the following file:
  • Svetlozar.NET/Contacts/SPContacts.base.php


SPContactsBase Class Reference

Inheritance diagram for SPContactsBase:
[legend]

Public Member Functions

Reset ()
GetContacts ()
GetContactsArrays ()

Data Fields

$RawSource
All public fields will be populated as return.
$ReturnUnparsed
if set to true only raw source will be set, no contacts data will be parsed, default is false
$Error
if error has been returned this will be set to a non-zero constant defined above
$ContactsCount = 0

Protected Member Functions

SetOptions ($options)
GetContactsData ()
ParseContactsData ()

Protected Attributes

$return_arrays = false
$client
expected SPHTTPClient or subclass of it

Member Function Documentation

GetContacts ( )

Common implementation for GetContacts, subclasses should not have to reimplement this Params are all optional, if provided only the first 4 will be considered in the following order:

Parameters:
$username
$password
$captcha | - only if required
$state | - required together with captcha, must be the string returned by GetState() when ERROR_CAPTCHA_REQUIRED is returned
Returns:
bool - true if contacts were retrieved successfully, false otherwise

Reimplemented in SPContacts, SPContactsExtAuth, and YahooExtAuth.

References GetContactsData(), ParseContactsData(), and SetOptions().

Referenced by GetContactsArrays().

Here is the call graph for this function:

Here is the caller graph for this function:

GetContactsArrays ( )

Common implementation for GetContacts, subclasses should not have to reimplement this Params are all optional, if provided only the first 4 will be considered in the following order:

Parameters:
$username
$password
$captcha | - only if required
$state | - required together with captcha, must be the string returned by GetState() when ERROR_CAPTCHA_REQUIRED is returned
Returns:
bool - true if contacts were retrieved successfully, false otherwise

References GetContacts(), and SetOptions().

Here is the call graph for this function:

GetContactsData ( ) [abstract, protected]

Called internally, needs to be populated in subclasses Needs to set RawSource for ParseContacsData to work on

Returns:
bool - true if contacts data source has been retrieved successfully

Reimplemented in AOL, Gmail, Hotmail, Plaxo, SPContactsExtAuth, YahooExtAuth, and Yahoo.

Referenced by GetContacts().

Here is the caller graph for this function:

ParseContactsData ( ) [abstract, protected]

Called internally, needs to be implemented in subclasses - parse the raw source into

Returns:
bool - true if more than 0 contacts were parsed from the source

Reimplemented in AOL, GmailExtAuth, Gmail, Hotmail, PlaxoExtAuth, Plaxo, YahooExtAuth, and Yahoo.

Referenced by GetContacts().

Here is the caller graph for this function:

Reset ( ) [abstract]

Reset options, contacts data etc

Reimplemented in SPContacts, and SPContactsExtAuth.

SetOptions ( $ options ) [abstract, protected]
Parameters:
array of options to set (order matters)

Reimplemented in SPContacts, and SPContactsExtAuth.

Referenced by GetContacts(), and GetContactsArrays().

Here is the caller graph for this function:

Field Documentation

$client [protected]
$ContactsCount = 0
$Error
$RawSource

will be populated with unparsed contents used for generating the contacts collection

$return_arrays = false [protected]
$ReturnUnparsed
The documentation for this class was generated from the following file:
  • Svetlozar.NET/Contacts/SPContacts.base.php


SPContactsExtAuth Class Reference

Inheritance diagram for SPContactsExtAuth:
[legend]
Collaboration diagram for SPContactsExtAuth:
[legend]

Public Member Functions

Reset ()
GetContacts ()
GetState ()
RestoreState ($state)
GetContactsData ()
GetContactsArrays ()

Data Fields

$contacts_url = ""
must be defined in subclasses
$UserAuthorizationUrl = ""
will be set to authorization url that the user needs to be redirected to
$UserAuthorizationNeeded = false
will be set to true if the user needs to authorize a token
$RawSource
All public fields will be populated as return.
$ReturnUnparsed
if set to true only raw source will be set, no contacts data will be parsed, default is false
$Error
if error has been returned this will be set to a non-zero constant defined above
$ContactsCount = 0

Protected Member Functions

SetOptions ($options)
ParseContactsData ()

Protected Attributes

$url_key = ""
must be defined in subclasses (correspond to keys in settings.php)
$auth_key = ""
$return_arrays = false
$client
expected SPHTTPClient or subclass of it

Detailed Description

Author:
Svetlozar Petrov http://svetlozar.net Base class for any specific external authentication based contact importer classes

Member Function Documentation

GetContacts ( )

Common implementation for GetContacts, subclasses should not have to reimplement this Params are all optional, if provided only the first 4 will be considered in the following order:

Parameters:
$username
$password
$captcha | - only if required
$state | - required together with captcha, must be the string returned by GetState() when ERROR_CAPTCHA_REQUIRED is returned
Returns:
bool - true if contacts were retrieved successfully, false otherwise

Reimplemented from SPContactsBase.

Reimplemented in YahooExtAuth.

References ContactsResponses::ERROR_EXTERNAL_AUTH, ContactsResponses::ERROR_UNKNOWN, SPOAuthClient::OAUTH_ACCESS_ERROR, SPOAuthClient::OAUTH_HTTP_ERROR, SPOAuthClient::OAUTH_RESPONSE_UNKNOWN, and SPOAuthClient::OAUTH_USER_AUTH.

GetContactsArrays ( ) [inherited]

Common implementation for GetContacts, subclasses should not have to reimplement this Params are all optional, if provided only the first 4 will be considered in the following order:

Parameters:
$username
$password
$captcha | - only if required
$state | - required together with captcha, must be the string returned by GetState() when ERROR_CAPTCHA_REQUIRED is returned
Returns:
bool - true if contacts were retrieved successfully, false otherwise

References SPContactsBase::GetContacts(), and SPContactsBase::SetOptions().

Here is the call graph for this function:

GetContactsData ( )

Base implementation, expected $contacts_url to be overriden in subclasses

Reimplemented from SPContactsBase.

Reimplemented in YahooExtAuth.

References SPOAuthClient::OAUTH_USER_AUTH.

GetState ( )

Returns string that can be later used to restore object state

Returns:
string

Implements IObjectState.

ParseContactsData ( ) [abstract, protected, inherited]

Called internally, needs to be implemented in subclasses - parse the raw source into

Returns:
bool - true if more than 0 contacts were parsed from the source

Reimplemented in AOL, GmailExtAuth, Gmail, Hotmail, PlaxoExtAuth, Plaxo, YahooExtAuth, and Yahoo.

Referenced by SPContactsBase::GetContacts().

Here is the caller graph for this function:

Reset ( )

Reset options, contacts data etc

Reimplemented from SPContactsBase.

Referenced by SetOptions().

Here is the caller graph for this function:

RestoreState ( $ state )

Restore state from previous state string

Parameters:
$state - string returned by GetState()

Implements IObjectState.

SetOptions ( $ options ) [protected]

Called internally with parameters from constructor or GetContacts()

Parameters:
$options

Reimplemented from SPContactsBase.

References Reset().

Here is the call graph for this function:

Field Documentation

$auth_key = "" [protected]

Reimplemented in GmailExtAuth, PlaxoExtAuth, and YahooExtAuth.

$client [protected, inherited]
$contacts_url = ""

Reimplemented in GmailExtAuth, PlaxoExtAuth, and YahooExtAuth.

$ContactsCount = 0 [inherited]
$Error [inherited]
$RawSource [inherited]

will be populated with unparsed contents used for generating the contacts collection

$return_arrays = false [protected, inherited]
$ReturnUnparsed [inherited]
$url_key = "" [protected]

Reimplemented in GmailExtAuth, PlaxoExtAuth, and YahooExtAuth.

$UserAuthorizationNeeded = false
$UserAuthorizationUrl = ""

Any responses are the same as SPOAuthClient responses only errors will be returned

The documentation for this class was generated from the following file:
  • Svetlozar.NET/Contacts/SPContacts.base.php


SPContactsItem Class Reference

Data Fields

$name
$email

Detailed Description

----------------------------------------------------------------------------- Copyright 2006-2010, Svetlozar Petrov. All rights reserved. http://svetlozar.net

Confidential and Proprietary, Not For Public Release.

No redistribution allowed without prior permission (see licence for details) The above notice must remain unmodified in every source code file ----------------------------------------------------------------------------- Simple class for name/email pair

Field Documentation

$email
$name
The documentation for this class was generated from the following file:
  • Svetlozar.NET/Contacts/SPContacts.base.php


SPHTTPClient Class Reference

Inheritance diagram for SPHTTPClient:
[legend]
Collaboration diagram for SPHTTPClient:
[legend]

Public Member Functions

get_curl_state ()
get_curl_opts ()
execute_request ($http_request_method, $url, $data=null, $number_redirects=0)
get ($url, $data=null, $number_redirects=0)
post ($url, $data=null, $number_redirects=0)
header_function ($ch, $header)

Data Fields

$auto_redirect = true
auto redirect when location header is received
$auto_redirect_curl = true
if set to true the auto redirect will be done within curl, this is much faster, set to false if CUROPT_FOLLOWLOCATION is disabled
$auto_redirect_max = 15
maximum redirects to follow
$curl_error_code = 0
in case curl returns an error this is where to look for it
$curl_error_text = ""
if error returned from curl this will be populated, so check here fist if there is nothing in the response body
$return_response_headers = true
set to true to populate $http_response_headers
$return_response_body = false
when false execute_request will return boolean http_response_code == 200
$http_response_code
code returned from the response
$http_response_text
the text returned with the http response code
$http_response_location = ""
last url of the request
$http_response_headers
will be populated with 2 parallel arrays, [0] => keys, [1] => values, this is becase header may be sent multiple times
$response_content_type
if given in the response header this will be populated
$response_charset
if given in the response header this will be populated
$http_response_body
$timeout = 40
number of seconds before curl times out
$request_headers
any headers to send - must be given as assoc array
$http_proxy = null
you may specify proxy per instance or provide global one in SPHTTPClient::global_http_proxy
$curl_user_agent
$curl_set_referrer = true

Static Public Attributes

static $global_http_proxy = null

Protected Member Functions

reset_curl_state ($curlopts=null)
initopts ()
handles_set_property ($property)
handles_get_property ($property)
set_request_options ()
handle_response_headers ($ch)

Detailed Description

----------------------------------------------------------------------------- Copyright 2006-2010, Svetlozar Petrov. All rights reserved. http://svetlozar.net

Confidential and Proprietary, Not For Public Release.

No redistribution allowed without prior permission (see licence for details) The above notice must remain unmodified in every source code file -----------------------------------------------------------------------------

Author:
Svetlozar Petrov Curl wrapper class - only GET/POST requests are being handled, for PUT I would suggest setting the CURLOPT_WRITEFUNCTION and handling the request that way

Member Function Documentation

execute_request | ( | $ | http_request_method,
 |  | $ | url,
 |  | $ | data = null,
 |  | $ | number_redirects = 0
 | ) |  |

Execute a GET/POST request with the provided so far CURL options

Parameters:
$http_request_type | GET/POST
$url
$data | - for GET this should be assoc array, for POST a string or assoc array
$number_redirects
Returns:
bool or response body

Reimplemented in SPOAuthClient.

References SPConstants::HTTP_METHOD_GET, SPConstants::HTTP_METHOD_POST, SPConstants::HTTP_OK, SPUtils::parse_query(), post(), and set_request_options().

Referenced by get(), and post().

Here is the call graph for this function:

Here is the caller graph for this function:

get | ( | $ | url,
 |  | $ | data = null,
 |  | $ | number_redirects = 0
 | ) |  |

Alias for execute_request (called with "GET" as the request method)

Parameters:
$url
$data
$number_redirects
Returns:
execute_request result

References execute_request(), and SPConstants::HTTP_METHOD_GET.

Here is the call graph for this function:

get_curl_opts ( )

Returns all curl options that have been set (no serialization)

Returns:
array
get_curl_state ( )

Returns serialized curl opts (can be used for restoring an SPHTTPClient object to a previous state by calling reset_state with the string produced from get_state)

Returns:
string
handle_response_headers ( $ ch ) [protected]

Handle any headers of interest Curl handle is provided if options need to be set directly on it

Reimplemented in SPHTTPSession.

Referenced by header_function().

Here is the caller graph for this function:

handles_get_property ( $ property ) [protected]

CURLINFO_* properties are automatically resolved, allowing access to $this->CURLINFO_* that are not explicitly defined

Parameters:
$property - property name
Returns:
bool - true if property starts with CURLINFO_
handles_set_property ( $ property ) [protected]

SPHTTPClient automatically handles CURLOPT_* properties for any other false will be returned

Parameters:
string $property - property name
Returns:
boolean - true if current class can handle a property with the property name provided
header_function | ( | $ | ch,
 |  | $ | header
 | ) |  |

Callback from CURL - handle headers

Parameters:
$ch | - curl handle
$header | - header returned
Parameters:
header parse any useful headers and cookies

References handle_response_headers().

Here is the call graph for this function:

initopts ( ) [protected]

Initialize common curl options, these are stored internally, will be passed to curl later This function is called from the constructor, you can override any CURLOPT_ properties later

References $global_http_proxy.

Referenced by reset_curl_state().

Here is the caller graph for this function:

post | ( | $ | url,
 |  | $ | data = null,
 |  | $ | number_redirects = 0
 | ) |  |

Alias for execute_request (called with "POST" as the request method, and url encoded data)

Parameters:
$url
$data
$number_redirects
Returns:
execute_request result

References execute_request(), SPConstants::HTTP_METHOD_POST, and SPUtils::join_key_values_encode().

Referenced by GoogleLoginClient::Authenticate(), and execute_request().

Here is the call graph for this function:

Here is the caller graph for this function:

reset_curl_state ( $ curlopts = null ) [protected]

Reset curl options to previous or empty state (should be only used from constructor)

References initopts().

Here is the call graph for this function:

set_request_options ( ) [protected]

Add any options, overwrite options etc (a hook for subclasses to modify the request before execution) __request_query_parms is avalable here before the url has been set for post data check the stored post fields

Reimplemented in SPHTTPSession, and SPOAuthClient.

References SPUtils::array_map_assoc(), SPUtils::join_key_values_assoc(), and SPUtils::url_from_parts().

Referenced by execute_request().

Here is the call graph for this function:

Here is the caller graph for this function:

Field Documentation

$auto_redirect = true
$auto_redirect_curl = true
$auto_redirect_max = 15
$curl_error_code = 0
$curl_error_text = ""
$curl_set_referrer = true
$curl_user_agent
$global_http_proxy = null [static]

if you need to have all connections of SPHTTPClient and its subclasses go through proxy specify it here (otherwise you can specify it per instance in $http_proxy) expected format is 'http://proxy.address:port'

Referenced by initopts().

$http_proxy = null
$http_response_body
$http_response_code
$http_response_headers
$http_response_location = ""
$http_response_text
$request_headers
$response_charset
$response_content_type
$return_response_body = false
$return_response_headers = true
$timeout = 40
The documentation for this class was generated from the following file:
  • Svetlozar.NET/WebClients/SPHTTPClient.php


SPHTTPSession Class Reference

Inheritance diagram for SPHTTPSession:
[legend]
Collaboration diagram for SPHTTPSession:
[legend]

Public Member Functions

reset_state ($cookies=null)
get_all_cookies ()
get_cookies_state ()
reset_cookies_state ($cookies)
set_cookie ($cookie_header, $host, $https_response=false)
get_simple_cookie ($cookie_name)
get_cookie ($url)
get_curl_state ()
get_curl_opts ()
execute_request ($http_request_method, $url, $data=null, $number_redirects=0)
get ($url, $data=null, $number_redirects=0)
post ($url, $data=null, $number_redirects=0)
header_function ($ch, $header)

Data Fields

$auto_redirect = true
auto redirect when location header is received
$auto_redirect_curl = true
if set to true the auto redirect will be done within curl, this is much faster, set to false if CUROPT_FOLLOWLOCATION is disabled
$auto_redirect_max = 15
maximum redirects to follow
$curl_error_code = 0
in case curl returns an error this is where to look for it
$curl_error_text = ""
if error returned from curl this will be populated, so check here fist if there is nothing in the response body
$return_response_headers = true
set to true to populate $http_response_headers
$return_response_body = false
when false execute_request will return boolean http_response_code == 200
$http_response_code
code returned from the response
$http_response_text
the text returned with the http response code
$http_response_location = ""
last url of the request
$http_response_headers
will be populated with 2 parallel arrays, [0] => keys, [1] => values, this is becase header may be sent multiple times
$response_content_type
if given in the response header this will be populated
$response_charset
if given in the response header this will be populated
$http_response_body
$timeout = 40
number of seconds before curl times out
$request_headers
any headers to send - must be given as assoc array
$http_proxy = null
you may specify proxy per instance or provide global one in SPHTTPClient::global_http_proxy
$curl_user_agent
$curl_set_referrer = true

Static Public Attributes

static $global_http_proxy = null

Protected Member Functions

handle_response_headers ($ch)
set_request_options ()
reset_curl_state ($curlopts=null)
initopts ()
handles_set_property ($property)
handles_get_property ($property)

Detailed Description

----------------------------------------------------------------------------- Copyright 2006-2010, Svetlozar Petrov. All rights reserved. http://svetlozar.net

Confidential and Proprietary, Not For Public Release.

No redistribution allowed without prior permission (see licence for details) The above notice must remain unmodified in every source code file -----------------------------------------------------------------------------

Author:
Svetlozar Petrov http://svetlozar.net A cookie collection wrapper on top of SPHTTPClient, cookie handling is done automatically for each request/redirect

Member Function Documentation

execute_request | ( | $ | http_request_method,
 |  | $ | url,
 |  | $ | data = null,
 |  | $ | number_redirects = 0 |
 | ) |  |  | [inherited]

Execute a GET/POST request with the provided so far CURL options

Parameters:
$http_request_type | GET/POST
$url
$data | - for GET this should be assoc array, for POST a string or assoc array
$number_redirects
Returns:
bool or response body

Reimplemented in SPOAuthClient.

References SPConstants::HTTP_METHOD_GET, SPConstants::HTTP_METHOD_POST, SPConstants::HTTP_OK, SPUtils::parse_query(), SPHTTPClient::post(), and SPHTTPClient::set_request_options().

Referenced by SPHTTPClient::get(), and SPHTTPClient::post().

Here is the call graph for this function:

Here is the caller graph for this function:

get | ( | $ | url,
 |  | $ | data = null,
 |  | $ | number_redirects = 0 |
 | ) |  |  | [inherited]

Alias for execute_request (called with "GET" as the request method)

Parameters:
$url
$data
$number_redirects
Returns:
execute_request result

References SPHTTPClient::execute_request(), and SPConstants::HTTP_METHOD_GET.

Here is the call graph for this function:

get_all_cookies ( )

Return all stored cookies (no serialization done)

Returns:
array
get_cookie ( $ url )

Build and return cookie header string for the given url

Parameters:
$url

References SPUtils::join_key_values_assoc().

Referenced by handle_response_headers(), and set_request_options().

Here is the call graph for this function:

Here is the caller graph for this function:

get_cookies_state ( )

Return the current cookies serialized (can be used to later restore a cookie collection to a previous state)

Returns:
string
get_curl_opts ( ) [inherited]

Returns all curl options that have been set (no serialization)

Returns:
array
get_curl_state ( ) [inherited]

Returns serialized curl opts (can be used for restoring an SPHTTPClient object to a previous state by calling reset_state with the string produced from get_state)

Returns:
string
get_simple_cookie ( $ cookie_name )

Return a simple cookie value

Parameters:
$cookie_name
Returns:
string - cookie value
handle_response_headers ( $ ch ) [protected]

Parse cookies from the response headers and set cookies directly to the curl resource if redirect is done within curl

Reimplemented from SPHTTPClient.

References get_cookie(), and set_cookie().

Here is the call graph for this function:

handles_get_property ( $ property ) [protected, inherited]

CURLINFO_* properties are automatically resolved, allowing access to $this->CURLINFO_* that are not explicitly defined

Parameters:
$property - property name
Returns:
bool - true if property starts with CURLINFO_
handles_set_property ( $ property ) [protected, inherited]

SPHTTPClient automatically handles CURLOPT_* properties for any other false will be returned

Parameters:
string $property - property name
Returns:
boolean - true if current class can handle a property with the property name provided
header_function | ( | $ | ch,
 |  | $ | header |
 | ) |  |  | [inherited]

Callback from CURL - handle headers

Parameters:
$ch | - curl handle
$header | - header returned
Parameters:
header parse any useful headers and cookies

References SPHTTPClient::handle_response_headers().

Here is the call graph for this function:

initopts ( ) [protected, inherited]

Initialize common curl options, these are stored internally, will be passed to curl later This function is called from the constructor, you can override any CURLOPT_ properties later

References SPHTTPClient::$global_http_proxy.

Referenced by SPHTTPClient::reset_curl_state().

Here is the caller graph for this function:

post | ( | $ | url,
 |  | $ | data = null,
 |  | $ | number_redirects = 0 |
 | ) |  |  | [inherited]

Alias for execute_request (called with "POST" as the request method, and url encoded data)

Parameters:
$url
$data
$number_redirects
Returns:
execute_request result

References SPHTTPClient::execute_request(), SPConstants::HTTP_METHOD_POST, and SPUtils::join_key_values_encode().

Referenced by GoogleLoginClient::Authenticate(), and SPHTTPClient::execute_request().

Here is the call graph for this function:

Here is the caller graph for this function:

reset_cookies_state ( $ cookies )

Reset cookies to previous or empty state

Referenced by reset_state().

Here is the caller graph for this function:

reset_curl_state ( $ curlopts = null ) [protected, inherited]

Reset curl options to previous or empty state (should be only used from constructor)

References SPHTTPClient::initopts().

Here is the call graph for this function:

reset_state ( $ cookies = null )

Clear cookies and reset curl options

See also:
SPHTTPClient::reset_state()

References reset_cookies_state().

Here is the call graph for this function:

set_cookie | ( | $ | cookie_header,
 |  | $ | host,
 |  | $ | https_response = false
 | ) |  |

Set cookie expects the contents of a Set-Cookie header and the host that returned Set-Cookie

Parameters:
string | $cookie_header - set-cookie header string to parse
string | $host - host that returned the set-cookie header
bool | $https_response - set the flag to true if the Set-Cookie header was received over https

Referenced by handle_response_headers().

Here is the caller graph for this function:

set_request_options ( ) [protected]

Intercept set request options to add cookies for the current request

Reimplemented from SPHTTPClient.

References get_cookie().

Here is the call graph for this function:

Field Documentation

$auto_redirect = true [inherited]
$auto_redirect_curl = true [inherited]
$auto_redirect_max = 15 [inherited]
$curl_error_code = 0 [inherited]
$curl_error_text = "" [inherited]
$curl_set_referrer = true [inherited]
$curl_user_agent [inherited]
$global_http_proxy = null [static, inherited]

if you need to have all connections of SPHTTPClient and its subclasses go through proxy specify it here (otherwise you can specify it per instance in $http_proxy) expected format is 'http://proxy.address:port'

Referenced by SPHTTPClient::initopts().

$http_proxy = null [inherited]
$http_response_body [inherited]
$http_response_code [inherited]
$http_response_headers [inherited]
$http_response_location = "" [inherited]
$http_response_text [inherited]
$request_headers [inherited]
$response_charset [inherited]
$response_content_type [inherited]
$return_response_body = false [inherited]
$return_response_headers = true [inherited]
$timeout = 40 [inherited]
The documentation for this class was generated from the following file:
  • Svetlozar.NET/WebClients/SPHTTPSession.php


SPOAuthClient Class Reference

Inheritance diagram for SPOAuthClient:
[legend]
Collaboration diagram for SPOAuthClient:
[legend]

Public Member Functions

GetState ()
interface implementation
RestoreState ($state_str)
reset_oauth_parms ()
get_auth_header ($parms)
get_user_authorization_url ()
set_oauth_parms ($oauth_parms=null, $oauth_urls=null)
execute_request ($http_request_method, $url, $data=null, $number_redirects=0)
attempt_request ($http_request_method, $url, $data=null)
get_request_token ()
get_access_token ()
base_auth_parms ()
get_curl_state ()
get_curl_opts ()
get ($url, $data=null, $number_redirects=0)
post ($url, $data=null, $number_redirects=0)
header_function ($ch, $header)

Static Public Member Functions

static | sign_base_string ($algo, $string_to_sign, $consumer_secret, $token_secret)
static | construct_base_string ()

Data Fields

const | HTTP_AUTH_HEADER = 'HEADER'
const | HTTP_AUTH_POST = SPConstants::HTTP_METHOD_POST
const | HTTP_AUTH_GET = SPConstants::HTTP_METHOD_GET
const | OAUTH_RESPONSE_UNKNOWN = 'UNKNOWN'
RESPONSES.
const | OAUTH_USER_AUTH = 'UserAuthorizationNeeded'
const | OAUTH_ACCESS_SUCCESS = 'AccessTokenSuccess'
const | OAUTH_ACCESS_ERROR = 'AccessTokenError'
const | OAUTH_HTTP_ERROR = 'HttpError'
$auth_url_request = ""
options properties are named auth_* to not confuse with auto oauth parameters
$auth_url_userauth = ""
$auth_url_access = ""
$auth_url_revoke = ""
$auth_handle_token = true
intercept request, if no token is found get a request token, otherwise if token is not access token get access token and then continue
$auth_oauth_response = SPOAuthClient::OAUTH_RESPONSE_UNKNOWN
will be set to any error/success condition after token request has been made
$auth_http_method = "GET"
set to POST or HEADER, default is GET
$auth_remove_extra = true
remove oauth fields from query or data if set to true (those will be sent only via the specified auth_http_method
$auth_header_realm = ""
$auth_header_name = "Authorization"
if HEADER is specified as the auth_http_method this will be the header name for each request
$auth_user_authorized = false
will be set to true only on successful resource response
$auth_secret = "used in nonce generation, replace with something more unique after instantiating this class to ensure nonce will not collide with previous one"
$private_oauth_parms = array("oauth_consumer_secret", "oauth_token_secret", "oauth_callback_confirmed", "__oauth_access_token")
parms that are not included when signing the request
$include_in_state = array("oauth_token", "oauth_token_secret", "__oauth_access_token")
$auto_redirect = true
auto redirect when location header is received
$auto_redirect_curl = true
if set to true the auto redirect will be done within curl, this is much faster, set to false if CUROPT_FOLLOWLOCATION is disabled
$auto_redirect_max = 15
maximum redirects to follow
$curl_error_code = 0
in case curl returns an error this is where to look for it
$curl_error_text = ""
if error returned from curl this will be populated, so check here fist if there is nothing in the response body
$return_response_headers = true
set to true to populate $http_response_headers
$return_response_body = false
when false execute_request will return boolean http_response_code == 200
$http_response_code
code returned from the response
$http_response_text
the text returned with the http response code
$http_response_location = ""
last url of the request
$http_response_headers
will be populated with 2 parallel arrays, [0] => keys, [1] => values, this is becase header may be sent multiple times
$response_content_type
if given in the response header this will be populated
$response_charset
if given in the response header this will be populated
$http_response_body
$timeout = 40
number of seconds before curl times out
$request_headers
any headers to send - must be given as assoc array
$http_proxy = null
you may specify proxy per instance or provide global one in SPHTTPClient::global_http_proxy
$curl_user_agent
$curl_set_referrer = true

Static Public Attributes

static | $global_http_proxy = null

Protected Member Functions

set_request_options ()
get_token ()
reset_curl_state ($curlopts=null)
initopts ()
handles_set_property ($property)
handles_get_property ($property)
handle_response_headers ($ch)

Detailed Description

----------------------------------------------------------------------------- Copyright 2006-2010, Svetlozar Petrov. All rights reserved. http://svetlozar.net

Confidential and Proprietary, Not For Public Release.

No redistribution allowed without prior permission (see licence for details) The above notice must remain unmodified in every source code file -----------------------------------------------------------------------------

Member Function Documentation

attempt_request | ( | $ | http_request_method,
 |  | $ | url,
 |  | $ | data = null
 | ) |  |

Auto loads a url (if access token provided) otherwise if no access token has been provided it grabs a request token You must have provided oauth parms with constructor, also oauth urls are required (again with constructor) If both URL and oauth_token provided but return is false, check if auth_user_authorized is set to true or false, also check the response code (it could be a bad request)

Parameters:
string | $http_request_method - http method to use for request (may differ from method used to get request/access token
string | $url - url that we want to access
string/array | $data - either url encoded string to post or assoc array (won't be url encoded for post)
Returns:
bool true if session start was successful (if starting session without url but oauth_token exists, it is unknown if this token is authorized till first request) If no token was provided to begin with, then the start session will request a token and return is true if request was successful

References execute_request(), get_access_token(), and get_request_token().

Here is the call graph for this function:

base_auth_parms ( )
Returns:
array of oauth parms to be included in the base string

Referenced by set_request_options().

Here is the caller graph for this function:

static construct_base_string ( ) [static]

Construct base string from multiple assoc arrays (sorted before joined)

Returns:
string

References SPUtils::join_key_values().

Referenced by set_request_options().

Here is the call graph for this function:

Here is the caller graph for this function:

execute_request | ( | $ | http_request_method,
 |  | $ | url,
 |  | $ | data = null,
 |  | $ | number_redirects = 0
 | ) |  |

Execute a GET/POST request with the provided so far CURL options

Parameters:
$http_request_type | GET/POST
$url
$data | - for GET this should be assoc array, for POST a string or assoc array
$number_redirects
Returns:
bool or response body

Reimplemented from SPHTTPClient.

References SPUtils::array_map_assoc(), HTTP_AUTH_POST, SPConstants::HTTP_METHOD_GET, SPConstants::HTTP_METHOD_POST, SPUtils::join_key_values_assoc(), and SPUtils::parse_query().

Referenced by attempt_request(), and get_token().

Here is the call graph for this function:

Here is the caller graph for this function:

get | ( | $ | url,
 |  | $ | data = null,
 |  | $ | number_redirects = 0 |
 | ) |  |  | [inherited]

Alias for execute_request (called with "GET" as the request method)

Parameters:
$url
$data
$number_redirects
Returns:
execute_request result

References SPHTTPClient::execute_request(), and SPConstants::HTTP_METHOD_GET.

Here is the call graph for this function:

get_access_token ( )

If access token is granted (HTTP 200 OK response) the current object can be used for subsequent authorized requests

Returns:
bool true on success

References get_token(), and SPConstants::HTTP_OK.

Referenced by attempt_request().

Here is the call graph for this function:

Here is the caller graph for this function:

get_auth_header ( $ parms )

References SPUtils::join_key_values_assoc().

Referenced by set_request_options().

Here is the call graph for this function:

Here is the caller graph for this function:

get_curl_opts ( ) [inherited]

Returns all curl options that have been set (no serialization)

Returns:
array
get_curl_state ( ) [inherited]

Returns serialized curl opts (can be used for restoring an SPHTTPClient object to a previous state by calling reset_state with the string produced from get_state)

Returns:
string
get_request_token ( )

If request token is granted (HTTP 200 OK response, true will be returned) inspect the response body for parameters needed for next request Parameters passed will be accepted in any given order, one array and one string, if more given the last given will be used

Returns:
bool true on success

References get_token(), OAUTH_RESPONSE_UNKNOWN, and OAUTH_USER_AUTH.

Referenced by attempt_request().

Here is the call graph for this function:

Here is the caller graph for this function:

get_token ( ) [protected]

Get a request/access token, returns true if successful (response body is in http_response_body) Called internally from get_access_token/get_request_token Parameters passed will be accepted in any given order, one bool, one string, if more given the last given will be used

Parameters:
string | $url (access/request/other) token url
bool | $auto_load_response, default is false, true when requesting access token
Returns:
bool - returns true if response is HTTP 200

References execute_request(), HTTP_AUTH_GET, HTTP_AUTH_HEADER, SPConstants::HTTP_OK, and SPUtils::parse_query().

Referenced by get_access_token(), and get_request_token().

Here is the call graph for this function:

Here is the caller graph for this function:

get_user_authorization_url ( )

If auth_oauth_response is OAUTH_USER_AUTH, call this function to get the authorization url (if authorize url had been initialized) Only very base authorization url is returned with appended oauth_token

Returns:
string|string

References OAUTH_USER_AUTH.

GetState ( )

Implements IObjectState.

References SPUtils::join_key_values_encode().

Here is the call graph for this function:

handle_response_headers ( $ ch ) [protected, inherited]

Handle any headers of interest Curl handle is provided if options need to be set directly on it

Reimplemented in SPHTTPSession.

Referenced by SPHTTPClient::header_function().

Here is the caller graph for this function:

handles_get_property ( $ property ) [protected, inherited]

CURLINFO_* properties are automatically resolved, allowing access to $this->CURLINFO_* that are not explicitly defined

Parameters:
$property - property name
Returns:
bool - true if property starts with CURLINFO_
handles_set_property ( $ property ) [protected, inherited]

SPHTTPClient automatically handles CURLOPT_* properties for any other false will be returned

Parameters:
string $property - property name
Returns:
boolean - true if current class can handle a property with the property name provided
header_function | ( | $ | ch,
 |  | $ | header |
 | ) |  |  | [inherited]

Callback from CURL - handle headers

Parameters:
$ch | - curl handle
$header | - header returned
Parameters:
header parse any useful headers and cookies

References SPHTTPClient::handle_response_headers().

Here is the call graph for this function:

initopts ( ) [protected, inherited]

Initialize common curl options, these are stored internally, will be passed to curl later This function is called from the constructor, you can override any CURLOPT_ properties later

References SPHTTPClient::$global_http_proxy.

Referenced by SPHTTPClient::reset_curl_state().

Here is the caller graph for this function:

post | ( | $ | url,
 |  | $ | data = null,
 |  | $ | number_redirects = 0 |
 | ) |  |  | [inherited]

Alias for execute_request (called with "POST" as the request method, and url encoded data)

Parameters:
$url
$data
$number_redirects
Returns:
execute_request result

References SPHTTPClient::execute_request(), SPConstants::HTTP_METHOD_POST, and SPUtils::join_key_values_encode().

Referenced by GoogleLoginClient::Authenticate(), and SPHTTPClient::execute_request().

Here is the call graph for this function:

Here is the caller graph for this function:

reset_curl_state ( $ curlopts = null ) [protected, inherited]

Reset curl options to previous or empty state (should be only used from constructor)

References SPHTTPClient::initopts().

Here is the call graph for this function:

reset_oauth_parms ( )
RestoreState ( $ state_str )

Handle state restoring

Parameters:
$state_str

Implements IObjectState.

References SPUtils::parse_query().

Here is the call graph for this function:

set_oauth_parms | ( | $ | oauth_parms = null,
 |  | $ | oauth_urls = null
 | ) |  |

Set oauth parms internally

Parameters:
array | $oauth_parms - associative array with parameters to set
array | $oauth_urls - associative array with urls and keys: request, authorize, access, revoke (all optional)

References SPUtils::get_values(), and SPUtils::parse_query().

Here is the call graph for this function:

set_request_options ( ) [protected]

Add any options, overwrite options etc (a hook for subclasses to modify the request before execution) __request_query_parms is avalable here before the url has been set for post data check the stored post fields

Reimplemented from SPHTTPClient.

References SPUtils::array_map_assoc(), base_auth_parms(), construct_base_string(), get_auth_header(), HTTP_AUTH_HEADER, SPConstants::HTTP_METHOD_GET, SPConstants::HTTP_METHOD_POST, SPUtils::join_encoded3896(), SPUtils::join_key_values_assoc(), sign_base_string(), and SPUtils::url_from_parts().

Here is the call graph for this function:

static sign_base_string | ( | $ | algo,
 |  | $ | string_to_sign,
 |  | $ | consumer_secret,
 |  | $ | token_secret |
 | ) |  |  | [static]

Sign a base string using the given algoritm (if supported, generate notice otherwise)

Parameters:
$algo
$string_to_sign
$consumer_secret
$token_secret
Returns:
string signiture for the given parms

References SPUtils::join_encoded3896().

Referenced by set_request_options().

Here is the call graph for this function:

Here is the caller graph for this function:

Field Documentation

$auth_handle_token = true
$auth_header_name = "Authorization"
$auth_header_realm = ""
$auth_http_method = "GET"
$auth_oauth_response = SPOAuthClient::OAUTH_RESPONSE_UNKNOWN
$auth_remove_extra = true
$auth_secret = "used in nonce generation, replace with something more unique after instantiating this class to ensure nonce will not collide with previous one"
$auth_url_access = ""
$auth_url_request = ""
$auth_url_revoke = ""
$auth_url_userauth = ""
$auth_user_authorized = false
$auto_redirect = true [inherited]
$auto_redirect_curl = true [inherited]
$auto_redirect_max = 15 [inherited]
$curl_error_code = 0 [inherited]
$curl_error_text = "" [inherited]
$curl_set_referrer = true [inherited]
$curl_user_agent [inherited]
$global_http_proxy = null [static, inherited]

if you need to have all connections of SPHTTPClient and its subclasses go through proxy specify it here (otherwise you can specify it per instance in $http_proxy) expected format is 'http://proxy.address:port'

Referenced by SPHTTPClient::initopts().

$http_proxy = null [inherited]
$http_response_body [inherited]
$http_response_code [inherited]
$http_response_headers [inherited]
$http_response_location = "" [inherited]
$http_response_text [inherited]
$include_in_state = array("oauth_token", "oauth_token_secret", "__oauth_access_token")
$private_oauth_parms = array("oauth_consumer_secret", "oauth_token_secret", "oauth_callback_confirmed", "__oauth_access_token")
$request_headers [inherited]
$response_charset [inherited]
$response_content_type [inherited]
$return_response_body = false [inherited]
$return_response_headers = true [inherited]
$timeout = 40 [inherited]
const HTTP_AUTH_GET = SPConstants::HTTP_METHOD_GET

Referenced by get_token().

const HTTP_AUTH_HEADER = 'HEADER'

http method to use for passing the OAuth parameters may differ from actual request method but if auth method is post, get request will be automatically converted to post

Referenced by get_token(), and set_request_options().

const HTTP_AUTH_POST = SPConstants::HTTP_METHOD_POST

Referenced by execute_request().

const OAUTH_ACCESS_ERROR = 'AccessTokenError'

Referenced by SPContactsExtAuth::GetContacts().

const OAUTH_ACCESS_SUCCESS = 'AccessTokenSuccess'
const OAUTH_HTTP_ERROR = 'HttpError'

Referenced by SPContactsExtAuth::GetContacts().

const OAUTH_RESPONSE_UNKNOWN = 'UNKNOWN'

Referenced by get_request_token(), and SPContactsExtAuth::GetContacts().

const OAUTH_USER_AUTH = 'UserAuthorizationNeeded'

Referenced by get_request_token(), get_user_authorization_url(), YahooExtAuth::GetContacts(), SPContactsExtAuth::GetContacts(), YahooExtAuth::GetContactsData(), and SPContactsExtAuth::GetContactsData().

The documentation for this class was generated from the following file:
  • Svetlozar.NET/WebClients/SPOAuthClient.php


SPUserSettings Class Reference

do not modify, change settings.php instead More...

Collaboration diagram for SPUserSettings:
[legend]

Static Public Member Functions

static | get_settings ($key)

Static Protected Member Functions

static | init ()

Static Protected Attributes

static | $settings

Detailed Description

----------------------------------------------------------------------------- Copyright 2006-2010, Svetlozar Petrov. All rights reserved. http://svetlozar.net

Confidential and Proprietary, Not For Public Release.

No redistribution allowed without prior permission (see licence for details) The above notice must remain unmodified in every source code file -----------------------------------------------------------------------------

Member Function Documentation

static get_settings ( $ key ) [static]

References $settings, and init().

Here is the call graph for this function:

static init ( ) [static, protected]

References $settings, and $settings.

Referenced by get_settings().

Here is the caller graph for this function:

Field Documentation

$settings [static, protected]

Referenced by init().

The documentation for this class was generated from the following file:
  • Svetlozar.NET/UserSettings.php


SPUtils Class Reference

Collaboration diagram for SPUtils:
[legend]

Static Public Member Functions

static | update_url ($url=null, $query_parms, $replace_query=false)
static | current_request_url ()
static | hex_utf8 ($hex)
static | dec_utf8 ($v)
static | decode_html_escaped ($str)
static | parse_query ($query)
static | search_array ($assoc_array, $key)
static | get_values ()
static | get_value ($array, $key)
static | url_from_parts ($url_parts)
static | str_join ()
static | str_concat ()
static | join_key_values_encode ($key_separator, $item_separator)
static | join_key_values_assoc ($key_separator, $item_separator)
static | join_key_values ($key_separator, $item_separator, $keys, $values)
static | array_map_assoc ()
static | array_multimap ()
static | encode_function3986 ()
static | join_encoded3896 ()
static | rfc3986_encode ($value)
static | enforce_safe_char3986 ($value)
static | init ()

Static Public Attributes

static | $encode_callbacks = array ("default" => "rawurlencode")

Detailed Description

Author:
Svetlozar Petrov http://svetlozar.net Class of utility functions, mostly related to handling arrays and any other web request related common tasks

Member Function Documentation

static array_map_assoc ( ) [static]

Map a callback function to both keys and values returning associative array (or arrays if multiple arrays given) If callback produces same value for two different keys only the last one will be included in the resulting array

Parameters:
callable | $callback
array | $array1
array | $array2...
Returns:
array (or array of arrays)

References array_multimap().

Referenced by SPOAuthClient::execute_request(), AOL::GetContactsData(), SPOAuthClient::set_request_options(), and SPHTTPClient::set_request_options().

Here is the call graph for this function:

Here is the caller graph for this function:

static array_multimap ( ) [static]

Accept any number of arrays and returns array of the initial arrays after mapping $callback to each Expected either assoc or index arrays, only values will be changed by the callback call

Parameters:
callable | $callback
array | $array1
array | $array2...
Returns:
array (or array of arrays)

Referenced by array_map_assoc(), get_values(), join_key_values_encode(), and Hotmail::ParseContactsData().

Here is the caller graph for this function:

static current_request_url ( ) [static]

Returns the current request url

Returns:
string

References join_key_values_encode(), and url_from_parts().

Here is the call graph for this function:

static dec_utf8 ( $ v ) [static]

Referenced by hex_utf8().

Here is the caller graph for this function:

static decode_html_escaped ( $ str ) [static]

Referenced by YahooExtAuth::ParseContactsData(), Plaxo::ParseContactsData(), and PlaxoExtAuth::ParseContactsData().

Here is the caller graph for this function:

static encode_function3986 ( ) [static]

References init().

Here is the call graph for this function:

static enforce_safe_char3986 ( $ value ) [static]
static get_value | ( | $ | array,
 |  | $ | key |
 | ) |  |  | [static]

Return value for a given key (case-insensitive) or an empty string if not found

Parameters:
array | $array
string | $key
Returns:
string
static get_values ( ) [static]

Return array of values for a list of keys (case-insensitive), returns empty strings for keys that are not found in the array

Parameters:
array | $array
string | $key1
string | $key2
string | $key3 ...
Returns:
string

References array_multimap().

Referenced by ContactsHandler::handle_request(), and SPOAuthClient::set_oauth_parms().

Here is the call graph for this function:

Here is the caller graph for this function:

static hex_utf8 ( $ hex ) [static]

References dec_utf8().

Here is the call graph for this function:

static init ( ) [static]

Referenced by encode_function3986().

Here is the caller graph for this function:

static join_encoded3896 ( ) [static]

Referenced by SPOAuthClient::set_request_options(), and SPOAuthClient::sign_base_string().

Here is the caller graph for this function:

static join_key_values | ( | $ | key_separator,
 |  | $ | item_separator,
 |  | $ | keys,
 |  | $ | values |
 | ) |  |  | [static]

Join key/values as key followed by key separator followed by value then item separator [key ...]

Parameters:
string | $key_separator
string | $item_separator
array | $keys
array | $values
Returns:
string

Referenced by SPOAuthClient::construct_base_string(), join_key_values_assoc(), and join_key_values_encode().

Here is the caller graph for this function:

static join_key_values_assoc | ( | $ | key_separator,
 |  | $ | item_separator |
 | ) |  |  | [static]

Join key/values as key followed by key separator followed by value then item separator [key ...]

Parameters:
string | $key_separator
string | $item_separator
string | $array (associative array expected)
Returns:
string

References join_key_values().

Referenced by SPOAuthClient::execute_request(), SPOAuthClient::get_auth_header(), SPHTTPSession::get_cookie(), AOL::GetContactsData(), SPOAuthClient::set_request_options(), and SPHTTPClient::set_request_options().

Here is the call graph for this function:

Here is the caller graph for this function:

static join_key_values_encode | ( | $ | key_separator,
 |  | $ | item_separator |
 | ) |  |  | [static]

Join key value arrays (either one assoc array or one array with keys and another with values)

Parameters:
string | $key_separator
string | $item_separator
string | $encode_callback (optional) - must correspond to index in self::encode_callbacks (should not be array!)
array | $keysorassoc - array with keys or array with values
array | $values - if provided the $keysorassoc will be considered array of keys
Returns:
string

References array_multimap(), and join_key_values().

Referenced by GoogleLoginClient::Authenticate(), current_request_url(), SPOAuthClient::GetState(), GoogleLoginClient::GetState(), SPHTTPClient::post(), and update_url().

Here is the call graph for this function:

Here is the caller graph for this function:

static parse_query ( $ query ) [static]

Returns parsed query as assoc array (using parse string which returns it into a parm passed by ref)

Parameters:
string $query
Returns:
array $parsed

Referenced by GoogleLoginClient::Authenticate(), SPOAuthClient::execute_request(), SPHTTPClient::execute_request(), SPOAuthClient::get_token(), ExternalAuthHandler::handle_request(), SPOAuthClient::RestoreState(), GoogleLoginClient::RestoreState(), SPOAuthClient::set_oauth_parms(), and update_url().

Here is the caller graph for this function:

static rfc3986_encode ( $ value ) [static]
static search_array | ( | $ | assoc_array,
 |  | $ | key |
 | ) |  |  | [static]

Search array for a key case insensitive, return key proper cased

Parameters:
string | $needle
array | $assoc_array
Returns:
bool false or properly cased key

Referenced by GoogleLoginClient::Authenticate(), GoogleLoginClient::Authenticated(), GoogleLoginClient::GetState(), GoogleLoginClient::RestoreState(), and GoogleLoginClient::SetSource().

Here is the caller graph for this function:

static str_concat ( ) [static]

Concatenate any number of strings alias for implode("", array($str1, $str2, $str3...))

Parameters:
string | $separator
string | $str1
string | $str2
string | $str3 ...
Returns:
string
static str_join ( ) [static]

Join any number of strings, first parameter is assumed to be glue mostly useful when called from array_map with multiple arrays otherwise use implode($separator, array(str1, str2, str3...))

Parameters:
string | $separator
string | $str1
string | $str2
string | $str3 ...
Returns:
string
static update_url | ( | $ | url = null,
 |  | $ | query_parms,
 |  | $ | replace_query = false |
 | ) |  |  | [static]

Return updated url (current request url if provided url is null) with the provided query parms

Parameters:
string | $url - optional - if not given the current request url will be used instead
array | $query_parms - associative array or ready query string
bool | $replace_query - replace current query completely (default is false which will result in merging the provided query parms with the parms in the url)
Returns:
string

References join_key_values_encode(), parse_query(), and url_from_parts().

Here is the call graph for this function:

static url_from_parts ( $ url_parts ) [static]

Returns the base url (no query) from parts

Parameters:
array $url_parts returned by parse_url
Returns:
string

Referenced by current_request_url(), SPOAuthClient::set_request_options(), SPHTTPClient::set_request_options(), and update_url().

Here is the caller graph for this function:

Field Documentation

$encode_callbacks = array ("default" => "rawurlencode") [static]
The documentation for this class was generated from the following file:
  • Svetlozar.NET/SPCommon.php


Yahoo Class Reference

Inheritance diagram for Yahoo:
[legend]
Collaboration diagram for Yahoo:
[legend]

Public Member Functions

GetContacts ()
Reset ()
GetState ()
RestoreState ($state)
GetContactsArrays ()

Data Fields

$accept_screenname = false
if true, screen names will be converted to email addresses by adding the screenname domain
$screenname_domain = "yahoo.com"
$CaptchaUrl
$RawSource
All public fields will be populated as return.
$ReturnUnparsed
if set to true only raw source will be set, no contacts data will be parsed, default is false
$Error
if error has been returned this will be set to a non-zero constant defined above
$ContactsCount = 0

Protected Member Functions

GetContactsData ()
ParseContactsData ()
SetOptions ($options)

Protected Attributes

$username
$password
$captcha
$return_arrays = false
$client
expected SPHTTPClient or subclass of it

Detailed Description

----------------------------------------------------------------------------- Copyright 2006-2010, Svetlozar Petrov. All rights reserved. http://svetlozar.net

Confidential and Proprietary, Not For Public Release.

No redistribution allowed without prior permission (see licence for details) The above notice must remain unmodified in every source code file -----------------------------------------------------------------------------

Member Function Documentation

GetContacts ( ) [inherited]

Common implementation for GetContacts, subclasses should not have to reimplement this Params are all optional, if provided only the first 4 will be considered in the following order:

Parameters:
$username
$password
$captcha | - only if required
$state | - required together with captcha, must be the string returned by GetState() when ERROR_CAPTCHA_REQUIRED is returned
Returns:
bool - true if contacts were retrieved successfully, false otherwise

Reimplemented from SPContactsBase.

References ContactsResponses::ERROR_NO_USERPASSWORD, and SPContacts::SetOptions().

Here is the call graph for this function:

GetContactsArrays ( ) [inherited]

Common implementation for GetContacts, subclasses should not have to reimplement this Params are all optional, if provided only the first 4 will be considered in the following order:

Parameters:
$username
$password
$captcha | - only if required
$state | - required together with captcha, must be the string returned by GetState() when ERROR_CAPTCHA_REQUIRED is returned
Returns:
bool - true if contacts were retrieved successfully, false otherwise

References SPContactsBase::GetContacts(), and SPContactsBase::SetOptions().

Here is the call graph for this function:

GetContactsData ( ) [protected]

Called internally, needs to be populated in subclasses Needs to set RawSource for ParseContacsData to work on

Returns:
bool - true if contacts data source has been retrieved successfully

Reimplemented from SPContactsBase.

References ContactsResponses::ERROR_INVALID_LOGIN, ContactsResponses::ERROR_NO_USERPASSWORD, and ContactsResponses::ERROR_UNKNOWN.

GetState ( ) [inherited]

Returns string that can be later used to restore object state

Returns:
string

Implements IObjectState.

Reimplemented in Gmail.

ParseContactsData ( ) [protected]

Called internally, needs to be implemented in subclasses - parse the raw source into

Returns:
bool - true if more than 0 contacts were parsed from the source

Reimplemented from SPContactsBase.

References ContactsResponses::ERROR_NO_CONTACTS.

Reset ( ) [inherited]

Reset options, contacts data etc

Reimplemented from SPContactsBase.

Referenced by SPContacts::SetOptions().

Here is the caller graph for this function:

RestoreState ( $ state ) [inherited]

Restore state from previous state string

Parameters:
$state - string returned by GetState()

Implements IObjectState.

Reimplemented in Gmail.

Referenced by SPContacts::SetOptions().

Here is the caller graph for this function:

SetOptions ( $ options ) [protected, inherited]

Called internally with parameters from constructor or GetContacts()

Parameters:
$options

Reimplemented from SPContactsBase.

References SPContacts::Reset(), and SPContacts::RestoreState().

Referenced by SPContacts::GetContacts().

Here is the call graph for this function:

Here is the caller graph for this function:

Field Documentation

$accept_screenname = false
$captcha [protected, inherited]
$CaptchaUrl [inherited]
$client [protected, inherited]
$ContactsCount = 0 [inherited]
$Error [inherited]
$password [protected, inherited]
$RawSource [inherited]

will be populated with unparsed contents used for generating the contacts collection

$return_arrays = false [protected, inherited]
$ReturnUnparsed [inherited]
$screenname_domain = "yahoo.com"
$username [protected, inherited]
The documentation for this class was generated from the following file:
  • Svetlozar.NET/Contacts/Yahoo.php


YahooExtAuth Class Reference

Inheritance diagram for YahooExtAuth:
[legend]
Collaboration diagram for YahooExtAuth:
[legend]

Public Member Functions

GetContacts ()
GetContactsData ()
ParseContactsData ()
Reset ()
GetState ()
RestoreState ($state)
GetContactsArrays ()

Data Fields

$contacts_url = ""
format http://social.yahooapis.com/v1/user/{guid}/contacts
$UserAuthorizationUrl = ""
will be set to authorization url that the user needs to be redirected to
$UserAuthorizationNeeded = false
will be set to true if the user needs to authorize a token
$RawSource
All public fields will be populated as return.
$ReturnUnparsed
if set to true only raw source will be set, no contacts data will be parsed, default is false
$Error
if error has been returned this will be set to a non-zero constant defined above
$ContactsCount = 0

Protected Member Functions

SetOptions ($options)

Protected Attributes

$url_key = "yahoo/urls"
must be defined in subclasses (correspond to keys in settings.php)
$auth_key = "yahoo/oauth"
$return_arrays = false
$client
expected SPHTTPClient or subclass of it

Detailed Description

----------------------------------------------------------------------------- Copyright 2006-2010, Svetlozar Petrov. All rights reserved. http://svetlozar.net

Confidential and Proprietary, Not For Public Release.

No redistribution allowed without prior permission (see licence for details) The above notice must remain unmodified in every source code file ----------------------------------------------------------------------------- Most magic moved to SPContactsExtAuth

Author:
Svetlozar Petrov

Member Function Documentation

GetContacts ( )

Common implementation for GetContacts, subclasses should not have to reimplement this Params are all optional, if provided only the first 4 will be considered in the following order:

Parameters:
$username
$password
$captcha | - only if required
$state | - required together with captcha, must be the string returned by GetState() when ERROR_CAPTCHA_REQUIRED is returned
Returns:
bool - true if contacts were retrieved successfully, false otherwise

Reimplemented from SPContactsExtAuth.

References SPOAuthClient::OAUTH_USER_AUTH.

GetContactsArrays ( ) [inherited]

Common implementation for GetContacts, subclasses should not have to reimplement this Params are all optional, if provided only the first 4 will be considered in the following order:

Parameters:
$username
$password
$captcha | - only if required
$state | - required together with captcha, must be the string returned by GetState() when ERROR_CAPTCHA_REQUIRED is returned
Returns:
bool - true if contacts were retrieved successfully, false otherwise

References SPContactsBase::GetContacts(), and SPContactsBase::SetOptions().

Here is the call graph for this function:

GetContactsData ( )

Base implementation, expected $contacts_url to be overriden in subclasses

Reimplemented from SPContactsExtAuth.

References SPConstants::HTTP_METHOD_GET, and SPOAuthClient::OAUTH_USER_AUTH.

GetState ( ) [inherited]

Returns string that can be later used to restore object state

Returns:
string

Implements IObjectState.

ParseContactsData ( )

Called internally, needs to be implemented in subclasses - parse the raw source into

Returns:
bool - true if more than 0 contacts were parsed from the source

Reimplemented from SPContactsBase.

References SPUtils::decode_html_escaped(), and ContactsResponses::ERROR_NO_CONTACTS.

Here is the call graph for this function:

Reset ( ) [inherited]

Reset options, contacts data etc

Reimplemented from SPContactsBase.

Referenced by SPContactsExtAuth::SetOptions().

Here is the caller graph for this function:

RestoreState ( $ state ) [inherited]

Restore state from previous state string

Parameters:
$state - string returned by GetState()

Implements IObjectState.

SetOptions ( $ options ) [protected, inherited]

Called internally with parameters from constructor or GetContacts()

Parameters:
$options

Reimplemented from SPContactsBase.

References SPContactsExtAuth::Reset().

Here is the call graph for this function:

Field Documentation

$auth_key = "yahoo/oauth" [protected]

Reimplemented from SPContactsExtAuth.

$client [protected, inherited]
$contacts_url = ""

Reimplemented from SPContactsExtAuth.

$ContactsCount = 0 [inherited]
$Error [inherited]
$RawSource [inherited]

will be populated with unparsed contents used for generating the contacts collection

$return_arrays = false [protected, inherited]
$ReturnUnparsed [inherited]
$url_key = "yahoo/urls" [protected]

Reimplemented from SPContactsExtAuth.

$UserAuthorizationNeeded = false [inherited]
$UserAuthorizationUrl = "" [inherited]

Any responses are the same as SPOAuthClient responses only errors will be returned

The documentation for this class was generated from the following file:
  • Svetlozar.NET/Contacts/Yahoo.ext.php


  • All
  • Functions
  • Variables
  • $
  • a
  • b
  • c
  • d
  • e
  • g
  • h
  • i
  • j
  • n
  • o
  • p
  • r
  • s
  • t
  • u
Here is a list of all struct and union fields with links to the structures/unions they belong to:

- $ -

  • $accept_screenname : Yahoo
  • $AccountType : GoogleLoginClient
  • $auth_handle_token : SPOAuthClient
  • $auth_header_name : SPOAuthClient
  • $auth_header_realm : SPOAuthClient
  • $auth_http_method : SPOAuthClient
  • $auth_key : PlaxoExtAuth , SPContactsExtAuth , YahooExtAuth , GmailExtAuth
  • $auth_oauth_response : SPOAuthClient
  • $auth_remove_extra : SPOAuthClient
  • $auth_secret : SPOAuthClient
  • $auth_url_access : SPOAuthClient
  • $auth_url_request : SPOAuthClient
  • $auth_url_revoke : SPOAuthClient
  • $auth_url_userauth : SPOAuthClient
  • $auth_user_authorized : SPOAuthClient
  • $auto_redirect : SPHTTPClient
  • $auto_redirect_curl : SPHTTPClient
  • $auto_redirect_max : SPHTTPClient
  • $base_application_name : GoogleLoginClient
  • $captcha : SPContacts
  • $captcha_base_url : GoogleLoginClient
  • $CaptchaUrl : SPContacts , GoogleLoginClient
  • $ClassName : ContactsClass
  • $client : SPContactsBase
  • $contacts_option : ContactsHandler
  • $contacts_page : ContactsHandler
  • $contacts_url : Gmail , PlaxoExtAuth , Plaxo , SPContactsExtAuth , YahooExtAuth , GmailExtAuth
  • $ContactsClasses : ContactsHelper
  • $ContactsCount : SPContactsBase
  • $curl_error_code : SPHTTPClient
  • $curl_error_text : SPHTTPClient
  • $curl_set_referrer : SPHTTPClient
  • $curl_user_agent : SPHTTPClient
  • $default_class : ContactsHandler
  • $default_domain : Hotmail
  • $email : SPContactsItem
  • $encode_callbacks : SPUtils
  • $Error : SPContactsBase
  • $expect_redirect : ContactsHandler
  • $ExternalAuth : ContactsClass
  • $FileName : ContactsClass
  • $global_http_proxy : SPHTTPClient
  • $http_proxy : SPHTTPClient
  • $http_response_body : SPHTTPClient
  • $http_response_code : SPHTTPClient
  • $http_response_headers : SPHTTPClient
  • $http_response_location : SPHTTPClient
  • $http_response_text : SPHTTPClient
  • $import_form : ContactsHandler
  • $include_in_state : SPOAuthClient
  • $invite_done : ContactsHandler
  • $invite_form : ContactsHandler
  • $login_url : GoogleLoginClient
  • $LoginResponse : GoogleLoginClient
  • $name : SPContactsItem
  • $password : SPContacts
  • $private_oauth_parms : SPOAuthClient
  • $RawSource : SPContactsBase
  • $redirect_url : ContactsHandler
  • $request_headers : SPHTTPClient
  • $response_charset : SPHTTPClient
  • $response_content_type : SPHTTPClient
  • $response_parm : ExternalAuthHandler
  • $return_arrays : SPContactsBase
  • $return_response_body : SPHTTPClient
  • $return_response_headers : SPHTTPClient
  • $ReturnUnparsed : SPContactsBase
  • $screenname_domain : Yahoo
  • $Service : GoogleLoginClient
  • $session_init : ContactsHandler
  • $settings : SPUserSettings
  • $timeout : SPHTTPClient
  • $url_key : PlaxoExtAuth , SPContactsExtAuth , GmailExtAuth , YahooExtAuth
  • $UserAuthorizationNeeded : SPContactsExtAuth
  • $UserAuthorizationUrl : SPContactsExtAuth
  • $username : SPContacts


Graphical Class Hierarchy

Go to the textual class hierarchy


example.doc.html File Reference

FOR INTERNAL USE ONLY. NOT FOR DISTRIBUTION.


external.php File Reference

Data Structures

class ExternalAuthHandler

Variables

$handler = new ExternalAuthHandler()

Variable Documentation

$handler = new ExternalAuthHandler()


index.php File Reference

Variables

$handler = new ContactsHandler()

Variable Documentation

$handler = new ContactsHandler()


example

contacts.done.php File Reference

FOR INTERNAL USE ONLY. NOT FOR DISTRIBUTION.


example

contacts.import.php File Reference

Variables

if (!$this->current_class->ExternalAuth)

Variable Documentation

if($this->error_returned &&$this->error_message)


example

contacts.invite.php File Reference

FOR INTERNAL USE ONLY. NOT FOR DISTRIBUTION.


example

contacts.main.php File Reference

Data Structures

class ContactsHandler


example

contacts.page.php File Reference

Variables

if ($this->display_menu)

Variable Documentation

if($this->display_menu)


example

external.page.php File Reference

Functions

ReturnToParent ()
Redirect (url)

Function Documentation

Redirect ( url )
ReturnToParent ( )


Svetlozar.NET

ContactsHelper.php File Reference

Data Structures

class | ContactsClass
class | ContactsHelper


Svetlozar.NET

index.php File Reference

FOR INTERNAL USE ONLY. NOT FOR DISTRIBUTION.


Svetlozar.NET

init.php File Reference

Enumerations

enum | SVETLOZARNET_DIR

path definitions

More...
enum | SVETLOZARNET_CONTACTS
enum | SVETLOZARNET_WEBCLIENTS

Enumeration Type Documentation

enum SVETLOZARNET_CONTACTS
enum SVETLOZARNET_DIR

----------------------------------------------------------------------------- Copyright 2006-2010, Svetlozar Petrov. All rights reserved. http://svetlozar.net

Confidential and Proprietary, Not For Public Release.

No redistribution allowed without prior permission (see licence for details) The above notice must remain unmodified in every source code file -----------------------------------------------------------------------------

enum SVETLOZARNET_WEBCLIENTS


Svetlozar.NET

Interfaces.php File Reference

Data Structures

interface | IObjectState
interface | IAuthState


Svetlozar.NET

settings.php File Reference

Variables

$callback_url = SPUtils::current_request_url()
this is needed for OAuth revision 1.0a, when this file is included from external.php it will point to the correct location
$settings ["plaxo/oauth"]
defaults to anonymous consumer key (if there is url to register for a key other than anonymous I am not aware of it)
$settings ["plaxo/urls"]
$settings ["google/oauth"]
$settings ["google/urls"]
$settings ["yahoo/oauth"]
$settings ["yahoo/urls"]
token expires in 1 hour (can be refreshed using oauth_session_handle, not done for importing contacts)

Variable Documentation

$callback_url = SPUtils::current_request_url()
$settings["yahoo/urls"]
Initial value:
 array( "request" => "https://api.login.yahoo.com/oauth/v2/get_request_token",
                                                                                "access" => "https://api.login.yahoo.com/oauth/v2/get_token",
                                                                                "authorize" => "",
                                                                                "revoke" => "")
$settings["yahoo/oauth"]
Initial value:
 array( "oauth_consumer_key" => "",
                                                                                "oauth_consumer_secret" => "",
                                                                                "oauth_callback" => $callback_url)

Yahoo does not have anonymous access enabled, so you need to register your application to get a key/secret http://developer.apps.yahoo.com/dashboard/

$settings["google/urls"]
Initial value:
 array( "request" => "https://www.google.com/accounts/OAuthGetRequestToken",
                                                                                "access" => "https://www.google.com/accounts/OAuthGetAccessToken",
                                                                                "authorize" => "https://www.google.com/accounts/OAuthAuthorizeToken",
                                                                                "revoke" => "https://www.google.com/accounts/AuthSubRevokeToken")
$settings["google/oauth"]
Initial value:
 array( "oauth_consumer_key" => "anonymous",
                                                                                "oauth_consumer_secret" => "anonymous",
                                                                                "oauth_callback" => $callback_url)

Default key/secret (register for private ones here: https://www.google.com/accounts/ManageDomains note: you do not need to provide pem file however if you do (even though it won't be used) the security warning will not be displayed by goodgle

$settings["plaxo/urls"]
Initial value:
 array( "request" => "http://www.plaxo.com/oauth/request",
                                                                                "access" => "http://www.plaxo.com/oauth/activate",
                                                                                "authorize" => "http://www.plaxo.com/oauth/authorize",
                                                                                "revoke" => "http://www.plaxo.com/oauth/revoke")
$settings["plaxo/oauth"]
Initial value:
 array( "oauth_consumer_key" => "anonymous",
                                                                                "oauth_consumer_secret" => "",
                                                                                "oauth_callback" => $callback_url)

Referenced by SPUserSettings::get_settings(), and SPUserSettings::init().


Svetlozar.NET

SPCommon.php File Reference

Data Structures

class | SPConstants
class | SPUtils


Svetlozar.NET

UserSettings.php File Reference

Data Structures

class SPUserSettings
do not modify, change settings.php instead More...


AOL.php File Reference

Data Structures

class AOL


Gmail.Ext.php File Reference

Data Structures

class GmailExtAuth


Gmail.php File Reference

Data Structures

class Gmail


Hotmail.php File Reference

Data Structures

class Hotmail


index.php File Reference

FOR INTERNAL USE ONLY. NOT FOR DISTRIBUTION.


Plaxo.Ext.php File Reference

Data Structures

class PlaxoExtAuth


Plaxo.php File Reference

Data Structures

class Plaxo


SPContacts.base.php File Reference

Data Structures

class | SPContactsItem
class | ContactsResponses
class | SPContactsBase
class | SPContacts
class | SPContactsExtAuth


Yahoo.ext.php File Reference

Data Structures

class YahooExtAuth


Yahoo.php File Reference

Data Structures

class Yahoo


GoogleLoginClient.php File Reference

Data Structures

class | GoogleAuthResponses
class | GoogleAccountTypes
class | GoogleLoginClient


SPHTTPClient.php File Reference

Data Structures

class SPHTTPClient


SPHTTPSession.php File Reference

Data Structures

class SPHTTPSession


SPOAuthClient.php File Reference

Data Structures

class SPOAuthClient


  • All
  • Functions
  • Variables
  • Enumerations
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:
  • $callback_url : settings.php
  • $handler : external.php , index.php
  • $settings : settings.php
  • if : contacts.import.php , contacts.page.php
  • Redirect() : external.page.php
  • ReturnToParent() : external.page.php
  • SVETLOZARNET_CONTACTS : init.php
  • SVETLOZARNET_DIR : init.php
  • SVETLOZARNET_WEBCLIENTS : init.php


Data Structures

Here are the data structures with brief descriptions:
AOL |
ContactsClass |
ContactsHandler |
ContactsHelper |
ContactsResponses |
ExternalAuthHandler |
Gmail |
GmailExtAuth |
GoogleAccountTypes |
GoogleAuthResponses |
GoogleLoginClient |
Hotmail |
IAuthState |
IObjectState |
Plaxo |
PlaxoExtAuth |
SPConstants |
SPContacts |
SPContactsBase |
SPContactsExtAuth |
SPContactsItem |
SPHTTPClient |
SPHTTPSession |
SPOAuthClient |
SPUserSettings | Do not modify, change settings.php instead
SPUtils |
Yahoo |
YahooExtAuth |


Data Structure Index

A | C | E | G | H | I | P | S | Y
A
ExternalAuthHandler Hotmail
S
SPHTTPSession
AOL
G
I
SPConstants SPOAuthClient
C
Gmail IAuthState SPContacts SPUserSettings
ContactsClass GmailExtAuth IObjectState SPContactsBase SPUtils
ContactsHandler GoogleAccountTypes
P
SPContactsExtAuth
Y
ContactsHelper GoogleAuthResponses Plaxo SPContactsItem Yahoo
ContactsResponses GoogleLoginClient PlaxoExtAuth SPHTTPClient YahooExtAuth
E
H
A | C | E | G | H | I | P | S | Y


Svetlozar.NET

Svetlozar.NET Directory Reference

Directories

directory | Contacts
directory | WebClients

Files

file | ContactsHelper.php
file | index.php
file | init.php
file | Interfaces.php
file | settings.php
file | SPCommon.php
file | UserSettings.php


WebClients Directory Reference

Files

file | GoogleLoginClient.php
file | index.php
file | SPHTTPClient.php
file | SPHTTPSession.php
file | SPOAuthClient.php


example

example Directory Reference

Files

file | contacts.done.php
file | contacts.import.php
file | contacts.invite.php
file | contacts.main.php
file | contacts.page.php
file | external.page.php


Contacts Directory Reference

Files

file | AOL.php
file | Gmail.Ext.php
file | Gmail.php
file | Hotmail.php
file | index.php
file | Plaxo.Ext.php
file | Plaxo.php
file | SPContacts.base.php
file | Yahoo.ext.php
file | Yahoo.php


Directories

This directory hierarchy is sorted roughly, but not completely, alphabetically:
  • example
  • Svetlozar.NET
    • Contacts
    • WebClients


File List

Here is a list of all files with brief descriptions:
example.doc.html
external.php
index.php
example/contacts.done.php
example/contacts.import.php
example/contacts.invite.php
example/contacts.main.php
example/contacts.page.php
example/external.page.php
Svetlozar.NET/ContactsHelper.php
Svetlozar.NET/index.php
Svetlozar.NET/init.php
Svetlozar.NET/Interfaces.php
Svetlozar.NET/settings.php
Svetlozar.NET/SPCommon.php
Svetlozar.NET/UserSettings.php
Svetlozar.NET/Contacts/AOL.php
Svetlozar.NET/Contacts/Gmail.Ext.php
Svetlozar.NET/Contacts/Gmail.php
Svetlozar.NET/Contacts/Hotmail.php
Svetlozar.NET/Contacts/index.php
Svetlozar.NET/Contacts/Plaxo.Ext.php
Svetlozar.NET/Contacts/Plaxo.php
Svetlozar.NET/Contacts/SPContacts.base.php
Svetlozar.NET/Contacts/Yahoo.ext.php
Svetlozar.NET/Contacts/Yahoo.php
Svetlozar.NET/WebClients/GoogleLoginClient.php
Svetlozar.NET/WebClients/index.php
Svetlozar.NET/WebClients/SPHTTPClient.php
Svetlozar.NET/WebClients/SPHTTPSession.php
Svetlozar.NET/WebClients/SPOAuthClient.php


  • All
  • Functions
  • Variables
  • $
  • a
  • b
  • c
  • d
  • e
  • g
  • h
  • i
  • j
  • n
  • o
  • p
  • r
  • s
  • t
  • u
Here is a list of all struct and union fields with links to the structures/unions they belong to:

- j -

  • join_encoded3896() : SPUtils
  • join_key_values() : SPUtils
  • join_key_values_assoc() : SPUtils
  • join_key_values_encode() : SPUtils


  • All
  • Functions
  • Variables
  • $
  • a
  • b
  • c
  • d
  • e
  • g
  • h
  • i
  • j
  • n
  • o
  • p
  • r
  • s
  • t
  • u
Here is a list of all struct and union fields with links to the structures/unions they belong to:

- n -

  • NotVerified : GoogleAuthResponses


  • All
  • Functions
  • Variables
  • $
  • a
  • b
  • c
  • d
  • e
  • g
  • h
  • i
  • j
  • n
  • o
  • p
  • r
  • s
  • t
  • u
Here is a list of all struct and union fields with links to the structures/unions they belong to:

- o -

  • OAUTH_ACCESS_ERROR : SPOAuthClient
  • OAUTH_ACCESS_SUCCESS : SPOAuthClient
  • OAUTH_HTTP_ERROR : SPOAuthClient
  • OAUTH_RESPONSE_UNKNOWN : SPOAuthClient
  • OAUTH_USER_AUTH : SPOAuthClient


  • All
  • Functions
  • Variables
  • $
  • a
  • b
  • c
  • d
  • e
  • g
  • h
  • i
  • j
  • n
  • o
  • p
  • r
  • s
  • t
  • u
Here is a list of all struct and union fields with links to the structures/unions they belong to:

- a -

  • AccountDeleted : GoogleAuthResponses
  • AccountDisabled : GoogleAuthResponses
  • add_to_session() : ContactsHandler
  • array_map_assoc() : SPUtils
  • array_multimap() : SPUtils
  • attempt_request() : SPOAuthClient
  • Authenticate() : GoogleLoginClient , IAuthState
  • Authenticated() : GoogleLoginClient , GoogleAuthResponses , IAuthState


  • All
  • Functions
  • Variables
  • $
  • a
  • b
  • c
  • d
  • e
  • g
  • h
  • i
  • j
  • n
  • o
  • p
  • r
  • s
  • t
  • u
Here is a list of all struct and union fields with links to the structures/unions they belong to:

- b -

  • BadAuthentication : GoogleAuthResponses
  • base_auth_parms() : SPOAuthClient


  • All
  • Functions
  • Variables
  • $
  • a
  • b
  • c
  • d
  • e
  • g
  • h
  • i
  • j
  • n
  • o
  • p
  • r
  • s
  • t
  • u
Here is a list of all struct and union fields with links to the structures/unions they belong to:

- c -

  • CaptchaRequired : GoogleAuthResponses
  • construct_base_string() : SPOAuthClient
  • current_request_url() : SPUtils


  • All
  • Functions
  • Variables
  • $
  • a
  • b
  • c
  • d
  • e
  • g
  • h
  • i
  • j
  • n
  • o
  • p
  • r
  • s
  • t
  • u
Here is a list of all struct and union fields with links to the structures/unions they belong to:

- d -

  • dec_utf8() : SPUtils
  • decode_html_escaped() : SPUtils


  • All
  • Functions
  • Variables
  • $
  • a
  • b
  • c
  • d
  • e
  • g
  • h
  • i
  • j
  • n
  • o
  • p
  • r
  • s
  • t
  • u
Here is a list of all struct and union fields with links to the structures/unions they belong to:

- e -

  • EmailPasswordMissing : GoogleAuthResponses
  • encode_function3986() : SPUtils
  • enforce_safe_char3986() : SPUtils
  • ERROR_CAPTCHA_REQUIRED : ContactsResponses
  • ERROR_EXTERNAL_AUTH : ContactsResponses
  • ERROR_INVALID_LOGIN : ContactsResponses
  • ERROR_NO_CONTACTS : ContactsResponses
  • ERROR_NO_USERPASSWORD : ContactsResponses
  • ERROR_UNKNOWN : ContactsResponses
  • execute_request() : SPHTTPClient , SPOAuthClient


  • All
  • Functions
  • Variables
  • $
  • a
  • b
  • c
  • d
  • e
  • g
  • h
  • i
  • j
  • n
  • o
  • p
  • r
  • s
  • t
  • u
Here is a list of all struct and union fields with links to the structures/unions they belong to:

- g -

  • get() : SPHTTPClient
  • get_access_token() : SPOAuthClient
  • get_all_cookies() : SPHTTPSession
  • get_auth_header() : SPOAuthClient
  • get_cookie() : SPHTTPSession
  • get_cookies_state() : SPHTTPSession
  • get_curl_opts() : SPHTTPClient
  • get_curl_state() : SPHTTPClient
  • get_form() : ContactsHandler
  • get_from_session() : ContactsHandler
  • get_request_token() : SPOAuthClient
  • get_settings() : SPUserSettings
  • get_simple_cookie() : SPHTTPSession
  • get_token() : SPOAuthClient
  • get_user_authorization_url() : SPOAuthClient
  • get_value() : SPUtils
  • get_values() : SPUtils
  • GetClasses() : ContactsHelper
  • GetContacts() : SPContactsBase , SPContacts , SPContactsExtAuth , YahooExtAuth
  • GetContactsArrays() : SPContactsBase
  • GetContactsData() : YahooExtAuth , Yahoo , SPContactsExtAuth , SPContactsBase , Hotmail , AOL , Gmail , Plaxo
  • GetInstance() : ContactsHelper
  • GetState() : IObjectState , SPOAuthClient , SPContactsExtAuth , Gmail , SPContacts , GoogleLoginClient
  • GOOGLE : GoogleAccountTypes


  • All
  • Functions
  • Variables
  • $
  • a
  • b
  • c
  • d
  • e
  • g
  • h
  • i
  • j
  • n
  • o
  • p
  • r
  • s
  • t
  • u
Here is a list of all struct and union fields with links to the structures/unions they belong to:

- h -

  • handle_request() : ContactsHandler , ExternalAuthHandler
  • handle_response_headers() : SPHTTPSession , SPHTTPClient
  • handles_get_property() : SPHTTPClient
  • handles_set_property() : SPHTTPClient
  • header_function() : SPHTTPClient
  • hex_utf8() : SPUtils
  • HOSTED : GoogleAccountTypes
  • HOSTED_OR_GOOGLE : GoogleAccountTypes
  • HTTP_AUTH_GET : SPOAuthClient
  • HTTP_AUTH_HEADER : SPOAuthClient
  • HTTP_AUTH_POST : SPOAuthClient
  • HTTP_BAD_REQUEST : SPConstants
  • HTTP_FORBIDDEN : SPConstants
  • HTTP_FOUND : SPConstants
  • HTTP_METHOD_GET : SPConstants
  • HTTP_METHOD_NOT_ALLOWED : SPConstants
  • HTTP_METHOD_POST : SPConstants
  • HTTP_MOVED_PERMANENTLY : SPConstants
  • HTTP_NOT_FOUND : SPConstants
  • HTTP_OK : SPConstants
  • HTTP_UNAUTHORIZED : SPConstants
  • HTTPError : GoogleAuthResponses


  • All
  • Functions
  • Variables
  • $
  • a
  • b
  • c
  • d
  • e
  • g
  • h
  • i
  • j
  • n
  • o
  • p
  • r
  • s
  • t
  • u
Here is a list of all struct and union fields with links to the structures/unions they belong to:

- i -

  • IncludeClassFile() : ContactsHelper
  • init() : ContactsHelper , SPUserSettings , SPUtils
  • initopts() : SPHTTPClient
  • IsContactsFile() : ContactsHelper


  • All
  • Functions
  • Variables
  • $
  • a
  • b
  • c
  • d
  • e
  • g
  • h
  • i
  • j
  • n
  • o
  • p
  • r
  • s
  • t
  • u
Here is a list of all struct and union fields with links to the structures/unions they belong to:

- p -

  • parse_emails() : AOL
  • parse_names() : AOL
  • parse_query() : SPUtils
  • ParseContactsData() : YahooExtAuth , SPContactsBase , Plaxo , AOL , Hotmail , Gmail , GmailExtAuth , PlaxoExtAuth , Yahoo
  • post() : SPHTTPClient


  • All
  • Functions
  • Variables
  • $
  • a
  • b
  • c
  • d
  • e
  • g
  • h
  • i
  • j
  • n
  • o
  • p
  • r
  • s
  • t
  • u
Here is a list of all struct and union fields with links to the structures/unions they belong to:

- r -

  • remove_from_session() : ContactsHandler
  • Reset() : SPContactsBase , SPContactsExtAuth , GoogleLoginClient , SPContacts
  • reset_cookies_state() : SPHTTPSession
  • reset_curl_state() : SPHTTPClient
  • reset_oauth_parms() : SPOAuthClient
  • reset_state() : SPHTTPSession
  • RestoreState() : GoogleLoginClient , SPContactsExtAuth , IObjectState , SPOAuthClient , Gmail , SPContacts
  • rfc3986_encode() : SPUtils


  • All
  • Functions
  • Variables
  • $
  • a
  • b
  • c
  • d
  • e
  • g
  • h
  • i
  • j
  • n
  • o
  • p
  • r
  • s
  • t
  • u
Here is a list of all struct and union fields with links to the structures/unions they belong to:

- s -

  • search_array() : SPUtils
  • ServiceDisabled : GoogleAuthResponses
  • ServiceUnavailable : GoogleAuthResponses
  • session_commit() : ContactsHandler
  • session_start() : ContactsHandler
  • set_cookie() : SPHTTPSession
  • set_oauth_parms() : SPOAuthClient
  • set_request_options() : SPHTTPClient , SPHTTPSession , SPOAuthClient
  • SetOptions() : SPContactsBase , SPContactsExtAuth , SPContacts
  • SetSource() : GoogleLoginClient
  • sign_base_string() : SPOAuthClient
  • str_concat() : SPUtils
  • str_join() : SPUtils
  • StripExt() : ContactsHelper


  • All
  • Functions
  • Variables
  • $
  • a
  • b
  • c
  • d
  • e
  • g
  • h
  • i
  • j
  • n
  • o
  • p
  • r
  • s
  • t
  • u
Here is a list of all struct and union fields with links to the structures/unions they belong to:

- t -

  • TermsNotAgreed : GoogleAuthResponses


  • All
  • Functions
  • Variables
  • $
  • a
  • b
  • c
  • d
  • e
  • g
  • h
  • i
  • j
  • n
  • o
  • p
  • r
  • s
  • t
  • u
Here is a list of all struct and union fields with links to the structures/unions they belong to:

- u -

  • Unknown : GoogleAuthResponses
  • update_url() : SPUtils
  • url_from_parts() : SPUtils


  • All
  • Functions
  • Variables
  • a
  • b
  • c
  • d
  • e
  • g
  • h
  • i
  • j
  • p
  • r
  • s
  • u

- a -

  • add_to_session() : ContactsHandler
  • array_map_assoc() : SPUtils
  • array_multimap() : SPUtils
  • attempt_request() : SPOAuthClient
  • Authenticate() : IAuthState , GoogleLoginClient
  • Authenticated() : GoogleLoginClient , IAuthState

- b -

  • base_auth_parms() : SPOAuthClient

- c -

  • construct_base_string() : SPOAuthClient
  • current_request_url() : SPUtils

- d -

  • dec_utf8() : SPUtils
  • decode_html_escaped() : SPUtils

- e -

  • encode_function3986() : SPUtils
  • enforce_safe_char3986() : SPUtils
  • execute_request() : SPHTTPClient , SPOAuthClient

- g -

  • get() : SPHTTPClient
  • get_access_token() : SPOAuthClient
  • get_all_cookies() : SPHTTPSession
  • get_auth_header() : SPOAuthClient
  • get_cookie() : SPHTTPSession
  • get_cookies_state() : SPHTTPSession
  • get_curl_opts() : SPHTTPClient
  • get_curl_state() : SPHTTPClient
  • get_form() : ContactsHandler
  • get_from_session() : ContactsHandler
  • get_request_token() : SPOAuthClient
  • get_settings() : SPUserSettings
  • get_simple_cookie() : SPHTTPSession
  • get_token() : SPOAuthClient
  • get_user_authorization_url() : SPOAuthClient
  • get_value() : SPUtils
  • get_values() : SPUtils
  • GetClasses() : ContactsHelper
  • GetContacts() : SPContactsBase , SPContacts , SPContactsExtAuth , YahooExtAuth
  • GetContactsArrays() : SPContactsBase
  • GetContactsData() : SPContactsExtAuth , Plaxo , Yahoo , Hotmail , YahooExtAuth , AOL , Gmail , SPContactsBase
  • GetInstance() : ContactsHelper
  • GetState() : GoogleLoginClient , IObjectState , Gmail , SPContacts , SPOAuthClient , SPContactsExtAuth

- h -

  • handle_request() : ContactsHandler , ExternalAuthHandler
  • handle_response_headers() : SPHTTPSession , SPHTTPClient
  • handles_get_property() : SPHTTPClient
  • handles_set_property() : SPHTTPClient
  • header_function() : SPHTTPClient
  • hex_utf8() : SPUtils

- i -

  • IncludeClassFile() : ContactsHelper
  • init() : ContactsHelper , SPUserSettings , SPUtils
  • initopts() : SPHTTPClient
  • IsContactsFile() : ContactsHelper

- j -

  • join_encoded3896() : SPUtils
  • join_key_values() : SPUtils
  • join_key_values_assoc() : SPUtils
  • join_key_values_encode() : SPUtils

- p -

  • parse_emails() : AOL
  • parse_names() : AOL
  • parse_query() : SPUtils
  • ParseContactsData() : YahooExtAuth , SPContactsBase , Plaxo , AOL , Hotmail , Gmail , GmailExtAuth , PlaxoExtAuth , Yahoo
  • post() : SPHTTPClient

- r -

  • remove_from_session() : ContactsHandler
  • Reset() : SPContactsBase , SPContactsExtAuth , GoogleLoginClient , SPContacts
  • reset_cookies_state() : SPHTTPSession
  • reset_curl_state() : SPHTTPClient
  • reset_oauth_parms() : SPOAuthClient
  • reset_state() : SPHTTPSession
  • RestoreState() : GoogleLoginClient , SPContactsExtAuth , IObjectState , SPOAuthClient , Gmail , SPContacts
  • rfc3986_encode() : SPUtils

- s -

  • search_array() : SPUtils
  • session_commit() : ContactsHandler
  • session_start() : ContactsHandler
  • set_cookie() : SPHTTPSession
  • set_oauth_parms() : SPOAuthClient
  • set_request_options() : SPOAuthClient , SPHTTPClient , SPHTTPSession
  • SetOptions() : SPContactsBase , SPContacts , SPContactsExtAuth
  • SetSource() : GoogleLoginClient
  • sign_base_string() : SPOAuthClient
  • str_concat() : SPUtils
  • str_join() : SPUtils
  • StripExt() : ContactsHelper

- u -

  • update_url() : SPUtils
  • url_from_parts() : SPUtils


  • All
  • Functions
  • Variables
  • $
  • a
  • b
  • c
  • e
  • g
  • h
  • n
  • o
  • s
  • t
  • u

- $ -

  • $accept_screenname : Yahoo
  • $AccountType : GoogleLoginClient
  • $auth_handle_token : SPOAuthClient
  • $auth_header_name : SPOAuthClient
  • $auth_header_realm : SPOAuthClient
  • $auth_http_method : SPOAuthClient
  • $auth_key : PlaxoExtAuth , SPContactsExtAuth , YahooExtAuth , GmailExtAuth
  • $auth_oauth_response : SPOAuthClient
  • $auth_remove_extra : SPOAuthClient
  • $auth_secret : SPOAuthClient
  • $auth_url_access : SPOAuthClient
  • $auth_url_request : SPOAuthClient
  • $auth_url_revoke : SPOAuthClient
  • $auth_url_userauth : SPOAuthClient
  • $auth_user_authorized : SPOAuthClient
  • $auto_redirect : SPHTTPClient
  • $auto_redirect_curl : SPHTTPClient
  • $auto_redirect_max : SPHTTPClient
  • $base_application_name : GoogleLoginClient
  • $captcha : SPContacts
  • $captcha_base_url : GoogleLoginClient
  • $CaptchaUrl : SPContacts , GoogleLoginClient
  • $ClassName : ContactsClass
  • $client : SPContactsBase
  • $contacts_option : ContactsHandler
  • $contacts_page : ContactsHandler
  • $contacts_url : Gmail , PlaxoExtAuth , Plaxo , SPContactsExtAuth , YahooExtAuth , GmailExtAuth
  • $ContactsClasses : ContactsHelper
  • $ContactsCount : SPContactsBase
  • $curl_error_code : SPHTTPClient
  • $curl_error_text : SPHTTPClient
  • $curl_set_referrer : SPHTTPClient
  • $curl_user_agent : SPHTTPClient
  • $default_class : ContactsHandler
  • $default_domain : Hotmail
  • $email : SPContactsItem
  • $encode_callbacks : SPUtils
  • $Error : SPContactsBase
  • $expect_redirect : ContactsHandler
  • $ExternalAuth : ContactsClass
  • $FileName : ContactsClass
  • $global_http_proxy : SPHTTPClient
  • $http_proxy : SPHTTPClient
  • $http_response_body : SPHTTPClient
  • $http_response_code : SPHTTPClient
  • $http_response_headers : SPHTTPClient
  • $http_response_location : SPHTTPClient
  • $http_response_text : SPHTTPClient
  • $import_form : ContactsHandler
  • $include_in_state : SPOAuthClient
  • $invite_done : ContactsHandler
  • $invite_form : ContactsHandler
  • $login_url : GoogleLoginClient
  • $LoginResponse : GoogleLoginClient
  • $name : SPContactsItem
  • $password : SPContacts
  • $private_oauth_parms : SPOAuthClient
  • $RawSource : SPContactsBase
  • $redirect_url : ContactsHandler
  • $request_headers : SPHTTPClient
  • $response_charset : SPHTTPClient
  • $response_content_type : SPHTTPClient
  • $response_parm : ExternalAuthHandler
  • $return_arrays : SPContactsBase
  • $return_response_body : SPHTTPClient
  • $return_response_headers : SPHTTPClient
  • $ReturnUnparsed : SPContactsBase
  • $screenname_domain : Yahoo
  • $Service : GoogleLoginClient
  • $session_init : ContactsHandler
  • $settings : SPUserSettings
  • $timeout : SPHTTPClient
  • $url_key : PlaxoExtAuth , SPContactsExtAuth , GmailExtAuth , YahooExtAuth
  • $UserAuthorizationNeeded : SPContactsExtAuth
  • $UserAuthorizationUrl : SPContactsExtAuth
  • $username : SPContacts

- a -

  • AccountDeleted : GoogleAuthResponses
  • AccountDisabled : GoogleAuthResponses
  • Authenticated : GoogleAuthResponses

- b -

  • BadAuthentication : GoogleAuthResponses

- c -

  • CaptchaRequired : GoogleAuthResponses

- e -

  • EmailPasswordMissing : GoogleAuthResponses
  • ERROR_CAPTCHA_REQUIRED : ContactsResponses
  • ERROR_EXTERNAL_AUTH : ContactsResponses
  • ERROR_INVALID_LOGIN : ContactsResponses
  • ERROR_NO_CONTACTS : ContactsResponses
  • ERROR_NO_USERPASSWORD : ContactsResponses
  • ERROR_UNKNOWN : ContactsResponses

- g -

  • GOOGLE : GoogleAccountTypes

- h -

  • HOSTED : GoogleAccountTypes
  • HOSTED_OR_GOOGLE : GoogleAccountTypes
  • HTTP_AUTH_GET : SPOAuthClient
  • HTTP_AUTH_HEADER : SPOAuthClient
  • HTTP_AUTH_POST : SPOAuthClient
  • HTTP_BAD_REQUEST : SPConstants
  • HTTP_FORBIDDEN : SPConstants
  • HTTP_FOUND : SPConstants
  • HTTP_METHOD_GET : SPConstants
  • HTTP_METHOD_NOT_ALLOWED : SPConstants
  • HTTP_METHOD_POST : SPConstants
  • HTTP_MOVED_PERMANENTLY : SPConstants
  • HTTP_NOT_FOUND : SPConstants
  • HTTP_OK : SPConstants
  • HTTP_UNAUTHORIZED : SPConstants
  • HTTPError : GoogleAuthResponses

- n -

  • NotVerified : GoogleAuthResponses

- o -

  • OAUTH_ACCESS_ERROR : SPOAuthClient
  • OAUTH_ACCESS_SUCCESS : SPOAuthClient
  • OAUTH_HTTP_ERROR : SPOAuthClient
  • OAUTH_RESPONSE_UNKNOWN : SPOAuthClient
  • OAUTH_USER_AUTH : SPOAuthClient

- s -

  • ServiceDisabled : GoogleAuthResponses
  • ServiceUnavailable : GoogleAuthResponses

- t -

  • TermsNotAgreed : GoogleAuthResponses

- u -

  • Unknown : GoogleAuthResponses


  • All
  • Functions
  • Variables
  • Enumerations
  • SVETLOZARNET_CONTACTS : init.php
  • SVETLOZARNET_DIR : init.php
  • SVETLOZARNET_WEBCLIENTS : init.php


  • All
  • Functions
  • Variables
  • Enumerations
  • Redirect() : external.page.php
  • ReturnToParent() : external.page.php


  • All
  • Functions
  • Variables
  • Enumerations
  • $callback_url : settings.php
  • $handler : external.php , index.php
  • $settings : settings.php
  • if : contacts.import.php , contacts.page.php


Graph Legend

This page explains how to interpret the graphs that are generated by doxygen.

Consider the following example:

/*! Invisible class because of truncation */
class Invisible { };

/*! Truncated class, inheritance relation is hidden */
class Truncated : public Invisible { };

/* Class not documented with doxygen comments */
class Undocumented { };

/*! Class that is inherited using public inheritance */
class PublicBase : public Truncated { };

/*! A template class */
template<class T> class Templ { };

/*! Class that is inherited using protected inheritance */
class ProtectedBase { };

/*! Class that is inherited using private inheritance */
class PrivateBase { };

/*! Class that is used by the Inherited class */
class Used { };

/*! Super class that inherits a number of other classes */
class Inherited : public PublicBase,
                  protected ProtectedBase,
                  private PrivateBase,
                  public Undocumented,
                  public Templ<int>
{
  private:
    Used *m_usedClass;
};

This will result in the following graph:

The boxes in the above graph have the following meaning:

  • A filled gray box represents the struct or class for which the graph is generated.
  • A box with a black border denotes a documented struct or class.
  • A box with a grey border denotes an undocumented struct or class.
  • A box with a red border denotes a documented struct or class forwhich not all inheritance/containment relations are shown. A graph is truncated if it does not fit within the specified boundaries.

The arrows have the following meaning:

  • A dark blue arrow is used to visualize a public inheritance relation between two classes.
  • A dark green arrow is used for protected inheritance.
  • A dark red arrow is used for private inheritance.
  • A purple dashed arrow is used if a class is contained or used by another class. The arrow is labeled with the variable(s) through which the pointed class or struct is accessible.
  • A yellow dashed arrow denotes a relation between a template instance and the template class it was instantiated from. The arrow is labeled with the template parameters of the instance.


Class Hierarchy

Go to the graphical class hierarchy

This inheritance list is sorted roughly, but not completely, alphabetically:
  • ContactsClass
  • ContactsHandler
    • ExternalAuthHandler
  • ContactsHelper
  • ContactsResponses
  • GoogleAccountTypes
  • GoogleAuthResponses
  • IObjectState
    • IAuthState
      • GoogleLoginClient
    • SPContacts
      • AOL
      • Gmail
      • Hotmail
      • Plaxo
      • Yahoo
    • SPContactsExtAuth
      • GmailExtAuth
      • PlaxoExtAuth
      • YahooExtAuth
    • SPOAuthClient
  • SPConstants
  • SPContactsBase
    • SPContacts
    • SPContactsExtAuth
  • SPContactsItem
  • SPHTTPClient
    • GoogleLoginClient
    • SPHTTPSession
    • SPOAuthClient
  • SPUserSettings
  • SPUtils


Svetlozar.NET Contacts Importer (PHP) Documentation

  • Main Page
  • Related Pages
  • Data Structures
    • Data Structures
    • Class Hierarchy
    • Data Fields
  • Files
    • File List
    • Globals
  • Directories


Related Pages

Here is a list of all related documentation pages:
  • Example Code Documentation