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

Class: GliffyREST

Source Location: /GliffyREST.php

Class Overview


Interacts with Gliffy REST protocol.


Author(s):

Methods



Class Details

[line 10]
Interacts with Gliffy REST protocol.

This class is de-coupled from the api key, shared secret, api URL root and user token and simply handles the arrangment and signing of requests, sending them to gliffy and receiving them back. The results are all parsed into a GliffyResponse.




Tags:

example:  example not found


[ Top ]


Class Methods


constructor GliffyREST [line 43]

GliffyREST GliffyREST( string $token, [string $oauth_consumer_key = null], [string $oauth_consumer_secret = null], [boolean $strict_rest = null], [boolean $tunnel = null])

Create a GliffyREST object to make REST calls to Gliffy. The recommended usage of this is to ensure proper values for globals (see config_example.php) and to create this as needed using the user's login token.



Tags:

access:  public


Parameters:

string   $token   the user token assigned to the current application user (may be null for certain requests).
string   $oauth_consumer_key   the API Key assigned to you by Gliffy
string   $oauth_consumer_secret   the secret key assigned to you by Gliffy
boolean   $strict_rest   if false, tells Gliffy not to send HTTP errors, but to encode errors as gliffy response (see GliffyError). Default false.
boolean   $tunnel   if true, DELETE and PUT calls are tunneled over POST. Default true.

[ Top ]

method close [line 263]

void close( )

Call this when are you done with an instance of this class



Tags:

access:  public


[ Top ]

method get [line 109]

GliffyResponse get( string $url, string $mime_type, array $params, [boolean $url_only = false], [array $headers = array()])

Send a GET request to the given URL



Tags:

return:  Whatever gets sent back from the server
access:  public


Parameters:

string   $url   the URL, relative to the base URL given to the constructor, to GET
string   $mime_type   the mime type of how you would like the results. If the resource doesn't support this mime type, or if there is some error on the Gliffy side, you will get XML back.
array   $params   an associative array of parameters to include in the request
boolean   $url_only   if true, the GET is not performed; the URL is simply returned
array   $headers   of additional headers to pass into request

[ Top ]

method get_simple [line 95]

GliffyResponse get_simple( string $url)

Performs a get request 'text/xml' with no parameters.

Basically a convienience method for the full get method




Tags:

return:  whatever was returned by the other get
access:  public


Parameters:

string   $url   the url to GET

[ Top ]

method post [line 188]

GliffyResponse post( string $url, array $params, [array $headers = array()], [ $useHttps = false])

Send a POST request to the given URL



Tags:

return:  Whatever gets sent back from the server (either XML or a blank string, most likely)
access:  public


Parameters:

string   $url   the URL, relative to the base URL given to the constructor, to POST
array   $params   parameters to include in the POST.
array   $headers   headers to include in the POST.
   $useHttps  

[ Top ]

method updateToken [line 79]

void updateToken( string $token)

Update the token to use for requests.



Tags:

access:  public


Parameters:

string   $token   the new token to use in requests

[ Top ]


Documentation generated on Mon, 13 Jul 2009 19:54:34 -0500 by phpDocumentor 1.4.1