PRADHAN-P / php-twitter

Automatically exported from code.google.com/p/php-twitter
0 stars 0 forks source link

twitterAvailable() doesn't work as expected, always returning false #29

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Call twitterAvailable() and var_dump the returning value.

What is the expected output? What do you see instead?
It should return true or false.

What version of the product are you using? On what operating system?
1.1, PHP 5.2.6 aso.

Please provide any additional information below.
It seems as twitterAvailable() or objectify() can't handle the result of
http://twitter.com/help/test.xml resp. http://twitter.com/help/test.json

test.json returns:
"ok"

test.xml returns:
<ok>true</ok>

objectify() translates that into:
json:
string(4) ""ok""

xml:
object(SimpleXMLElement)#3 (1) {
  [0]=>
  string(4) "true"
}

twitterAvailable() compares the return value of objectify() against "ok".
Thus the comparision always returns false.

twitterAvailable() should mind the type set (xml or json) and then apply a
comparision based on the type.

Original issue reported on code.google.com by saschaacarlin on 24 Apr 2009 at 11:07

GoogleCodeExporter commented 9 years ago
Thanks. r97 fixes branches/1.1 and r98 fixes trunk.

In 1.2 we will be eliminating support for XML.

Original comment by emmenset...@gmail.com on 16 Jun 2009 at 6:00

GoogleCodeExporter commented 9 years ago

Original comment by emmenset...@gmail.com on 16 Jun 2009 at 6:01