Tcheu / craftcms-httprequest

Plugin for Craft CMS: Create and send HTTP requests from templates and retrieve the response, in JSON or plain text.
MIT License
12 stars 3 forks source link

Parse Error with PHP 5.3 #2

Closed taylorehat closed 9 years ago

taylorehat commented 9 years ago

I am getting a php parse error with PHP 5.3.X:

Parse error: syntax error, unexpected '[' in /~myserverpath/craft/plugins/httpreq/variables/HttpReqVariable.php on line 14

Any thoughts on how to make this backwards compatible with Craft's minimum supported version?

kant312 commented 9 years ago

Hi,

It should not be an issue, we simply used the short notation for creating arrays, but it is indeed only available as of PHP 5.4. What I can do is replace them with the classic array notation. I'll mark this ticket as closed once it is done.

taylorehat commented 9 years ago

Cool. Thanks.

kant312 commented 9 years ago

You're welcome ^^

taylorehat commented 9 years ago

Looks like on line 60, 84, 91, 124, 175, 230 & 243 of HttpReq_RestClientService.php also needs to be updated to array()

Thanks

kant312 commented 9 years ago

Sorry, I don't have a PHP 5.3 environment to test it unfortunately.

Line 60 seems to use the classic notation though: https://github.com/Tcheu/craftcms-httprequest/blob/master/httpreq/services/HttpReq_RestClientService.php#L60

taylorehat commented 9 years ago

Sorry looks like my file is outdated. Nevermind.