function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Boulder MikeBoulder Mike 

Calling "create" or "update" with PHP 5

I've found that because PHP 5.0.4 doesn't handle "create" or "update" very well because of how it tries to interpret the abstract class of "sObjects".

A couple of people have posted work-arounds on blogs elsewhere (see below for links). As of PHP 5.1.0 and PHP 5.0.5 (neither of which have been released yet), the SOAP support will become much more flexible and will do several things:

    • Handle the session header more elegantly

    • Allow you to call sForce methods directly -- no need to overload the "call" method


    PHP 5.1.0 looks to be finalized in September.


    http://www.schlossnagle.org/~george/blog/index.php?/archives/235-Salesforce.com-and-PHP.html and http://www.suraski.net/blog/index.php?/archives/5-PHP-5s-SOAP-extension-and-SalesForce.html
    adamgadamg
    That seems to be my conclusion as well; use the Pear SOAP stuff now or wait for 5.1..
    SynchroSynchro
    This gives the impression that PHP5 SOAP extension is not currently usable. That's not true, it's working fine for me in 5.0.4. I've found George's workaround to be pretty straightforward - once you have set up the 2-line patch via __call, everything just works as it should in a proper WSDL style (and not like the sforce PHP4 classes which are very mucky by comparison). Mind you, after reading Zeev's post I'm now developing on PHP 5.1RC1! The new functions are also available in 5.0.5RC2.
    SynchroSynchro
    Uh.. duh.. I was not thinking about the sObject abstraction thing, only the simple setup problems with headers (which means that you can call the functions much more easily), so the two bullets you wrote are not really a problem, but your first point still is.
    runawaydogrunawaydog

    does anyone know if php 5.0.5 will be released this month (sept)?

    SynchroSynchro
    From last night on php-internals:

    On 4 Sep 2005, at 22:00, Zeev Suraski wrote:
    > If there are no (ultra last) objections, I'll roll 5.0.5 tomorrow morning (.il/Europe time) and post it in the evening.

    5.1 is a much more interesting prospect - the new SOAP stuff is not actually usable in RC1, but if you pull a recent version from snaps.php.net, it works very nicely - my SF SoapClient subclass has about halved in size. I'd guess that 5.1 should be final in the next couple of weeks.