enisz / igdb

IGDB PHP API Wrapper
GNU General Public License v3.0
27 stars 8 forks source link

Version for v3 #2

Closed ponasromas closed 4 years ago

ponasromas commented 4 years ago

Hello,

is there any chance that you will release upgraded version for v3 API?

enisz commented 4 years ago

Hi,

I wasn't planning to write a new class for the v3 api. However, I can check the new API and If I have enough time I may write one.

ponasromas commented 4 years ago

That would be awesome!

enisz commented 4 years ago

I just had a little free time to check it and it seems there are still some backward compatibility in the new API so updating the $API_URL in class.igdb.php can work as a workaround for now.

        // IGDB API url
        private $API_URL = 'https://api-v3.igdb.com';

I have tried to execute the _basic_example.php file of the example scripts and there was some kind of error

array (size=1)
  0 => 
    object(stdClass)[2]
      public 'title' => string 'Not Acceptable Query' (length=20)
      public 'status' => int 406
      public 'cause' => string 'Your query has both search and sort' (length=35)
      public 'details' => string 'Search is sorting on relevancy and therefore sort is not applicable on search' (length=77)

It seems the API has changed a lot and the queries from the old version may not work with the new one (removing the order parameter from the options array in the exmple script will fix this issue).

If I have some free time I can check this issue.

enisz commented 4 years ago

Hi @ponasromas ,

I have updated the class to be compatible with the v3 IGDB API. There may be bugs because I didn't have time to test it thoroughly.

If you face any issues feel free to open new issues.

I'm closing this thread now.