mailjet / mailjet-apiv3-php-simple

[API v3] Simple PHP wrapper for the Mailjet API /!\ [DEPRECATED - SEE README] /!\
https://dev.mailjet.com
MIT License
55 stars 45 forks source link

Json encode doesnt work with parameters in PHP version 5.3 #118

Closed giak closed 9 years ago

giak commented 9 years ago

this not compatible with PHP version < 5.4.0 json_encode($params, JSON_UNESCAPED_SLASHES)

Need to remove the second parameter to worked in PHP 5.3

We could do this : if (version_compare(phpversion(), '5.4.0', '<')) { $data= json_encode($params); } else { $data= json_encode($params, JSON_UNESCAPED_SLASHES); }

WeshGuillaume commented 9 years ago

Hi @giak ! Sorry for the delay !

I came up with a fix, please let me know if it works for you implementation ! :) https://travis-ci.org/mailjet/mailjet-apiv3-php-simple

It is already on branch master

Best, Guillaume

giak commented 9 years ago

Hi Guillaume,

i'vent see that https://github.com/mailjet/mailjet-apiv3-php-simple/tree/unescaped_slashes_polyfill too lazy to read ;)

Thx

PS : good work by the way about your documention (at least) http://dev.mailjet.com/guides/

arnaudbreton commented 9 years ago

Thanks for your kind words on the new API documentation, glad you love it!