I used both the official and unofficial PHP API libraries and saw this same problem. I took a closer look and it seems as though the page_size parameter needs to be the first argument in the request query string. I detailed the issue here: http://www.nakedtechnologist.com/?p=79
I took the unofficial API library and revised the files. The following changes have been made to it:
- OAuth.php - I reversed the array merge order in the from_consumer_and_token() function. This allowed the user defined parameters (and page size) to be the first parameters in the query string after the request URI.
- Space.php - I modified the friends() function. I was also having the problem here that the array of parameters was not making it through to the OAuth function. I updated it a little, changed page_size to be the first one in the array and updated the default values of the function to return all friends.
So now, when requesting friends you can make the following call:
$session = new Space(Config::$MS_APPLICATION_KEY, Config::$MS_APPLICATION_SECRET);
$friend_list = $session->friends('USER_ID',1,'all');
where the 1 is the page, all is the number of friends to return and, optionally, a 4th parameters is the list.
You can download the revised zip file directly here: http://www.nakedtechnologist.com/files/ms_unofficial_php_api_with_friend_fix.zip
I would recommend backing up your existing files since I just made these changes yesterday and have not tested them against all available functionality.
Let me know if you run into any issues,
Jonathan LeBlanc