open core »

TwitterPHP 0.5 released and lessons learned...

I've released this Friday a new version of the TwitterPHP library. In this version I've done some code optimization, removed some files and changed to Doxygen for class documentation.

First, all methods were returning a SimpleXML object, which is a mistake in terms of flexibility. I've changed them all to just return a XML string. Now its up to the user (programmer) to choose the way to access/parse the XML.

Second, TwitterPHP is a class, you can instantiate it several times, for let's say, accessing multiple accounts. At least you should be able to do that, but since I was reading the Twitter username and password from a configuration file (naive, I know), multiple instances could only use the same account. Now the problem is solved by simply adding the username and password as arguments of the constructor method and removing the configuration file.

Third and last, I switched from PHPDocumentor to Doxygen. This was mainly because I found out that Doxygen is much more flexible, I can use it with any other project with any other language. And the resulting documentation is more fast and clean than PHPDocumentor.

So you can take a look at the new version of TwitterPHP here and the documentation generated by Doxygen here.

In future releases I'm planning to add OAuth support and implement more Twitter API actions.