How are connections accessed with the 2007 Facebook PHP SDK?
so with the new graph API i can access a user's statuses with something straightforward like:
$facebook->api('/me/statuses');
However, I am currently stuck with the older Facebook PHP library (~2007, copyright 2004-2009). Will switch later but for now need to make this work with the old library.
Question: How do I do the same thing (get a user's statuses, or other allowed connections) given a facebook object has been defined like:
$facebook = new Facebook(API_KEY, SECRET);
I don'开发者_开发百科t see any references to the old documentation that could help.
Thanks!
Why not use both the new version and the old version? You will probably need to edit one of the versions and change the name of the class in the file so there are no conflicts when including the files. But you should be able to create 2 instances, one with the new version and one with the old.
But regardless, both versions in the end to a curl request. You can search the code for curl_exec to find the 1 function that everything eventually funnels through. This is true in both the older and new versions.
Got my own answer. Doing the same thing with the old REST API is simple with:
$facebook->api_client->users_getInfo($fb_id, 'status')
Now need to figure out Brent Baisley's suggestion about having two instances running at the same time...that would be pretty neat.
精彩评论