\Horde_Service_Facebook

Facebook Platform PHP5 client

Copyright 2004-2009 Facebook. All Rights Reserved.

Copyright (c) 2007 Facebook, Inc. All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

For help with this library, contact developers-help@facebook.com

Summary

Methods
Properties
Constants
__construct()
__get()
getFacebookUrl()
callMethod()
callGraphApi()
$useSslResources
API_VALIDATION_ERROR
REST_SERVER_ADDR
GRAPH_SERVER_ADDR
No protected methods found
$_secret
$_logger
$_http
$_objCache
N/A
No private methods found
No private properties found
N/A

Constants

API_VALIDATION_ERROR

API_VALIDATION_ERROR

REST_SERVER_ADDR

REST_SERVER_ADDR

GRAPH_SERVER_ADDR

GRAPH_SERVER_ADDR

Properties

$useSslResources

$useSslResources : boolean

Use only ssl resource flag

Type

boolean

$_secret

$_secret : string

The API Secret Key

Type

string

$_logger

$_logger : \Horde_Log_Logger

Holds an optional logger object

Type

\Horde_Log_Logger

$_http

$_http : \Horde_Http_Client

Type

\Horde_Http_Client

$_objCache

$_objCache : \hash

Cache for the various objects we lazy load in __get()

Type

\hash — of Horde_Service_Facebook_* objects

Methods

__construct()

__construct(string  $appId, string  $secret, array  $context) 

Const'r

Parameters

string $appId

Application ID.

string $secret

Developer API secret.

array $context

Array of context information containing:

     http_client - required
     logger
     use_ssl

__get()

__get(string  $value) : mixed

Lazy load the facebook classes.

Parameters

string $value

The lowercase representation of the subclass.

Throws

\Horde_Service_Facebook_Exception

Returns

mixed

getFacebookUrl()

getFacebookUrl(string  $subdomain = 'www') : string

Helper function to get the appropriate facebook url

Parameters

string $subdomain

The subdomain to use (www).

Returns

string

callMethod()

callMethod(string  $method, array  $params = array()) : mixed

Calls the specified normal REST API method.

Parameters

string $method

Name of the Facebook method to invoke

array $params

A map of param names => param values

Returns

mixed —

Result of method call

callGraphApi()

callGraphApi(string  $method = '', array  $params = array(), array  $options = array()) : mixed

Call the Facebook Graph API.

Parameters

string $method

The endpoint (method) to call.

array $params

An array of parameters to pass along with the call.

array $options

Additional request options:

  • request: (string) 'POST', 'GET', 'DELETE' etc..

Returns

mixed —

The results of the API call.