View Single Post
  #1   Spotlight this post!  
Unread 04-05-2008, 20:06
Nibbles Nibbles is offline
Interstellar Hitchhiker
AKA: Austin Wright
FRC #0498 (Cobra Commanders)
Team Role: Alumni
 
Join Date: Jan 2008
Rookie Year: 2003
Location: Arizona
Posts: 103
Nibbles is just really niceNibbles is just really niceNibbles is just really niceNibbles is just really niceNibbles is just really nice
Re: [TBA]: API Client Development

Quote:
Originally Posted by Nibbles View Post
I noticed other threads with people having problems. PHP5 has this great new thing called Exceptions. If there is an error, it will kill the execution of the script, unless the programmer has a method of catching and handling the exception.
The official PHP client is serverely lacking in error checking, for instance, if the API server returns a blank XML (XHTML, say) document, then no error will pop up.
...
I implemented the function into the class file, and implemented more error checking and exception throwing.

No license of any sort was included with the PHP5 library, nothing. I modified it with rights implied, and my changes are in the public domain (since there is no real logic or creativity in my changes). Feel free to re-license with whatever you want.

List of changes:
  • implemented exceptions, replaced die() ("exit") calls too (see php.net/exceptions)
  • TBA_Exception class for handling API errors
  • PHPDocumentor comments
  • prepended tba_ to all functions as a namespace

I believe I mentioned this, but documenting stuff as a PDF file is very annoying, HTML is fine thank you.
Attached Files
File Type: zip tba_php5_api.zip (250.0 KB, 95 views)
__________________
Help standardize match data! Use the XML interchange format. (Specification page)
AAA_awright on Freenode IRC chat. (Join us at ##FRC on chat.freenode.net, or in your browser)

Last edited by Nibbles : 04-05-2008 at 20:06. Reason: rogue link
Reply With Quote