phpforce / soap-client

A PHP client for the Salesforce SOAP API
MIT License
81 stars 75 forks source link

Fixed variable scoping issue which can lead to out of memory error. #9

Closed shaunhardy closed 10 years ago

shaunhardy commented 10 years ago

The $properties variable I'm assuming was expected to go out of scope, however it does not. Each iteration through the SOAP types appends more elements to the $properties array without clearing the data from the previous iteration, leading to massive memory consumption and Out of Memory errors in some cases. I added an explicit reassignment to the $properties variable.

In my specific case, this consumed 171MB, and has been reduced to 2MB.

ddeboer commented 10 years ago

I guess the problem was that the $properties variable wasn’t be defined at all. Good catch, thanks!

shaunhardy commented 10 years ago

Yup, I'm seeing that as well. It looks like it's a bug in the PHP SOAP library. https://bugs.php.net/bug.php?id=45404

\SoapClient::__getTypes() is ignoring extensions. In the WSDL, Id is defined in the sObject, and extended in Account, etc.

daum commented 10 years ago

@ddeboer any chance you are going to merge this soon?

ddeboer commented 10 years ago

This PR is already merged. Can you open a new one?

daum commented 10 years ago

Ah disregard that comment - I misread @shaunhardy comment. Having the issue he is talking about in #11 . will follow up on that ticket.