LaraParse icon indicating copy to clipboard operation
LaraParse copied to clipboard

Parse PHP SDK 1.2.1

Open andrewblount opened this issue 8 years ago • 2 comments

Hey guys, the Parse SDK has been updated and the module fails because a change they added in their "setServerURL" method in ParseClient class. They are now requiring a second argument called "mountPath" which is not provided by LaraParse when it initializes the Parse server connection.

I had to move back to 1.2.0 so I can make it work and it is ok, but I love your module and I thought it'll be a good idea to let you know about your problem.

Here's the new function declaration in the ParseClient function:

public static function setServerURL($serverURL, $mountPath) {
        if (!$serverURL) {
            throw new Exception('Invalid Server URL.');
        }
        if( !$mountPath) {
            throw new Exception('Invalid Mount Path.');
        }
        self::$serverURL = rtrim($serverURL,'/');
        self::$mountPath = trim($mountPath,'/') . '/';
    }

Here's the call in the ParseServiceProvider.php


private function bootParseClient()
    {
        $config = $this->app['config']->get('parse');

        // Init the parse client
        ParseClient::initialize($config['app_id'], $config['rest_key'], $config['master_key']);

        if (empty($config['server_url']) != true) {
            ParseClient::setServerURL($config['server_url']);
        }

        ParseClient::setStorage(new ParseSessionStorage($this->app['session']));
    }

Thank you guys for your awesome work!

andrewblount avatar Jul 07 '16 15:07 andrewblount

will look at filing a PR for this over the weekend if nobody else has time

ghost avatar Jul 07 '16 19:07 ghost

Any updates on this problem ?

andrewblount avatar Jul 26 '16 09:07 andrewblount