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

Class: GliffyResponseParser

Source Location: /GliffyResponseParser.php

Class Overview

Parses a Gliffy response.




Class Details

[line 14]
Parses a Gliffy response.

This can have three basic results:

  • The response was well-formed and represents a normal respons. See GliffyResponse.
  • The response represents an error you made in your request on one on the Gliffy side. The GliffyResponse has the error information
  • The response was not a proper Gliffy response.
Also note that this uses PHP's DOM parser. This means that the error reporting you get back will be pretty bad. Hopefully, this will not be a problem, since Gliffy response are relatively short and simple. Further, Gliffy should never send you an unparsable response.


example:  example not found

[ Top ]

Class Methods

method error_message [line 195]

string error_message( )

If response() returns null, this provides a probably explanation as to the problem.

This is more for debugging your code, and less for informing the user


return:  the error message, if there was a problem
access:  public

[ Top ]

constructor GliffyResponseParser [line 45]

GliffyResponseParser GliffyResponseParser( mixed $data, [integer $log_level = GliffyLog::LOG_LEVEL_WARN], [boolean $save_content = false], [boolean $binary = false])

Create a GliffyResponseParser for some received XML.


access:  public


mixed   $data   the response that you received. If this is in Gliffy Response XML, it will be parsed. Otherwise, this will do the best it can to determine what to do with it.
integer   $log_level   one of the constants of this class to represent the level of logging.
boolean   $save_content   if true, the raw content is saved in the returned response. Useful for braindead testing of Gliffy
boolean   $binary   if true, indicates we think this is binary data Messages are logged via error_log

[ Top ]

method response [line 188]

GliffyResponse response( )

Gets the response, as a GliffyResponse, parsed in the constructor.

May return null. If so, that represents a parsing error.


return:  the response that was parsed, or null if there was a problem
see:  GliffyResponseParser::error_message()
access:  public

[ Top ]

method warnings [line 202]

array warnings( )

Get the warnings generated by parsing.

This is useful if you want easier access to warnings than via the logging mechanism


return:  strings representing all the warnings
access:  public

[ Top ]

Class Constants

accounts_xml_name =  "accounts"

[line 18]

[ Top ]

account_type_xml_name =  "account-type"

[line 17]

[ Top ]

account_xml_name =  "account"

[line 16]

[ Top ]

diagrams_xml_name =  "diagrams"

[line 20]

[ Top ]

diagram_xml_name =  "diagram"

[line 19]

[ Top ]

error_xml_name =  "error"

[line 21]

[ Top ]

folders_xml_name =  "folders"

[line 23]

[ Top ]

folder_xml_name =  "folder"

[line 22]

[ Top ]

launch_link_xml_name =  "launch-link"

[line 24]

[ Top ]

oauth_token_xml_name =  "oauth-token"

[line 29]

[ Top ]

response_xml_name =  "response"

[line 25]

[ Top ]

users_xml_name =  "users"

[line 28]

[ Top ]

user_token_xml_name =  "user-token"

[line 27]

[ Top ]

user_xml_name =  "user"

[line 26]

[ Top ]

Documentation generated on Wed, 01 Apr 2009 18:11:09 -0700 by phpDocumentor 1.4.1