lildude / phpSmug

:camera: phpSmug is a simple object orientated wrapper for the new SmugMug API v2, written in PHP.
https://lildude.github.io/phpSmug
MIT License
42 stars 19 forks source link

Problems with expansions #47

Closed asherber closed 6 years ago

asherber commented 6 years ago

I'm having a couple of problems with expansions in v4.

  1. Since get() returns only the Response part, adding an _expand param doesn't seem to give any way of accessing the Expansions element. Should there be a $client->getExpansions() method? Or should any use of an _expand parameter silently add _expandmethod=inline?

  2. phpSmug doesn't seem to like multiple expansions. If I do get('user/[username]!albums?_expandmethod=inline&_expand=Node') I get the expected response, but if I do get('user/[username]!albums?_expandmethod=inline&_expand=Node,HighlightImage') I don't get either URI expanded. (Same results either using $options or specifying the query string in get().) Making the request from Postman does give the multiple expansion.

lildude commented 6 years ago

Whoops. I knew there was something I hadn’t finished doing. I started adding support for expansions in the branch at https://github.com/lildude/phpSmug/tree/add-support-for-expansions (diff: https://github.com/lildude/phpSmug/compare/master...add-support-for-expansions) but got distracted and completely forgot about it 😊

I’ll try find some time in the coming weeks to finish this off. Looks like it’s mostly there… just need to test multiple expansions and implement a solution if needed.