hipsterjazzbo / LaraParse

LaraParse provides a nice integration for using Parse (parse.com) with Laravel 5+
MIT License
27 stars 20 forks source link

Parse PHP SDK 1.2.1 #50

Open andrewblount opened 8 years ago

andrewblount commented 8 years ago

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!

ghost commented 8 years ago

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

andrewblount commented 7 years ago

Any updates on this problem ?