Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HHVM Compatibility in Error? #21

Open
bartclarkson opened this issue Jun 3, 2015 · 2 comments
Open

HHVM Compatibility in Error? #21

bartclarkson opened this issue Jun 3, 2015 · 2 comments

Comments

@bartclarkson
Copy link

travis.yml indicates this is compatible with HHVM. I'm not seeing that. I'm using HHVM 3.7. PHP5-FPM works just fine. With HHVM, LoginResult just comes back with a bunch of NULL values in the array of protected values, leading me ultimately to an error from Salesforce of "Destination URL not reset. The URL returned from login must be set in the SforceService" from a subsequent request.

I'm going to mess with this a bit more. Would be nice to solve. Wondering if this is fundamentally the culprit: http://docs.hhvm.com/manual/en/soapclient.soapclient.php .

@ddeboer
Copy link
Member

ddeboer commented Jun 3, 2015

Let us know what you find!

@bartclarkson
Copy link
Author

All righty, got it working. HHVM will not overwrite variables contained within the various mapped Result/Request classes unless they are a.) public variables,

class LoginResult
{
    public $metadataServerUrl;  // Yep.
    protected $passwordExpired;  // Nope.
    protected $sandbox;
    protected $serverUrl;
    protected $sessionId;
    protected $userId;
    protected $userInfo;

or b.) __set() is explicitly included in the given class in the following manner:

    public function __set($name, $value)
    {
        $this->{$name} = $value;
    }

In my project I set all Request/Result Class parameters as public to achieve complete bundle success with HHVM, while continuing success with PHP5-FPM.

What's the reason for setting any of the Request/Result Class parameters as protected? It's kind of a funky idea, given that a.) the setting of variables by SoapClient with PHP5-FPM obviously respects nothing, and b.) what protection are we really trying to accomplish? I more or less see the Classmap deal as a convenience and a type hinting benefit, rather than a control mechanism, so to speak.

Anyway, that's my rhyme. @ddeboer , your call. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants